You've already forked FinalYearProject-MyMind
mirror of
https://github.com/MrLyallCSIT/FinalYearProject-MyMind.git
synced 2026-01-18 07:09:41 +00:00
Trying to Implement Login System
This commit is contained in:
19
My Mind/Carthage/Build/.SwiftForms.version
generated
vendored
Normal file
19
My Mind/Carthage/Build/.SwiftForms.version
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"commitish" : "1.7",
|
||||
"iOS" : [
|
||||
{
|
||||
"hash" : "045deef96b266613799a0dd27287607b12f5b43daede54ba2359c759cd9cb0f5",
|
||||
"name" : "SwiftForms"
|
||||
}
|
||||
],
|
||||
"xcodeVersion" : "Xcode 8.3\nBuild version 8E162",
|
||||
"watchOS" : [
|
||||
|
||||
],
|
||||
"tvOS" : [
|
||||
|
||||
],
|
||||
"Mac" : [
|
||||
|
||||
]
|
||||
}
|
||||
1908
My Mind/Carthage/Build/iOS/16344ACE-31D7-3149-8D5B-49B11957E0F6.bcsymbolmap
generated
vendored
Normal file
1908
My Mind/Carthage/Build/iOS/16344ACE-31D7-3149-8D5B-49B11957E0F6.bcsymbolmap
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1986
My Mind/Carthage/Build/iOS/B36DDE95-FE71-3754-AC74-7C3867BCEBFC.bcsymbolmap
generated
vendored
Normal file
1986
My Mind/Carthage/Build/iOS/B36DDE95-FE71-3754-AC74-7C3867BCEBFC.bcsymbolmap
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
20
My Mind/Carthage/Build/iOS/SwiftForms.framework.dSYM/Contents/Info.plist
generated
vendored
Normal file
20
My Mind/Carthage/Build/iOS/SwiftForms.framework.dSYM/Contents/Info.plist
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.apple.xcode.dsym.com.ortulabs.SwiftForms</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>dSYM</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.6.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework.dSYM/Contents/Resources/DWARF/SwiftForms
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework.dSYM/Contents/Resources/DWARF/SwiftForms
generated
vendored
Normal file
Binary file not shown.
380
My Mind/Carthage/Build/iOS/SwiftForms.framework/Headers/SwiftForms-Swift.h
generated
vendored
Normal file
380
My Mind/Carthage/Build/iOS/SwiftForms.framework/Headers/SwiftForms-Swift.h
generated
vendored
Normal file
@@ -0,0 +1,380 @@
|
||||
// Generated by Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38)
|
||||
#pragma clang diagnostic push
|
||||
|
||||
#if defined(__has_include) && __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <objc/NSObject.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if defined(__has_include) && __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus) || __cplusplus < 201103L
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__has_attribute) && __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if defined(__has_attribute) && __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if defined(__has_attribute) && __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if defined(__has_attribute) && __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if defined(__has_attribute) && __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if defined(__has_attribute) && __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type
|
||||
# if defined(__has_feature) && __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if defined(__has_feature) && __has_feature(modules)
|
||||
@import UIKit;
|
||||
@import CoreGraphics;
|
||||
@import ObjectiveC;
|
||||
@import Foundation;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
@class FormViewController;
|
||||
@class NSCoder;
|
||||
@class UIView;
|
||||
@class UIResponder;
|
||||
@class UIToolbar;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms12FormBaseCell")
|
||||
@interface FormBaseCell : UITableViewCell
|
||||
@property (nonatomic, weak) FormViewController * _Nullable formViewController;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (UIResponder * _Nullable)firstResponderElement SWIFT_WARN_UNUSED_RESULT;
|
||||
- (UIToolbar * _Nonnull)inputAccesoryView SWIFT_WARN_UNUSED_RESULT;
|
||||
+ (CGFloat)formRowCellHeight SWIFT_WARN_UNUSED_RESULT;
|
||||
+ (BOOL)formRowCanBecomeFirstResponder SWIFT_WARN_UNUSED_RESULT;
|
||||
+ (void)formViewController:(FormViewController * _Nonnull)formViewController didSelectRow:(FormBaseCell * _Nonnull)didSelectRow;
|
||||
- (void)updateConstraints;
|
||||
@end
|
||||
|
||||
@class UILabel;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms13FormTitleCell")
|
||||
@interface FormTitleCell : FormBaseCell
|
||||
@property (nonatomic, readonly, strong) UILabel * _Nonnull titleLabel;
|
||||
- (void)configure;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms14FormButtonCell")
|
||||
@interface FormButtonCell : FormTitleCell
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms13FormCheckCell")
|
||||
@interface FormCheckCell : FormTitleCell
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
+ (void)formViewController:(FormViewController * _Nonnull)formViewController didSelectRow:(FormBaseCell * _Nonnull)selectedRow;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms13FormValueCell")
|
||||
@interface FormValueCell : FormBaseCell
|
||||
@property (nonatomic, readonly, strong) UILabel * _Nonnull titleLabel;
|
||||
@property (nonatomic, readonly, strong) UILabel * _Nonnull valueLabel;
|
||||
- (void)configure;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms12FormDateCell")
|
||||
@interface FormDateCell : FormValueCell
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
+ (void)formViewController:(FormViewController * _Nonnull)formViewController didSelectRow:(FormBaseCell * _Nonnull)selectedRow;
|
||||
- (UIResponder * _Nullable)firstResponderElement SWIFT_WARN_UNUSED_RESULT;
|
||||
+ (BOOL)formRowCanBecomeFirstResponder SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_PROTOCOL("_TtP10SwiftForms12FormSelector_")
|
||||
@protocol FormSelector <NSObject>
|
||||
@property (nonatomic, strong) FormBaseCell * _Nullable formCell;
|
||||
@end
|
||||
|
||||
@class NSBundle;
|
||||
@class UITableView;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms29FormOptionsSelectorController")
|
||||
@interface FormOptionsSelectorController : UITableViewController <FormSelector>
|
||||
@property (nonatomic, strong) FormBaseCell * _Nullable formCell;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
|
||||
- (void)viewDidLoad;
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView * _Nonnull)tableView SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSInteger)tableView:(UITableView * _Nonnull)tableView numberOfRowsInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForHeaderInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath SWIFT_WARN_UNUSED_RESULT;
|
||||
- (void)tableView:(UITableView * _Nonnull)tableView didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewStyle)style SWIFT_UNAVAILABLE;
|
||||
@end
|
||||
|
||||
@class UIPickerView;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms14FormPickerCell")
|
||||
@interface FormPickerCell : FormValueCell <UIPickerViewDelegate, UIPickerViewDataSource>
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (UIResponder * _Nullable)firstResponderElement SWIFT_WARN_UNUSED_RESULT;
|
||||
+ (void)formViewController:(FormViewController * _Nonnull)formViewController didSelectRow:(FormBaseCell * _Nonnull)selectedRow;
|
||||
- (NSString * _Nullable)pickerView:(UIPickerView * _Nonnull)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component SWIFT_WARN_UNUSED_RESULT;
|
||||
- (void)pickerView:(UIPickerView * _Nonnull)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
|
||||
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView * _Nonnull)pickerView SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSInteger)pickerView:(UIPickerView * _Nonnull)pickerView numberOfRowsInComponent:(NSInteger)component SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
@class UISegmentedControl;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms24FormSegmentedControlCell")
|
||||
@interface FormSegmentedControlCell : FormBaseCell
|
||||
@property (nonatomic, readonly, strong) UILabel * _Nonnull titleLabel;
|
||||
@property (nonatomic, readonly, strong) UISegmentedControl * _Nonnull segmentedControl;
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms16FormSelectorCell")
|
||||
@interface FormSelectorCell : FormValueCell
|
||||
- (void)update;
|
||||
+ (void)formViewController:(FormViewController * _Nonnull)formViewController didSelectRow:(FormBaseCell * _Nonnull)selectedRow;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
@class UISlider;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms14FormSliderCell")
|
||||
@interface FormSliderCell : FormTitleCell
|
||||
@property (nonatomic, readonly, strong) UISlider * _Nonnull sliderView;
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
@class UIStepper;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms15FormStepperCell")
|
||||
@interface FormStepperCell : FormTitleCell
|
||||
@property (nonatomic, readonly, strong) UIStepper * _Nonnull stepperView;
|
||||
@property (nonatomic, readonly, strong) UILabel * _Nonnull countLabel;
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
@class UISwitch;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms14FormSwitchCell")
|
||||
@interface FormSwitchCell : FormTitleCell
|
||||
@property (nonatomic, readonly, strong) UISwitch * _Nonnull switchView;
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
@class UITextField;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms17FormTextFieldCell")
|
||||
@interface FormTextFieldCell : FormBaseCell
|
||||
@property (nonatomic, readonly, strong) UILabel * _Nonnull titleLabel;
|
||||
@property (nonatomic, readonly, strong) UITextField * _Nonnull textField;
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (UIResponder * _Nullable)firstResponderElement SWIFT_WARN_UNUSED_RESULT;
|
||||
+ (BOOL)formRowCanBecomeFirstResponder SWIFT_WARN_UNUSED_RESULT;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
@class UITextView;
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms16FormTextViewCell")
|
||||
@interface FormTextViewCell : FormBaseCell <UITextViewDelegate>
|
||||
@property (nonatomic, readonly, strong) UILabel * _Nonnull titleLabel;
|
||||
@property (nonatomic, readonly, strong) UITextView * _Nonnull textField;
|
||||
+ (CGFloat)formRowCellHeight SWIFT_WARN_UNUSED_RESULT;
|
||||
- (void)configure;
|
||||
- (void)update;
|
||||
- (NSDictionary<NSString *, UIView *> * _Nonnull)constraintsViews SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSArray<NSString *> * _Nonnull)defaultVisualConstraints SWIFT_WARN_UNUSED_RESULT;
|
||||
- (void)textViewDidChange:(UITextView * _Nonnull)textView;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Null_unspecified)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10SwiftForms18FormViewController")
|
||||
@interface FormViewController : UITableViewController
|
||||
- (nonnull instancetype)init;
|
||||
- (nonnull instancetype)initWithStyle:(UITableViewStyle)style OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
|
||||
- (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
|
||||
- (void)viewDidLoad;
|
||||
- (id _Nullable)valueForTag:(NSString * _Nonnull)tag SWIFT_WARN_UNUSED_RESULT;
|
||||
- (void)setValue:(id _Nonnull)value forTag:(NSString * _Nonnull)tag;
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView * _Nonnull)tableView SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSInteger)tableView:(UITableView * _Nonnull)tableView numberOfRowsInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSString * _Nullable)tableView:(UITableView * _Nonnull)tableView titleForHeaderInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (NSString * _Nullable)tableView:(UITableView * _Nonnull)tableView titleForFooterInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (UIView * _Nullable)tableView:(UITableView * _Nonnull)tableView viewForFooterInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (UIView * _Nullable)tableView:(UITableView * _Nonnull)tableView viewForHeaderInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForHeaderInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForFooterInSection:(NSInteger)section SWIFT_WARN_UNUSED_RESULT;
|
||||
- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath SWIFT_WARN_UNUSED_RESULT;
|
||||
- (void)tableView:(UITableView * _Nonnull)tableView didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath;
|
||||
@end
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
19
My Mind/Carthage/Build/iOS/SwiftForms.framework/Headers/SwiftForms.h
generated
vendored
Normal file
19
My Mind/Carthage/Build/iOS/SwiftForms.framework/Headers/SwiftForms.h
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// SwiftForms.h
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno Ortuno on 14/5/15.
|
||||
// Copyright (c) 2015 Miguel Angel Ortuno Ortuno. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for SwiftForms.
|
||||
FOUNDATION_EXPORT double SwiftFormsVersionNumber;
|
||||
|
||||
//! Project version string for SwiftForms.
|
||||
FOUNDATION_EXPORT const unsigned char SwiftFormsVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <SwiftForms/PublicHeader.h>
|
||||
|
||||
|
||||
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Info.plist
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Info.plist
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm.swiftdoc
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm.swiftdoc
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm.swiftmodule
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm.swiftmodule
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm64.swiftdoc
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm64.swiftdoc
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm64.swiftmodule
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/arm64.swiftmodule
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/i386.swiftdoc
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/i386.swiftdoc
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/i386.swiftmodule
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/i386.swiftmodule
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/x86_64.swiftdoc
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/x86_64.swiftdoc
generated
vendored
Normal file
Binary file not shown.
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/x86_64.swiftmodule
generated
vendored
Normal file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/SwiftForms.swiftmodule/x86_64.swiftmodule
generated
vendored
Normal file
Binary file not shown.
10
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/module.modulemap
generated
vendored
Normal file
10
My Mind/Carthage/Build/iOS/SwiftForms.framework/Modules/module.modulemap
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
framework module SwiftForms {
|
||||
umbrella header "SwiftForms.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module SwiftForms.Swift {
|
||||
header "SwiftForms-Swift.h"
|
||||
}
|
||||
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/SwiftForms
generated
vendored
Executable file
BIN
My Mind/Carthage/Build/iOS/SwiftForms.framework/SwiftForms
generated
vendored
Executable file
Binary file not shown.
60
My Mind/Carthage/Checkouts/SwiftForms/.gitignore
vendored
Normal file
60
My Mind/Carthage/Checkouts/SwiftForms/.gitignore
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# Compiled source #
|
||||
###################
|
||||
*.com
|
||||
*.class
|
||||
*.dll
|
||||
*.exe
|
||||
*.o
|
||||
*.so
|
||||
|
||||
# Packages #
|
||||
############
|
||||
# it's better to unpack these files and commit the raw source
|
||||
# git has its own built in compression methods
|
||||
*.7z
|
||||
*.dmg
|
||||
*.gz
|
||||
*.iso
|
||||
*.jar
|
||||
*.rar
|
||||
*.tar
|
||||
*.zip
|
||||
|
||||
# Logs and databases #
|
||||
######################
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
# OS generated files #
|
||||
######################
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Pods #
|
||||
########
|
||||
Pods/
|
||||
|
||||
# Xcode #
|
||||
#########
|
||||
build/
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
*.xcworkspace
|
||||
!default.xcworkspace
|
||||
xcuserdata
|
||||
profile
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
.idea/
|
||||
21
My Mind/Carthage/Checkouts/SwiftForms/LICENSE
vendored
Normal file
21
My Mind/Carthage/Checkouts/SwiftForms/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
|
||||
Copyright (c) 2014 Miguel Ángel Ortuño ( ortuman@gmail.com )
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
155
My Mind/Carthage/Checkouts/SwiftForms/README.MD
vendored
Normal file
155
My Mind/Carthage/Checkouts/SwiftForms/README.MD
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
|
||||
[](http://cocoadocs.org/docsets/SwiftForms)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
|
||||
[](http://cocoadocs.org/docsets/SwiftForms)
|
||||
[](http://cocoadocs.org/docsets/SwiftForms)
|
||||
|
||||
SwiftForms
|
||||
==========
|
||||
|
||||
Purpose
|
||||
-------
|
||||
SwiftForms is a powerful and extremely flexible library written in Swift that allows to create forms by just defining them in a couple of lines. It also provides the ability to customize cells appearance, use custom cells and define your own selector controllers.
|
||||
|
||||
#####Here is an screenshot from an example application using SwiftForms
|
||||
|
||||

|
||||
|
||||
How to create a form
|
||||
--------------------
|
||||
|
||||
Creating a form using SwiftForms is pretty straightforward. All you need is to derive your controller from `FormViewController` and define a `FormDescriptor` instance along with its sections and rows. Here is an example of how to create a simple form to input an email and a user password.
|
||||
|
||||
```swift
|
||||
|
||||
// Create form instace
|
||||
var form = FormDescriptor()
|
||||
form.title = "Example form"
|
||||
|
||||
// Define first section
|
||||
var section1 = FormSectionDescriptor()
|
||||
|
||||
var row = FormRowDescriptor(tag: "name", rowType: .Email, title: "Email")
|
||||
section1.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: "pass", rowType: .Password, title: "Password")
|
||||
section1.rows.append(row)
|
||||
|
||||
// Define second section
|
||||
var section2 = FormSectionDescriptor()
|
||||
|
||||
row = FormRowDescriptor(tag: "button", rowType: .Button, title: "Submit")
|
||||
section2.rows.append(row)
|
||||
|
||||
form.sections = [section1, section2]
|
||||
|
||||
self.form = form
|
||||
```
|
||||
To see a more complex form definition you can take a look to the example application.
|
||||
|
||||
Cell appearance
|
||||
----------------------
|
||||
|
||||
Every row descriptor has a `configuration` dictionary that allows to customize cell's appearance and behavior. In order to change concrete visual aspects of a row simply set `row.configuration.cell.appearance` value to a dictionary containing custom key-value coding properties.
|
||||
|
||||
Here's an example:
|
||||
|
||||
```swift
|
||||
row.configuration.cell.appearance = ["titleLabel.font" : UIFont.boldSystemFontOfSize(30.0), "segmentedControl.tintColor" : UIColor.redColor()]
|
||||
```
|
||||
|
||||
Custom cells
|
||||
-----------------
|
||||
|
||||
In addition, it is possible to create 100% custom cells by deriving from `FormBaseCell` class. In that case, don't forget to override `configure` and `update` methods. First method will be called only once and after cell has been created, and the second one every time cell content should be refreshed.
|
||||
|
||||
Here are the methods that help you to define custom cell behavior.
|
||||
```swift
|
||||
func configure() {
|
||||
/// override
|
||||
}
|
||||
|
||||
func update() {
|
||||
/// override
|
||||
}
|
||||
|
||||
class func formRowCellHeight() -> CGFloat {
|
||||
return 44.0
|
||||
}
|
||||
|
||||
class func formViewController(formViewController: FormViewController, didSelectRow: FormBaseCell) {
|
||||
}
|
||||
```
|
||||
Once you have defined your custom cell, and in order to use it for a concrete row, you'll have to set `FormRowDescriptor` cellClass property.
|
||||
|
||||
Custom selector controllers
|
||||
-------------------------------------
|
||||
|
||||
In order to customize selector controller your class should conform to `FormSelector` protocol. That way you'll have access to the cell instance that pushed the controller, being able to alter its properties or setting it's row value accordingly to user interaction.
|
||||
|
||||
After defining your class, don't forget to set `row.configuration.selection.controllerClass` value in the configuration dictionary to use your custom selector controller.
|
||||
|
||||
Requirements
|
||||
---------------------
|
||||
|
||||
* iOS 8.0 and above
|
||||
|
||||
### CocoaPods
|
||||
|
||||
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.
|
||||
|
||||
CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:
|
||||
|
||||
```bash
|
||||
$ gem install cocoapods
|
||||
```
|
||||
|
||||
To integrate SwiftForms into your Xcode project using CocoaPods, specify it in your `Podfile`:
|
||||
|
||||
```ruby
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '8.0'
|
||||
use_frameworks!
|
||||
|
||||
pod 'SwiftForms'
|
||||
```
|
||||
|
||||
Then, run the following command:
|
||||
|
||||
```bash
|
||||
$ pod install
|
||||
```
|
||||
|
||||
### Carthage
|
||||
|
||||
Simply add the following line to your `Cartfile`:
|
||||
|
||||
```
|
||||
github "ortuman/SwiftForms"
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
$ carthage update
|
||||
```
|
||||
|
||||
For more information on [Carthage](https://github.com/Carthage/Carthage) see the [README](https://github.com/Carthage/Carthage/blob/master/README.md)
|
||||
|
||||
Copyright
|
||||
---------
|
||||
|
||||
SwiftForms is originally based on XLForm github project. (https://github.com/xmartlabs/XLForm)
|
||||
|
||||
Check LICENSE file for more details.
|
||||
|
||||
Contact
|
||||
-------
|
||||
|
||||
If you are using SwiftForms in your project and have any suggestion or question:
|
||||
|
||||
Miguel Angel Ortuño, <ortuman@gmail.com>
|
||||
|
||||
[@ortuman](http://twitter.com/ortuman)
|
||||
|
||||
11
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms.podspec
vendored
Normal file
11
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms.podspec
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SwiftForms"
|
||||
s.version = "1.7"
|
||||
s.summary = "A small and lightweight library written in Swift that allows you to easily create forms"
|
||||
s.homepage = "https://github.com/ortuman/SwiftForms"
|
||||
s.license = { :type => "MIT", :file => "LICENSE" }
|
||||
s.authors = "Miguel Ángel Ortuño"
|
||||
s.ios.deployment_target = "8.0"
|
||||
s.source = { :git => "https://github.com/ortuman/SwiftForms.git", :tag => '1.7' }
|
||||
s.source_files = 'SwiftForms/*.swift','SwiftForms/descriptors/*.swift', 'SwiftForms/cells/base/*.swift', 'SwiftForms/cells/*.swift', 'SwiftForms/controllers/*.swift'
|
||||
end
|
||||
12
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/FormErrorType.swift
vendored
Normal file
12
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/FormErrorType.swift
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// FormErrorType.swift
|
||||
// SwiftFormsApplication
|
||||
//
|
||||
// Created by Miguel Angel Ortuno Ortuno on 2/1/16.
|
||||
// Copyright © 2016 Miguel Angel Ortuno Ortuno. All rights reserved.
|
||||
//
|
||||
|
||||
public enum FormErrorType: Error {
|
||||
case sectionOutOfIndex
|
||||
case rowOutOfIndex
|
||||
}
|
||||
26
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/Info.plist
vendored
Normal file
26
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/Info.plist
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.6.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
19
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/SwiftForms.h
vendored
Normal file
19
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/SwiftForms.h
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// SwiftForms.h
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno Ortuno on 14/5/15.
|
||||
// Copyright (c) 2015 Miguel Angel Ortuno Ortuno. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for SwiftForms.
|
||||
FOUNDATION_EXPORT double SwiftFormsVersionNumber;
|
||||
|
||||
//! Project version string for SwiftForms.
|
||||
FOUNDATION_EXPORT const unsigned char SwiftFormsVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <SwiftForms/PublicHeader.h>
|
||||
|
||||
|
||||
24
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormButtonCell.swift
vendored
Normal file
24
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormButtonCell.swift
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// FormButtonCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 21/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormButtonCell: FormTitleCell {
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
titleLabel.textAlignment = .center
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
}
|
||||
}
|
||||
55
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormCheckCell.swift
vendored
Normal file
55
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormCheckCell.swift
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// FormCheckCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 22/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormCheckCell: FormTitleCell {
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
selectionStyle = .default
|
||||
accessoryType = .none
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
|
||||
var rowValue: Bool
|
||||
if let value = rowDescriptor?.value as? Bool {
|
||||
rowValue = value
|
||||
} else {
|
||||
rowValue = false
|
||||
rowDescriptor?.value = rowValue as AnyObject
|
||||
}
|
||||
|
||||
accessoryType = (rowValue) ? .checkmark : .none
|
||||
}
|
||||
|
||||
open override class func formViewController(_ formViewController: FormViewController, didSelectRow selectedRow: FormBaseCell) {
|
||||
guard let row = selectedRow as? FormCheckCell else { return }
|
||||
row.check()
|
||||
}
|
||||
|
||||
// MARK: Private interface
|
||||
|
||||
fileprivate func check() {
|
||||
var newValue: Bool
|
||||
if let value = rowDescriptor?.value as? Bool {
|
||||
newValue = !value
|
||||
}
|
||||
else {
|
||||
newValue = true
|
||||
}
|
||||
rowDescriptor?.value = newValue as AnyObject
|
||||
update()
|
||||
}
|
||||
}
|
||||
97
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormDateCell.swift
vendored
Normal file
97
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormDateCell.swift
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// FormDateCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 22/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormDateCell: FormValueCell {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
fileprivate let datePicker = UIDatePicker()
|
||||
fileprivate let hiddenTextField = UITextField(frame: CGRect.zero)
|
||||
|
||||
fileprivate let defaultDateFormatter = DateFormatter()
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
contentView.addSubview(hiddenTextField)
|
||||
hiddenTextField.inputView = datePicker
|
||||
datePicker.datePickerMode = .date
|
||||
datePicker.addTarget(self, action: #selector(FormDateCell.valueChanged(_:)), for: .valueChanged)
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
if let showsInputToolbar = rowDescriptor?.configuration.cell.showsInputToolbar , showsInputToolbar && hiddenTextField.inputAccessoryView == nil {
|
||||
hiddenTextField.inputAccessoryView = inputAccesoryView()
|
||||
}
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
|
||||
if let rowType = rowDescriptor?.type {
|
||||
switch rowType {
|
||||
case .date:
|
||||
datePicker.datePickerMode = .date
|
||||
defaultDateFormatter.dateStyle = .long
|
||||
defaultDateFormatter.timeStyle = .none
|
||||
case .time:
|
||||
datePicker.datePickerMode = .time
|
||||
defaultDateFormatter.dateStyle = .none
|
||||
defaultDateFormatter.timeStyle = .short
|
||||
default:
|
||||
datePicker.datePickerMode = .dateAndTime
|
||||
defaultDateFormatter.dateStyle = .long
|
||||
defaultDateFormatter.timeStyle = .short
|
||||
}
|
||||
}
|
||||
|
||||
if let date = rowDescriptor?.value as? Date {
|
||||
datePicker.date = date
|
||||
valueLabel.text = getDateFormatter().string(from: date)
|
||||
}
|
||||
}
|
||||
|
||||
open override class func formViewController(_ formViewController: FormViewController, didSelectRow selectedRow: FormBaseCell) {
|
||||
guard let row = selectedRow as? FormDateCell else { return }
|
||||
|
||||
if row.rowDescriptor?.value == nil {
|
||||
let date = Date()
|
||||
row.rowDescriptor?.value = date as AnyObject
|
||||
row.valueLabel.text = row.getDateFormatter().string(from: date)
|
||||
row.update()
|
||||
}
|
||||
|
||||
row.hiddenTextField.becomeFirstResponder()
|
||||
}
|
||||
|
||||
open override func firstResponderElement() -> UIResponder? {
|
||||
return hiddenTextField
|
||||
}
|
||||
|
||||
open override class func formRowCanBecomeFirstResponder() -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
internal func valueChanged(_ sender: UIDatePicker) {
|
||||
rowDescriptor?.value = sender.date as AnyObject
|
||||
valueLabel.text = getDateFormatter().string(from: sender.date)
|
||||
update()
|
||||
}
|
||||
|
||||
// MARK: Private interface
|
||||
|
||||
fileprivate func getDateFormatter() -> DateFormatter {
|
||||
guard let dateFormatter = rowDescriptor?.configuration.date.dateFormatter else { return defaultDateFormatter }
|
||||
return dateFormatter
|
||||
}
|
||||
}
|
||||
48
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormLabelCell.swift
vendored
Normal file
48
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormLabelCell.swift
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// FormTextFieldCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 20/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class FormLabelCell: FormValueCell {
|
||||
|
||||
/// MARK: FormBaseCell
|
||||
|
||||
override func configure() {
|
||||
super.configure()
|
||||
|
||||
accessoryType = .none
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
valueLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
valueLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
|
||||
valueLabel.textColor = UIColor.lightGray
|
||||
valueLabel.textAlignment = .right
|
||||
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(valueLabel)
|
||||
|
||||
titleLabel.setContentHuggingPriority(500, for: .horizontal)
|
||||
titleLabel.setContentCompressionResistancePriority(1000, for: .horizontal)
|
||||
|
||||
// apply constant constraints
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: valueLabel, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: valueLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
}
|
||||
|
||||
override func update() {
|
||||
super.update()
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
valueLabel.text = rowDescriptor?.configuration.cell.placeholder
|
||||
}
|
||||
}
|
||||
104
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormPickerCell.swift
vendored
Normal file
104
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormPickerCell.swift
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
//
|
||||
// FormPickerCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 22/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormPickerCell: FormValueCell, UIPickerViewDelegate, UIPickerViewDataSource {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
fileprivate let picker = UIPickerView()
|
||||
fileprivate let hiddenTextField = UITextField(frame: CGRect.zero)
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
accessoryType = .none
|
||||
|
||||
picker.delegate = self
|
||||
picker.dataSource = self
|
||||
hiddenTextField.inputView = picker
|
||||
|
||||
contentView.addSubview(hiddenTextField)
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
picker.reloadAllComponents()
|
||||
|
||||
if let showsInputToolbar = rowDescriptor?.configuration.cell.showsInputToolbar , showsInputToolbar && hiddenTextField.inputAccessoryView == nil {
|
||||
hiddenTextField.inputAccessoryView = inputAccesoryView()
|
||||
}
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
|
||||
if let selectedValue = rowDescriptor?.value {
|
||||
valueLabel.text = rowDescriptor?.configuration.selection.optionTitleClosure?(selectedValue)
|
||||
if let options = rowDescriptor?.configuration.selection.options , !options.isEmpty {
|
||||
var selectedIndex: Int?
|
||||
for (index, value) in options.enumerated() {
|
||||
if value === selectedValue {
|
||||
selectedIndex = index
|
||||
break
|
||||
}
|
||||
}
|
||||
if let index = selectedIndex {
|
||||
picker.selectRow(index, inComponent: 0, animated: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open override func firstResponderElement() -> UIResponder? {
|
||||
return hiddenTextField
|
||||
}
|
||||
|
||||
open override class func formViewController(_ formViewController: FormViewController, didSelectRow selectedRow: FormBaseCell) {
|
||||
guard let row = selectedRow as? FormPickerCell else { return }
|
||||
|
||||
if selectedRow.rowDescriptor?.value == nil {
|
||||
guard let options = selectedRow.rowDescriptor?.configuration.selection.options , !options.isEmpty else { return }
|
||||
let value = options[0]
|
||||
selectedRow.rowDescriptor?.value = value
|
||||
row.valueLabel.text = selectedRow.rowDescriptor?.configuration.selection.optionTitleClosure?(value)
|
||||
row.hiddenTextField.becomeFirstResponder()
|
||||
} else {
|
||||
guard let value = selectedRow.rowDescriptor?.value else { return }
|
||||
row.valueLabel.text = selectedRow.rowDescriptor?.configuration.selection.optionTitleClosure?(value)
|
||||
row.hiddenTextField.becomeFirstResponder()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UIPickerViewDelegate
|
||||
|
||||
open func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
|
||||
guard let options = rowDescriptor?.configuration.selection.options , !options.isEmpty else { return nil }
|
||||
guard row < options.count else { return nil }
|
||||
return rowDescriptor?.configuration.selection.optionTitleClosure?(options[row])
|
||||
}
|
||||
|
||||
open func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
|
||||
guard let options = rowDescriptor?.configuration.selection.options , !options.isEmpty else { return }
|
||||
guard row < options.count else { return }
|
||||
let newValue = options[row]
|
||||
rowDescriptor?.value = newValue
|
||||
valueLabel.text = rowDescriptor?.configuration.selection.optionTitleClosure?(newValue)
|
||||
}
|
||||
|
||||
// MARK: UIPickerViewDataSource
|
||||
|
||||
open func numberOfComponents(in pickerView: UIPickerView) -> Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
open func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
|
||||
guard let options = rowDescriptor?.configuration.selection.options else { return 0 }
|
||||
return options.count
|
||||
}
|
||||
}
|
||||
99
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSegmentedControlCell.swift
vendored
Normal file
99
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSegmentedControlCell.swift
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// FormSegmentedControlCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 21/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormSegmentedControlCell: FormBaseCell {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let titleLabel = UILabel()
|
||||
open let segmentedControl = UISegmentedControl()
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
fileprivate var customConstraints: [AnyObject] = []
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
selectionStyle = .none
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
segmentedControl.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel.setContentCompressionResistancePriority(500, for: .horizontal)
|
||||
segmentedControl.setContentCompressionResistancePriority(500, for: .horizontal)
|
||||
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(segmentedControl)
|
||||
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: segmentedControl, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
|
||||
segmentedControl.addTarget(self, action: #selector(FormSegmentedControlCell.valueChanged(_:)), for: .valueChanged)
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
updateSegmentedControl()
|
||||
|
||||
guard let value = rowDescriptor?.value else { return }
|
||||
guard let options = rowDescriptor?.configuration.selection.options , !options.isEmpty else { return }
|
||||
|
||||
var idx = 0
|
||||
for optionValue in options {
|
||||
if optionValue === value {
|
||||
segmentedControl.selectedSegmentIndex = idx
|
||||
break
|
||||
}
|
||||
idx += 1
|
||||
}
|
||||
}
|
||||
|
||||
open override func constraintsViews() -> [String : UIView] {
|
||||
return ["titleLabel" : titleLabel, "segmentedControl" : segmentedControl]
|
||||
}
|
||||
|
||||
open override func defaultVisualConstraints() -> [String] {
|
||||
if let text = titleLabel.text , text.characters.count > 0 {
|
||||
return ["H:|-16-[titleLabel]-16-[segmentedControl]-16-|"]
|
||||
} else {
|
||||
return ["H:|-16-[segmentedControl]-16-|"]
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
internal func valueChanged(_ sender: UISegmentedControl) {
|
||||
guard let options = rowDescriptor?.configuration.selection.options , !options.isEmpty else { return }
|
||||
let value = options[sender.selectedSegmentIndex]
|
||||
rowDescriptor?.value = value
|
||||
}
|
||||
|
||||
// MARK: Private
|
||||
|
||||
fileprivate func updateSegmentedControl() {
|
||||
segmentedControl.removeAllSegments()
|
||||
|
||||
guard let options = rowDescriptor?.configuration.selection.options , !options.isEmpty else { return }
|
||||
|
||||
var idx = 0
|
||||
for value in options {
|
||||
let title = rowDescriptor?.configuration.selection.optionTitleClosure?(value)
|
||||
segmentedControl.insertSegment(withTitle: title, at: idx, animated: false)
|
||||
idx += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
63
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSelectorCell.swift
vendored
Normal file
63
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSelectorCell.swift
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// FormSelectorCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 23/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormSelectorCell: FormValueCell {
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
|
||||
var title: String?
|
||||
if let multipleValues = rowDescriptor?.value as? [AnyObject] {
|
||||
var multipleValuesTitle = ""
|
||||
for (index, selectedValue) in multipleValues.enumerated() {
|
||||
guard let selectedValueTitle = rowDescriptor?.configuration.selection.optionTitleClosure?(selectedValue) else { continue }
|
||||
if index != 0 {
|
||||
multipleValuesTitle += ", "
|
||||
}
|
||||
multipleValuesTitle += selectedValueTitle
|
||||
}
|
||||
title = multipleValuesTitle
|
||||
} else if let singleValue = rowDescriptor?.value {
|
||||
title = rowDescriptor?.configuration.selection.optionTitleClosure?(singleValue)
|
||||
}
|
||||
|
||||
if let title = title , title.characters.count > 0 {
|
||||
valueLabel.text = title
|
||||
valueLabel.textColor = UIColor.black
|
||||
} else {
|
||||
valueLabel.text = rowDescriptor?.configuration.cell.placeholder
|
||||
valueLabel.textColor = UIColor.lightGray
|
||||
}
|
||||
}
|
||||
|
||||
open override class func formViewController(_ formViewController: FormViewController, didSelectRow selectedRow: FormBaseCell) {
|
||||
guard let row = selectedRow as? FormSelectorCell else { return }
|
||||
|
||||
formViewController.view.endEditing(true)
|
||||
|
||||
var selectorControllerClass: UIViewController.Type
|
||||
|
||||
if let controllerClass = row.rowDescriptor?.configuration.selection.controllerClass as? UIViewController.Type {
|
||||
selectorControllerClass = controllerClass
|
||||
} else { // fallback to default cell class
|
||||
selectorControllerClass = FormOptionsSelectorController.self
|
||||
}
|
||||
|
||||
let selectorController = selectorControllerClass.init()
|
||||
guard let formRowDescriptorViewController = selectorController as? FormSelector else { return }
|
||||
|
||||
formRowDescriptorViewController.formCell = row
|
||||
formViewController.navigationController?.pushViewController(selectorController, animated: true)
|
||||
}
|
||||
}
|
||||
75
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSliderCell.swift
vendored
Normal file
75
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSliderCell.swift
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// FormSliderCell.swift
|
||||
// SwiftFormsApplication
|
||||
//
|
||||
// Created by Miguel Angel Ortuno Ortuno on 23/5/15.
|
||||
// Copyright (c) 2015 Miguel Angel Ortuno Ortuno. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormSliderCell: FormTitleCell {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let sliderView = UISlider()
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
selectionStyle = .none
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
sliderView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(sliderView)
|
||||
|
||||
titleLabel.setContentHuggingPriority(500, for: .horizontal)
|
||||
|
||||
contentView.addConstraint(NSLayoutConstraint(item: sliderView, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
|
||||
sliderView.addTarget(self, action: #selector(FormSliderCell.valueChanged(_:)), for: .valueChanged)
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
if let maximumValue = rowDescriptor?.configuration.stepper.maximumValue { sliderView.maximumValue = Float(maximumValue) }
|
||||
if let minimumValue = rowDescriptor?.configuration.stepper.minimumValue { sliderView.minimumValue = Float(minimumValue) }
|
||||
if let continuous = rowDescriptor?.configuration.stepper.continuous { sliderView.isContinuous = continuous }
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
|
||||
if let value = rowDescriptor?.value as? Float {
|
||||
sliderView.value = value
|
||||
} else {
|
||||
sliderView.value = sliderView.minimumValue
|
||||
rowDescriptor?.value = sliderView.minimumValue as AnyObject
|
||||
}
|
||||
}
|
||||
|
||||
open override func constraintsViews() -> [String : UIView] {
|
||||
return ["titleLabel" : titleLabel, "sliderView" : sliderView]
|
||||
}
|
||||
|
||||
open override func defaultVisualConstraints() -> [String] {
|
||||
var constraints: [String] = []
|
||||
|
||||
constraints.append("V:|[titleLabel]|")
|
||||
constraints.append("H:|-16-[titleLabel]-16-[sliderView]-16-|")
|
||||
|
||||
return constraints
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
internal func valueChanged(_: UISlider) {
|
||||
rowDescriptor?.value = sliderView.value as AnyObject
|
||||
update()
|
||||
}
|
||||
}
|
||||
82
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormStepperCell.swift
vendored
Normal file
82
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormStepperCell.swift
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// FormStepperCell.swift
|
||||
// SwiftFormsApplication
|
||||
//
|
||||
// Created by Miguel Angel Ortuno Ortuno on 23/5/15.
|
||||
// Copyright (c) 2015 Miguel Angel Ortuno Ortuno. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormStepperCell: FormTitleCell {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let stepperView = UIStepper()
|
||||
open let countLabel = UILabel()
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
selectionStyle = .none
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
stepperView.translatesAutoresizingMaskIntoConstraints = false
|
||||
countLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
countLabel.textAlignment = .right
|
||||
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(countLabel)
|
||||
contentView.addSubview(stepperView)
|
||||
|
||||
titleLabel.setContentHuggingPriority(500, for: .horizontal)
|
||||
|
||||
contentView.addConstraint(NSLayoutConstraint(item: stepperView, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
|
||||
stepperView.addTarget(self, action: #selector(FormStepperCell.valueChanged(_:)), for: .valueChanged)
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
if let maximumValue = rowDescriptor?.configuration.stepper.maximumValue { stepperView.maximumValue = maximumValue }
|
||||
if let minimumValue = rowDescriptor?.configuration.stepper.minimumValue { stepperView.minimumValue = minimumValue }
|
||||
if let steps = rowDescriptor?.configuration.stepper.steps { stepperView.stepValue = steps }
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
|
||||
if let value = rowDescriptor?.value as? Double {
|
||||
stepperView.value = value
|
||||
countLabel.text = String(value)
|
||||
} else {
|
||||
stepperView.value = stepperView.minimumValue
|
||||
rowDescriptor?.value = stepperView.minimumValue as AnyObject
|
||||
countLabel.text = String(stepperView.minimumValue)
|
||||
}
|
||||
}
|
||||
|
||||
open override func constraintsViews() -> [String : UIView] {
|
||||
return ["titleLabel" : titleLabel, "countLabel" : countLabel, "stepperView" : stepperView]
|
||||
}
|
||||
|
||||
open override func defaultVisualConstraints() -> [String] {
|
||||
var constraints: [String] = []
|
||||
|
||||
constraints.append("V:|[titleLabel]|")
|
||||
constraints.append("V:|[countLabel]|")
|
||||
|
||||
constraints.append("H:|-16-[titleLabel][countLabel]-[stepperView]-16-|")
|
||||
return constraints
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
internal func valueChanged(_: UISwitch) {
|
||||
rowDescriptor?.value = stepperView.value as AnyObject
|
||||
update()
|
||||
}
|
||||
}
|
||||
47
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSwitchCell.swift
vendored
Normal file
47
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormSwitchCell.swift
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// FormSwitchCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 21/08/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormSwitchCell: FormTitleCell {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let switchView = UISwitch()
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
selectionStyle = .none
|
||||
|
||||
switchView.addTarget(self, action: #selector(FormSwitchCell.valueChanged(_:)), for: .valueChanged)
|
||||
accessoryView = switchView
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
|
||||
if let value = rowDescriptor?.value as? Bool {
|
||||
switchView.isOn = value
|
||||
} else {
|
||||
switchView.isOn = false
|
||||
rowDescriptor?.value = false as AnyObject
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
internal func valueChanged(_: UISwitch) {
|
||||
rowDescriptor?.value = switchView.isOn as AnyObject
|
||||
update()
|
||||
}
|
||||
}
|
||||
148
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormTextFieldCell.swift
vendored
Normal file
148
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormTextFieldCell.swift
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
//
|
||||
// FormTextFieldCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 20/08/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormTextFieldCell: FormBaseCell {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let titleLabel = UILabel()
|
||||
open let textField = UITextField()
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
fileprivate var customConstraints: [AnyObject] = []
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
selectionStyle = .none
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
textField.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
textField.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(textField)
|
||||
|
||||
titleLabel.setContentHuggingPriority(500, for: .horizontal)
|
||||
titleLabel.setContentCompressionResistancePriority(1000, for: .horizontal)
|
||||
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: textField, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: textField, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
|
||||
textField.addTarget(self, action: #selector(FormTextFieldCell.editingChanged(_:)), for: .editingChanged)
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
super.update()
|
||||
|
||||
if let showsInputToolbar = rowDescriptor?.configuration.cell.showsInputToolbar , showsInputToolbar && textField.inputAccessoryView == nil {
|
||||
textField.inputAccessoryView = inputAccesoryView()
|
||||
}
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
textField.text = rowDescriptor?.value as? String
|
||||
textField.placeholder = rowDescriptor?.configuration.cell.placeholder
|
||||
|
||||
textField.isSecureTextEntry = false
|
||||
textField.clearButtonMode = .whileEditing
|
||||
|
||||
if let type = rowDescriptor?.type {
|
||||
switch type {
|
||||
case .text:
|
||||
textField.autocorrectionType = .default
|
||||
textField.autocapitalizationType = .sentences
|
||||
textField.keyboardType = .default
|
||||
case .number:
|
||||
textField.keyboardType = .numberPad
|
||||
case .numbersAndPunctuation:
|
||||
textField.keyboardType = .numbersAndPunctuation
|
||||
case .decimal:
|
||||
textField.keyboardType = .decimalPad
|
||||
case .name:
|
||||
textField.autocorrectionType = .no
|
||||
textField.autocapitalizationType = .words
|
||||
textField.keyboardType = .default
|
||||
case .phone:
|
||||
textField.keyboardType = .phonePad
|
||||
case .namePhone:
|
||||
textField.autocorrectionType = .no
|
||||
textField.autocapitalizationType = .words
|
||||
textField.keyboardType = .namePhonePad
|
||||
case .url:
|
||||
textField.autocorrectionType = .no
|
||||
textField.autocapitalizationType = .none
|
||||
textField.keyboardType = .URL
|
||||
case .twitter:
|
||||
textField.autocorrectionType = .no
|
||||
textField.autocapitalizationType = .none
|
||||
textField.keyboardType = .twitter
|
||||
case .email:
|
||||
textField.autocorrectionType = .no
|
||||
textField.autocapitalizationType = .none
|
||||
textField.keyboardType = .emailAddress
|
||||
case .asciiCapable:
|
||||
textField.autocorrectionType = .no
|
||||
textField.autocapitalizationType = .none
|
||||
textField.keyboardType = .asciiCapable
|
||||
case .password:
|
||||
textField.isSecureTextEntry = true
|
||||
textField.clearsOnBeginEditing = false
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open override func constraintsViews() -> [String : UIView] {
|
||||
var views = ["titleLabel" : titleLabel, "textField" : textField]
|
||||
if self.imageView!.image != nil {
|
||||
views["imageView"] = imageView
|
||||
}
|
||||
return views
|
||||
}
|
||||
|
||||
open override func defaultVisualConstraints() -> [String] {
|
||||
if self.imageView!.image != nil {
|
||||
if titleLabel.text != nil && (titleLabel.text!).characters.count > 0 {
|
||||
return ["H:[imageView]-[titleLabel]-[textField]-16-|"]
|
||||
} else {
|
||||
return ["H:[imageView]-[textField]-16-|"]
|
||||
}
|
||||
} else {
|
||||
if titleLabel.text != nil && (titleLabel.text!).characters.count > 0 {
|
||||
return ["H:|-16-[titleLabel]-[textField]-16-|"]
|
||||
} else {
|
||||
return ["H:|-16-[textField]-16-|"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open override func firstResponderElement() -> UIResponder? {
|
||||
return textField
|
||||
}
|
||||
|
||||
open override class func formRowCanBecomeFirstResponder() -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
internal func editingChanged(_ sender: UITextField) {
|
||||
guard let text = sender.text, text.characters.count > 0 else { rowDescriptor?.value = nil; update(); return }
|
||||
rowDescriptor?.value = text as AnyObject
|
||||
}
|
||||
}
|
||||
96
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormTextViewCell.swift
vendored
Normal file
96
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/FormTextViewCell.swift
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// FormTextViewCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Joey Padot on 12/6/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormTextViewCell : FormBaseCell, UITextViewDelegate {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let titleLabel = UILabel()
|
||||
open let textField = UITextView()
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
fileprivate var customConstraints: [AnyObject]!
|
||||
|
||||
// MARK: Class Funcs
|
||||
|
||||
open override class func formRowCellHeight() -> CGFloat {
|
||||
return 110.0
|
||||
}
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
selectionStyle = .none
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
textField.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
textField.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(textField)
|
||||
|
||||
titleLabel.setContentHuggingPriority(500, for: .horizontal)
|
||||
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: textField, attribute: .top, relatedBy: .equal, toItem: contentView, attribute: .top, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: textField, attribute: .bottom, relatedBy: .equal, toItem: contentView, attribute: .bottom, multiplier: 1.0, constant: 0.0))
|
||||
|
||||
textField.delegate = self
|
||||
}
|
||||
|
||||
open override func update() {
|
||||
|
||||
titleLabel.text = rowDescriptor?.title
|
||||
textField.text = rowDescriptor?.value as? String
|
||||
|
||||
textField.isSecureTextEntry = false
|
||||
textField.autocorrectionType = .default
|
||||
textField.autocapitalizationType = .sentences
|
||||
textField.keyboardType = .default
|
||||
}
|
||||
|
||||
open override func constraintsViews() -> [String : UIView] {
|
||||
var views = ["titleLabel" : titleLabel, "textField" : textField]
|
||||
if self.imageView!.image != nil {
|
||||
views["imageView"] = imageView
|
||||
}
|
||||
return views
|
||||
}
|
||||
|
||||
open override func defaultVisualConstraints() -> [String] {
|
||||
if self.imageView!.image != nil {
|
||||
if let text = titleLabel.text , text.characters.count > 0 {
|
||||
return ["H:[imageView]-[titleLabel]-[textField]-16-|"]
|
||||
} else {
|
||||
return ["H:[imageView]-[textField]-16-|"]
|
||||
}
|
||||
} else {
|
||||
if let text = titleLabel.text , text.characters.count > 0 {
|
||||
return ["H:|-16-[titleLabel]-[textField]-16-|"]
|
||||
} else {
|
||||
return ["H:|-16-[textField]-16-|"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UITextViewDelegate
|
||||
|
||||
open func textViewDidChange(_ textView: UITextView) {
|
||||
guard let text = textView.text , text.characters.count > 0 else { rowDescriptor?.value = nil; update(); return }
|
||||
rowDescriptor?.value = text as AnyObject
|
||||
update()
|
||||
}
|
||||
}
|
||||
119
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/base/FormBaseCell.swift
vendored
Normal file
119
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/base/FormBaseCell.swift
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
//
|
||||
// FormBaseCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 20/08/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormBaseCell: UITableViewCell {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
open var rowDescriptor: FormRowDescriptor? {
|
||||
didSet {
|
||||
self.update()
|
||||
}
|
||||
}
|
||||
|
||||
open weak var formViewController: FormViewController?
|
||||
|
||||
fileprivate var customConstraints: [NSLayoutConstraint] = []
|
||||
|
||||
// MARK: Init
|
||||
|
||||
public required override init(style: UITableViewCellStyle, reuseIdentifier: String!) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
// MARK: Public interface
|
||||
|
||||
open func configure() {
|
||||
/// override
|
||||
}
|
||||
|
||||
open func update() {
|
||||
/// override
|
||||
}
|
||||
|
||||
open func defaultVisualConstraints() -> [String] {
|
||||
/// override
|
||||
return []
|
||||
}
|
||||
|
||||
open func constraintsViews() -> [String : UIView] {
|
||||
/// override
|
||||
return [:]
|
||||
}
|
||||
|
||||
open func firstResponderElement() -> UIResponder? {
|
||||
/// override
|
||||
return nil
|
||||
}
|
||||
|
||||
open func inputAccesoryView() -> UIToolbar {
|
||||
|
||||
let actionBar = UIToolbar()
|
||||
actionBar.isTranslucent = true
|
||||
actionBar.sizeToFit()
|
||||
actionBar.barStyle = .default
|
||||
|
||||
let doneButton = UIBarButtonItem(title: NSLocalizedString("Done", comment: ""), style: .done, target: self, action: #selector(FormBaseCell.handleDoneAction(_:)))
|
||||
|
||||
let flexible = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
|
||||
actionBar.items = [flexible, doneButton]
|
||||
|
||||
return actionBar
|
||||
}
|
||||
|
||||
internal func handleDoneAction(_: UIBarButtonItem) {
|
||||
firstResponderElement()?.resignFirstResponder()
|
||||
}
|
||||
|
||||
open class func formRowCellHeight() -> CGFloat {
|
||||
return 44.0
|
||||
}
|
||||
|
||||
open class func formRowCanBecomeFirstResponder() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
open class func formViewController(_ formViewController: FormViewController, didSelectRow: FormBaseCell) {
|
||||
}
|
||||
|
||||
// MARK: Constraints
|
||||
|
||||
open override func updateConstraints() {
|
||||
if customConstraints.count > 0 {
|
||||
contentView.removeConstraints(customConstraints)
|
||||
}
|
||||
|
||||
let views = constraintsViews()
|
||||
|
||||
customConstraints.removeAll()
|
||||
|
||||
var visualConstraints = [String]()
|
||||
|
||||
if let visualConstraintsClosure = rowDescriptor?.configuration.cell.visualConstraintsClosure {
|
||||
visualConstraints = visualConstraintsClosure(self)
|
||||
} else {
|
||||
visualConstraints = defaultVisualConstraints()
|
||||
}
|
||||
|
||||
for visualConstraint in visualConstraints {
|
||||
let constraints = NSLayoutConstraint.constraints(withVisualFormat: visualConstraint, options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: views)
|
||||
for constraint in constraints {
|
||||
customConstraints.append(constraint)
|
||||
}
|
||||
}
|
||||
|
||||
contentView.addConstraints(customConstraints)
|
||||
super.updateConstraints()
|
||||
}
|
||||
}
|
||||
38
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/base/FormTitleCell.swift
vendored
Normal file
38
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/base/FormTitleCell.swift
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// FormTitleCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 13/11/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormTitleCell: FormBaseCell {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let titleLabel = UILabel()
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
|
||||
// apply constant constraints
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
}
|
||||
|
||||
open override func constraintsViews() -> [String : UIView] {
|
||||
return ["titleLabel" : titleLabel]
|
||||
}
|
||||
|
||||
open override func defaultVisualConstraints() -> [String] {
|
||||
return ["H:|-16-[titleLabel]-16-|"]
|
||||
}
|
||||
}
|
||||
70
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/base/FormValueCell.swift
vendored
Normal file
70
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/cells/base/FormValueCell.swift
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// FormValueCell.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 13/11/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormValueCell: FormBaseCell {
|
||||
|
||||
// MARK: Cell views
|
||||
|
||||
open let titleLabel = UILabel()
|
||||
open let valueLabel = UILabel()
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
fileprivate var customConstraints: [AnyObject]!
|
||||
|
||||
// MARK: FormBaseCell
|
||||
|
||||
open override func configure() {
|
||||
super.configure()
|
||||
|
||||
accessoryType = .disclosureIndicator
|
||||
|
||||
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
valueLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
valueLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
|
||||
|
||||
valueLabel.textColor = UIColor.lightGray
|
||||
valueLabel.textAlignment = .right
|
||||
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(valueLabel)
|
||||
|
||||
titleLabel.setContentHuggingPriority(500, for: .horizontal)
|
||||
titleLabel.setContentCompressionResistancePriority(1000, for: .horizontal)
|
||||
|
||||
// apply constant constraints
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: valueLabel, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
contentView.addConstraint(NSLayoutConstraint(item: valueLabel, attribute: .centerY, relatedBy: .equal, toItem: contentView, attribute: .centerY, multiplier: 1.0, constant: 0.0))
|
||||
}
|
||||
|
||||
open override func constraintsViews() -> [String : UIView] {
|
||||
return ["titleLabel" : titleLabel, "valueLabel" : valueLabel]
|
||||
}
|
||||
|
||||
open override func defaultVisualConstraints() -> [String] {
|
||||
|
||||
// apply default constraints
|
||||
var rightPadding = 0
|
||||
if accessoryType == .none {
|
||||
rightPadding = 16
|
||||
}
|
||||
|
||||
if titleLabel.text != nil && (titleLabel.text!).characters.count > 0 {
|
||||
return ["H:|-16-[titleLabel]-[valueLabel]-\(rightPadding)-|"]
|
||||
}
|
||||
else {
|
||||
return ["H:|-16-[valueLabel]-\(rightPadding)-|"]
|
||||
}
|
||||
}
|
||||
}
|
||||
125
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/controllers/FormOptionsViewController.swift
vendored
Normal file
125
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/controllers/FormOptionsViewController.swift
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// FormOptionsSelectorController.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 23/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormOptionsSelectorController: UITableViewController, FormSelector {
|
||||
|
||||
// MARK: FormSelector
|
||||
|
||||
open var formCell: FormBaseCell?
|
||||
|
||||
// MARK: Init
|
||||
|
||||
public init() {
|
||||
super.init(style: .grouped)
|
||||
}
|
||||
|
||||
public required init(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)!
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
}
|
||||
|
||||
open override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.navigationItem.title = formCell?.rowDescriptor?.title
|
||||
}
|
||||
|
||||
// MARK: UITableViewDataSource
|
||||
|
||||
open override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
guard let options = formCell?.rowDescriptor?.configuration.selection.options , !options.isEmpty else { return 0 }
|
||||
return options.count
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
||||
return 0.1
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
|
||||
let reuseIdentifier = NSStringFromClass(type(of: self))
|
||||
|
||||
var cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier)
|
||||
if cell == nil {
|
||||
cell = UITableViewCell(style: .default, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
let options = formCell!.rowDescriptor!.configuration.selection.options
|
||||
let optionValue = options[(indexPath as NSIndexPath).row]
|
||||
|
||||
cell?.textLabel?.text = formCell?.rowDescriptor?.configuration.selection.optionTitleClosure?(optionValue)
|
||||
|
||||
if let selectedOptions = formCell?.rowDescriptor?.value as? [AnyObject] {
|
||||
if let _ = selectedOptions.index(where: { $0 === optionValue }) {
|
||||
cell?.accessoryType = .checkmark
|
||||
} else {
|
||||
cell?.accessoryType = .none
|
||||
}
|
||||
|
||||
} else if let selectedOption = formCell?.rowDescriptor?.value {
|
||||
if optionValue === selectedOption {
|
||||
cell?.accessoryType = .checkmark
|
||||
} else {
|
||||
cell?.accessoryType = .none
|
||||
}
|
||||
}
|
||||
|
||||
return cell!
|
||||
}
|
||||
|
||||
// MARK: UITableViewDelegate
|
||||
|
||||
open override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
|
||||
let cell = tableView.cellForRow(at: indexPath)
|
||||
|
||||
var allowsMultipleSelection = false
|
||||
if let allowsMultipleSelectionValue = formCell?.rowDescriptor?.configuration.selection.allowsMultipleSelection {
|
||||
allowsMultipleSelection = allowsMultipleSelectionValue
|
||||
}
|
||||
|
||||
let options = formCell!.rowDescriptor!.configuration.selection.options
|
||||
let selectedOption = options[(indexPath as NSIndexPath).row]
|
||||
|
||||
if allowsMultipleSelection {
|
||||
if var selectedOptions = formCell?.rowDescriptor?.value as? [AnyObject] {
|
||||
if let index = selectedOptions.index(where: { $0 === selectedOption }) {
|
||||
selectedOptions.remove(at: index)
|
||||
cell?.accessoryType = .none
|
||||
} else {
|
||||
selectedOptions.append(selectedOption)
|
||||
cell?.accessoryType = .checkmark
|
||||
}
|
||||
formCell?.rowDescriptor?.value = selectedOptions as AnyObject
|
||||
|
||||
} else {
|
||||
formCell?.rowDescriptor?.value = [AnyObject](arrayLiteral: selectedOption) as AnyObject
|
||||
cell?.accessoryType = .checkmark
|
||||
}
|
||||
|
||||
} else {
|
||||
formCell?.rowDescriptor?.value = selectedOption
|
||||
}
|
||||
|
||||
formCell?.update()
|
||||
|
||||
if allowsMultipleSelection {
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
} else {
|
||||
let _ = self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
13
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/controllers/FormSelector.swift
vendored
Normal file
13
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/controllers/FormSelector.swift
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// FormSelector.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 23/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@objc public protocol FormSelector: NSObjectProtocol {
|
||||
var formCell: FormBaseCell? { get set }
|
||||
}
|
||||
225
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/controllers/FormViewController.swift
vendored
Normal file
225
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/controllers/FormViewController.swift
vendored
Normal file
@@ -0,0 +1,225 @@
|
||||
//
|
||||
// FormViewController.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuño on 20/08/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
open class FormViewController : UITableViewController {
|
||||
|
||||
private static var __once: () = {
|
||||
FormViewController.defaultCellClasses[.text] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.label] = FormLabelCell.self
|
||||
FormViewController.defaultCellClasses[.number] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.numbersAndPunctuation] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.decimal] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.name] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.phone] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.url] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.twitter] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.namePhone] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.email] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.asciiCapable] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.password] = FormTextFieldCell.self
|
||||
FormViewController.defaultCellClasses[.button] = FormButtonCell.self
|
||||
FormViewController.defaultCellClasses[.booleanSwitch] = FormSwitchCell.self
|
||||
FormViewController.defaultCellClasses[.booleanCheck] = FormCheckCell.self
|
||||
FormViewController.defaultCellClasses[.segmentedControl] = FormSegmentedControlCell.self
|
||||
FormViewController.defaultCellClasses[.picker] = FormPickerCell.self
|
||||
FormViewController.defaultCellClasses[.date] = FormDateCell.self
|
||||
FormViewController.defaultCellClasses[.time] = FormDateCell.self
|
||||
FormViewController.defaultCellClasses[.dateAndTime] = FormDateCell.self
|
||||
FormViewController.defaultCellClasses[.stepper] = FormStepperCell.self
|
||||
FormViewController.defaultCellClasses[.slider] = FormSliderCell.self
|
||||
FormViewController.defaultCellClasses[.multipleSelector] = FormSelectorCell.self
|
||||
FormViewController.defaultCellClasses[.multilineText] = FormTextViewCell.self
|
||||
}()
|
||||
|
||||
// MARK: Class variables
|
||||
|
||||
fileprivate static var onceDefaultCellClass: Int = 0
|
||||
fileprivate static var defaultCellClasses: [FormRowDescriptor.RowType : FormBaseCell.Type] = [:]
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
open var form = FormDescriptor()
|
||||
|
||||
// MARK: Init
|
||||
|
||||
public convenience init() {
|
||||
self.init(style: .grouped)
|
||||
}
|
||||
|
||||
public convenience init(form: FormDescriptor) {
|
||||
self.init(style: .grouped)
|
||||
self.form = form
|
||||
}
|
||||
|
||||
public override init(style: UITableViewStyle) {
|
||||
super.init(style: style)
|
||||
}
|
||||
|
||||
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
}
|
||||
|
||||
public required init(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)!
|
||||
}
|
||||
|
||||
// MARK: View life cycle
|
||||
|
||||
open override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
navigationItem.title = form.title
|
||||
}
|
||||
|
||||
// MARK: Public interface
|
||||
|
||||
open func valueForTag(_ tag: String) -> AnyObject? {
|
||||
for section in form.sections {
|
||||
for row in section.rows {
|
||||
if row.tag == tag {
|
||||
return row.value
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
open func setValue(_ value: AnyObject, forTag tag: String) {
|
||||
for (sectionIndex, section) in form.sections.enumerated() {
|
||||
for (rowIndex, row) in section.rows.enumerated() {
|
||||
if row.tag == tag {
|
||||
form.sections[sectionIndex].rows[rowIndex].value = value
|
||||
if let cell = self.tableView.cellForRow(at: IndexPath(row: rowIndex, section: sectionIndex)) as? FormBaseCell {
|
||||
cell.update()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UITableViewDataSource
|
||||
|
||||
open override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
return form.sections.count
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return form.sections[section].rows.count
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
|
||||
let rowDescriptor = formRowDescriptorAtIndexPath(indexPath)
|
||||
|
||||
let formBaseCellClass = formBaseCellClassFromRowDescriptor(rowDescriptor)
|
||||
|
||||
let reuseIdentifier = NSStringFromClass(formBaseCellClass!)
|
||||
|
||||
var cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier) as? FormBaseCell
|
||||
if cell == nil {
|
||||
cell = formBaseCellClass?.init(style: .default, reuseIdentifier: reuseIdentifier)
|
||||
cell?.formViewController = self
|
||||
cell?.configure()
|
||||
}
|
||||
|
||||
cell?.rowDescriptor = rowDescriptor
|
||||
|
||||
// apply cell custom design
|
||||
for (keyPath, value) in rowDescriptor.configuration.cell.appearance {
|
||||
cell?.setValue(value, forKeyPath: keyPath)
|
||||
}
|
||||
return cell!
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
||||
return form.sections[section].headerTitle
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
|
||||
return form.sections[section].footerTitle
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
|
||||
guard let headerView = form.sections[section].headerView else { return nil }
|
||||
return headerView
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
||||
guard let footerView = form.sections[section].footerView else { return nil }
|
||||
return footerView
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
||||
guard let headerView = form.sections[section].headerView , headerView.translatesAutoresizingMaskIntoConstraints else {
|
||||
return form.sections[section].headerViewHeight
|
||||
}
|
||||
return headerView.frame.size.height
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
|
||||
guard let footerView = form.sections[section].footerView , footerView.translatesAutoresizingMaskIntoConstraints else {
|
||||
return form.sections[section].footerViewHeight
|
||||
}
|
||||
return footerView.frame.size.height
|
||||
}
|
||||
|
||||
// MARK: UITableViewDelegate
|
||||
|
||||
open override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
|
||||
let rowDescriptor = formRowDescriptorAtIndexPath(indexPath)
|
||||
|
||||
if let formBaseCellClass = formBaseCellClassFromRowDescriptor(rowDescriptor) {
|
||||
return formBaseCellClass.formRowCellHeight()
|
||||
}
|
||||
return super.tableView(tableView, heightForRowAt: indexPath)
|
||||
}
|
||||
|
||||
open override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
|
||||
let rowDescriptor = formRowDescriptorAtIndexPath(indexPath)
|
||||
|
||||
if let selectedRow = tableView.cellForRow(at: indexPath) as? FormBaseCell {
|
||||
if let formBaseCellClass = formBaseCellClassFromRowDescriptor(rowDescriptor) {
|
||||
formBaseCellClass.formViewController(self, didSelectRow: selectedRow)
|
||||
}
|
||||
}
|
||||
|
||||
if let didSelectClosure = rowDescriptor.configuration.button.didSelectClosure {
|
||||
didSelectClosure(rowDescriptor)
|
||||
}
|
||||
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
}
|
||||
|
||||
fileprivate class func defaultCellClassForRowType(_ rowType: FormRowDescriptor.RowType) -> FormBaseCell.Type {
|
||||
_ = FormViewController.__once
|
||||
return FormViewController.defaultCellClasses[rowType]!
|
||||
}
|
||||
|
||||
fileprivate func formRowDescriptorAtIndexPath(_ indexPath: IndexPath) -> FormRowDescriptor {
|
||||
|
||||
let section = form.sections[(indexPath as NSIndexPath).section]
|
||||
let rowDescriptor = section.rows[(indexPath as NSIndexPath).row]
|
||||
return rowDescriptor
|
||||
}
|
||||
|
||||
fileprivate func formBaseCellClassFromRowDescriptor(_ rowDescriptor: FormRowDescriptor) -> FormBaseCell.Type! {
|
||||
|
||||
var formBaseCellClass: FormBaseCell.Type
|
||||
|
||||
if let cellClass = rowDescriptor.configuration.cell.cellClass as? FormBaseCell.Type {
|
||||
formBaseCellClass = cellClass
|
||||
} else {
|
||||
formBaseCellClass = FormViewController.defaultCellClassForRowType(rowDescriptor.type)
|
||||
}
|
||||
return formBaseCellClass
|
||||
}
|
||||
}
|
||||
58
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/descriptors/FormDescriptor.swift
vendored
Normal file
58
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/descriptors/FormDescriptor.swift
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// FormDescriptor.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 20/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public final class FormDescriptor {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
public var title: String
|
||||
public var sections: [FormSectionDescriptor] = []
|
||||
|
||||
// MARK: Init
|
||||
|
||||
public init() {
|
||||
self.title = ""
|
||||
}
|
||||
|
||||
public init(title: String) {
|
||||
self.title = title
|
||||
}
|
||||
|
||||
// MARK: Public
|
||||
|
||||
public func formValues() -> [String : AnyObject] {
|
||||
|
||||
var formValues: [String : AnyObject] = [:]
|
||||
|
||||
for section in sections {
|
||||
for row in section.rows {
|
||||
if row.type != .button {
|
||||
if let value = row.value {
|
||||
formValues[row.tag] = value
|
||||
} else {
|
||||
formValues[row.tag] = NSNull()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return formValues
|
||||
}
|
||||
|
||||
public func validateForm() -> FormRowDescriptor? {
|
||||
for section in sections {
|
||||
for row in section.rows {
|
||||
if row.configuration.cell.required && row.value == nil {
|
||||
return row
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
159
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/descriptors/FormRowDescriptor.swift
vendored
Normal file
159
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/descriptors/FormRowDescriptor.swift
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
//
|
||||
// FormRowDescriptor.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Ángel Ortuño Ortuño on 23/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public final class FormRowDescriptor {
|
||||
|
||||
// MARK: Types
|
||||
|
||||
public enum RowType {
|
||||
case unknown
|
||||
case label
|
||||
case text
|
||||
case url
|
||||
case number
|
||||
case numbersAndPunctuation
|
||||
case decimal
|
||||
case name
|
||||
case phone
|
||||
case namePhone
|
||||
case email
|
||||
case twitter
|
||||
case asciiCapable
|
||||
case password
|
||||
case button
|
||||
case booleanSwitch
|
||||
case booleanCheck
|
||||
case segmentedControl
|
||||
case picker
|
||||
case date
|
||||
case time
|
||||
case dateAndTime
|
||||
case stepper
|
||||
case slider
|
||||
case multipleSelector
|
||||
case multilineText
|
||||
}
|
||||
|
||||
public struct CellConfiguration {
|
||||
public var cellClass: AnyClass?
|
||||
public var appearance: [String : AnyObject]
|
||||
public var placeholder: String?
|
||||
public var showsInputToolbar: Bool
|
||||
public var required: Bool
|
||||
public var willUpdateClosure: ((FormRowDescriptor) -> Void)?
|
||||
public var didUpdateClosure: ((FormRowDescriptor) -> Void)?
|
||||
public var visualConstraintsClosure: ((FormBaseCell) -> [String])?
|
||||
|
||||
public init() {
|
||||
cellClass = nil
|
||||
appearance = [:]
|
||||
placeholder = nil
|
||||
showsInputToolbar = false
|
||||
required = true
|
||||
willUpdateClosure = nil
|
||||
didUpdateClosure = nil
|
||||
visualConstraintsClosure = nil
|
||||
}
|
||||
}
|
||||
|
||||
public struct SelectionConfiguration {
|
||||
public var controllerClass: AnyClass?
|
||||
public var options: [AnyObject]
|
||||
public var optionTitleClosure: ((AnyObject) -> String)?
|
||||
public var allowsMultipleSelection: Bool
|
||||
|
||||
public init() {
|
||||
controllerClass = nil
|
||||
options = []
|
||||
optionTitleClosure = nil
|
||||
allowsMultipleSelection = false
|
||||
}
|
||||
}
|
||||
|
||||
public struct ButtonConfiguration {
|
||||
public var didSelectClosure: ((FormRowDescriptor) -> Void)?
|
||||
|
||||
public init() {
|
||||
didSelectClosure = nil
|
||||
}
|
||||
}
|
||||
|
||||
public struct StepperConfiguration {
|
||||
public var maximumValue: Double
|
||||
public var minimumValue: Double
|
||||
public var steps: Double
|
||||
public var continuous: Bool
|
||||
|
||||
public init() {
|
||||
maximumValue = 0.0
|
||||
minimumValue = 0.0
|
||||
steps = 0.0
|
||||
continuous = false
|
||||
}
|
||||
}
|
||||
|
||||
public struct DateConfiguration {
|
||||
public var dateFormatter: DateFormatter?
|
||||
}
|
||||
|
||||
public struct RowConfiguration {
|
||||
public var cell: CellConfiguration
|
||||
public var selection: SelectionConfiguration
|
||||
public var button: ButtonConfiguration
|
||||
public var stepper: StepperConfiguration
|
||||
public var date: DateConfiguration
|
||||
public var userInfo: [String : AnyObject]
|
||||
|
||||
init() {
|
||||
cell = CellConfiguration()
|
||||
selection = SelectionConfiguration()
|
||||
button = ButtonConfiguration()
|
||||
stepper = StepperConfiguration()
|
||||
date = DateConfiguration()
|
||||
userInfo = [:]
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
public let tag: String
|
||||
public let type: RowType
|
||||
|
||||
public var title: String?
|
||||
|
||||
public var value: AnyObject? {
|
||||
willSet {
|
||||
guard let willUpdateBlock = configuration.cell.willUpdateClosure else { return }
|
||||
willUpdateBlock(self)
|
||||
}
|
||||
didSet {
|
||||
guard let didUpdateBlock = configuration.cell.didUpdateClosure else { return }
|
||||
didUpdateBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
public var configuration: RowConfiguration
|
||||
|
||||
// MARK: Init
|
||||
|
||||
public init(tag: String, type: RowType, title: String, configuration: RowConfiguration) {
|
||||
self.tag = tag
|
||||
self.type = type
|
||||
self.title = title
|
||||
self.configuration = configuration
|
||||
}
|
||||
|
||||
public init(tag: String, type: RowType, title: String) {
|
||||
self.tag = tag
|
||||
self.type = type
|
||||
self.title = title
|
||||
self.configuration = RowConfiguration()
|
||||
}
|
||||
}
|
||||
32
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/descriptors/FormSectionDescriptor.swift
vendored
Normal file
32
My Mind/Carthage/Checkouts/SwiftForms/SwiftForms/descriptors/FormSectionDescriptor.swift
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// FormSectionDescriptor.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 20/08/14.
|
||||
// Copyright (c) 2016 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public final class FormSectionDescriptor {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
public var rows: [FormRowDescriptor] = []
|
||||
|
||||
public var headerTitle: String?
|
||||
public var footerTitle: String?
|
||||
|
||||
public var headerView: UIView?
|
||||
public var footerView: UIView?
|
||||
|
||||
public var headerViewHeight: CGFloat = UITableViewAutomaticDimension
|
||||
public var footerViewHeight: CGFloat = UITableViewAutomaticDimension
|
||||
|
||||
// MARK: Init
|
||||
|
||||
public init(headerTitle: String?, footerTitle: String?) {
|
||||
self.headerTitle = headerTitle
|
||||
self.footerTitle = footerTitle
|
||||
}
|
||||
}
|
||||
622
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication.xcodeproj/project.pbxproj
vendored
Normal file
622
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication.xcodeproj/project.pbxproj
vendored
Normal file
@@ -0,0 +1,622 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0C9D1DF31D2267EE00909941 /* FormOptionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9D1DF21D2267EE00909941 /* FormOptionsViewController.swift */; };
|
||||
0CB1F6C31C37F9B900CD2A7B /* FormErrorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB1F6C21C37F9B900CD2A7B /* FormErrorType.swift */; };
|
||||
0CCA33DD1B04FA5A006D9666 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA33DC1B04FA5A006D9666 /* AppDelegate.swift */; };
|
||||
0CCA33DF1B04FA5A006D9666 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA33DE1B04FA5A006D9666 /* ViewController.swift */; };
|
||||
0CCA33E21B04FA5A006D9666 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0CCA33E01B04FA5A006D9666 /* Main.storyboard */; };
|
||||
0CCA33E41B04FA5A006D9666 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0CCA33E31B04FA5A006D9666 /* Images.xcassets */; };
|
||||
0CCA34141B04FAD3006D9666 /* ExampleFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA33FC1B04FAD3006D9666 /* ExampleFormViewController.swift */; };
|
||||
0CCA34311B04FBE0006D9666 /* SwiftForms.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CCA34301B04FBE0006D9666 /* SwiftForms.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0CCA34431B04FBE0006D9666 /* SwiftForms.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CCA342C1B04FBDF006D9666 /* SwiftForms.framework */; };
|
||||
0CCA34441B04FBE0006D9666 /* SwiftForms.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0CCA342C1B04FBDF006D9666 /* SwiftForms.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
0CCA34611B0502B5006D9666 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0CCA34601B0502B5006D9666 /* Launch.storyboard */; };
|
||||
0CCA34781B050525006D9666 /* FormBaseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34641B050525006D9666 /* FormBaseCell.swift */; };
|
||||
0CCA34791B050525006D9666 /* FormTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34651B050525006D9666 /* FormTitleCell.swift */; };
|
||||
0CCA347A1B050525006D9666 /* FormValueCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34661B050525006D9666 /* FormValueCell.swift */; };
|
||||
0CCA347B1B050525006D9666 /* FormButtonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34671B050525006D9666 /* FormButtonCell.swift */; };
|
||||
0CCA347C1B050525006D9666 /* FormCheckCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34681B050525006D9666 /* FormCheckCell.swift */; };
|
||||
0CCA347D1B050525006D9666 /* FormDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34691B050525006D9666 /* FormDateCell.swift */; };
|
||||
0CCA347E1B050525006D9666 /* FormPickerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA346A1B050525006D9666 /* FormPickerCell.swift */; };
|
||||
0CCA347F1B050525006D9666 /* FormSegmentedControlCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA346B1B050525006D9666 /* FormSegmentedControlCell.swift */; };
|
||||
0CCA34801B050525006D9666 /* FormSelectorCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA346C1B050525006D9666 /* FormSelectorCell.swift */; };
|
||||
0CCA34811B050525006D9666 /* FormSwitchCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA346D1B050525006D9666 /* FormSwitchCell.swift */; };
|
||||
0CCA34821B050525006D9666 /* FormTextFieldCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA346E1B050525006D9666 /* FormTextFieldCell.swift */; };
|
||||
0CCA34831B050525006D9666 /* FormTextViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA346F1B050525006D9666 /* FormTextViewCell.swift */; };
|
||||
0CCA34851B050525006D9666 /* FormSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34721B050525006D9666 /* FormSelector.swift */; };
|
||||
0CCA34861B050525006D9666 /* FormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34731B050525006D9666 /* FormViewController.swift */; };
|
||||
0CCA34871B050525006D9666 /* FormDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34751B050525006D9666 /* FormDescriptor.swift */; };
|
||||
0CCA34881B050525006D9666 /* FormRowDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34761B050525006D9666 /* FormRowDescriptor.swift */; };
|
||||
0CCA34891B050525006D9666 /* FormSectionDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCA34771B050525006D9666 /* FormSectionDescriptor.swift */; };
|
||||
0CDBB4F11B10699A00BE6ACF /* FormStepperCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CDBB4F01B10699A00BE6ACF /* FormStepperCell.swift */; };
|
||||
0CDBB4F31B10724600BE6ACF /* FormSliderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CDBB4F21B10724600BE6ACF /* FormSliderCell.swift */; };
|
||||
BDD1087A1C925D14000EDEE5 /* FormLabelCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD108791C925D14000EDEE5 /* FormLabelCell.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
0CCA34411B04FBE0006D9666 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0CCA33CF1B04FA5A006D9666 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 0CCA342B1B04FBDF006D9666;
|
||||
remoteInfo = SwiftForms;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
0CCA34481B04FBE0006D9666 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
0CCA34441B04FBE0006D9666 /* SwiftForms.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0C9D1DF21D2267EE00909941 /* FormOptionsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormOptionsViewController.swift; sourceTree = "<group>"; };
|
||||
0CB1F6C21C37F9B900CD2A7B /* FormErrorType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormErrorType.swift; sourceTree = "<group>"; };
|
||||
0CCA33D71B04FA5A006D9666 /* SwiftFormsApplication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftFormsApplication.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
0CCA33DB1B04FA5A006D9666 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
0CCA33DC1B04FA5A006D9666 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
0CCA33DE1B04FA5A006D9666 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
0CCA33E11B04FA5A006D9666 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
0CCA33E31B04FA5A006D9666 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
0CCA33FC1B04FAD3006D9666 /* ExampleFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleFormViewController.swift; sourceTree = "<group>"; };
|
||||
0CCA342C1B04FBDF006D9666 /* SwiftForms.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftForms.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
0CCA342F1B04FBE0006D9666 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
0CCA34301B04FBE0006D9666 /* SwiftForms.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftForms.h; sourceTree = "<group>"; };
|
||||
0CCA343E1B04FBE0006D9666 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
0CCA343F1B04FBE0006D9666 /* SwiftFormsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftFormsTests.swift; sourceTree = "<group>"; };
|
||||
0CCA34601B0502B5006D9666 /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; };
|
||||
0CCA34641B050525006D9666 /* FormBaseCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormBaseCell.swift; sourceTree = "<group>"; };
|
||||
0CCA34651B050525006D9666 /* FormTitleCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormTitleCell.swift; sourceTree = "<group>"; };
|
||||
0CCA34661B050525006D9666 /* FormValueCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValueCell.swift; sourceTree = "<group>"; };
|
||||
0CCA34671B050525006D9666 /* FormButtonCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormButtonCell.swift; sourceTree = "<group>"; };
|
||||
0CCA34681B050525006D9666 /* FormCheckCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormCheckCell.swift; sourceTree = "<group>"; };
|
||||
0CCA34691B050525006D9666 /* FormDateCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormDateCell.swift; sourceTree = "<group>"; };
|
||||
0CCA346A1B050525006D9666 /* FormPickerCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormPickerCell.swift; sourceTree = "<group>"; };
|
||||
0CCA346B1B050525006D9666 /* FormSegmentedControlCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormSegmentedControlCell.swift; sourceTree = "<group>"; };
|
||||
0CCA346C1B050525006D9666 /* FormSelectorCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormSelectorCell.swift; sourceTree = "<group>"; };
|
||||
0CCA346D1B050525006D9666 /* FormSwitchCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormSwitchCell.swift; sourceTree = "<group>"; };
|
||||
0CCA346E1B050525006D9666 /* FormTextFieldCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormTextFieldCell.swift; sourceTree = "<group>"; };
|
||||
0CCA346F1B050525006D9666 /* FormTextViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormTextViewCell.swift; sourceTree = "<group>"; };
|
||||
0CCA34721B050525006D9666 /* FormSelector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormSelector.swift; sourceTree = "<group>"; };
|
||||
0CCA34731B050525006D9666 /* FormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormViewController.swift; sourceTree = "<group>"; };
|
||||
0CCA34751B050525006D9666 /* FormDescriptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormDescriptor.swift; sourceTree = "<group>"; };
|
||||
0CCA34761B050525006D9666 /* FormRowDescriptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormRowDescriptor.swift; sourceTree = "<group>"; };
|
||||
0CCA34771B050525006D9666 /* FormSectionDescriptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormSectionDescriptor.swift; sourceTree = "<group>"; };
|
||||
0CDBB4F01B10699A00BE6ACF /* FormStepperCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormStepperCell.swift; sourceTree = "<group>"; };
|
||||
0CDBB4F21B10724600BE6ACF /* FormSliderCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormSliderCell.swift; sourceTree = "<group>"; };
|
||||
BDD108791C925D14000EDEE5 /* FormLabelCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormLabelCell.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
0CCA33D41B04FA5A006D9666 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0CCA34431B04FBE0006D9666 /* SwiftForms.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
0CCA34281B04FBDF006D9666 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0CCA33CE1B04FA5A006D9666 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA33D91B04FA5A006D9666 /* SwiftFormsApplication */,
|
||||
0CCA342D1B04FBE0006D9666 /* SwiftForms */,
|
||||
0CCA343C1B04FBE0006D9666 /* SwiftFormsTests */,
|
||||
0CCA33D81B04FA5A006D9666 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA33D81B04FA5A006D9666 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA33D71B04FA5A006D9666 /* SwiftFormsApplication.app */,
|
||||
0CCA342C1B04FBDF006D9666 /* SwiftForms.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA33D91B04FA5A006D9666 /* SwiftFormsApplication */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA33FC1B04FAD3006D9666 /* ExampleFormViewController.swift */,
|
||||
0CCA33DC1B04FA5A006D9666 /* AppDelegate.swift */,
|
||||
0CCA33DE1B04FA5A006D9666 /* ViewController.swift */,
|
||||
0CCA33E01B04FA5A006D9666 /* Main.storyboard */,
|
||||
0CCA33E31B04FA5A006D9666 /* Images.xcassets */,
|
||||
0CCA33DA1B04FA5A006D9666 /* Supporting Files */,
|
||||
0CCA34601B0502B5006D9666 /* Launch.storyboard */,
|
||||
);
|
||||
path = SwiftFormsApplication;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA33DA1B04FA5A006D9666 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA33DB1B04FA5A006D9666 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA342D1B04FBE0006D9666 /* SwiftForms */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA34621B050525006D9666 /* cells */,
|
||||
0CCA34701B050525006D9666 /* controllers */,
|
||||
0CCA34741B050525006D9666 /* descriptors */,
|
||||
0CB1F6C21C37F9B900CD2A7B /* FormErrorType.swift */,
|
||||
0CCA34301B04FBE0006D9666 /* SwiftForms.h */,
|
||||
0CCA342E1B04FBE0006D9666 /* Supporting Files */,
|
||||
);
|
||||
path = SwiftForms;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA342E1B04FBE0006D9666 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA342F1B04FBE0006D9666 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA343C1B04FBE0006D9666 /* SwiftFormsTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA343F1B04FBE0006D9666 /* SwiftFormsTests.swift */,
|
||||
0CCA343D1B04FBE0006D9666 /* Supporting Files */,
|
||||
);
|
||||
path = SwiftFormsTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA343D1B04FBE0006D9666 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA343E1B04FBE0006D9666 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA34621B050525006D9666 /* cells */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA34631B050525006D9666 /* base */,
|
||||
0CCA34671B050525006D9666 /* FormButtonCell.swift */,
|
||||
BDD108791C925D14000EDEE5 /* FormLabelCell.swift */,
|
||||
0CCA34681B050525006D9666 /* FormCheckCell.swift */,
|
||||
0CCA34691B050525006D9666 /* FormDateCell.swift */,
|
||||
0CCA346A1B050525006D9666 /* FormPickerCell.swift */,
|
||||
0CCA346B1B050525006D9666 /* FormSegmentedControlCell.swift */,
|
||||
0CCA346C1B050525006D9666 /* FormSelectorCell.swift */,
|
||||
0CCA346D1B050525006D9666 /* FormSwitchCell.swift */,
|
||||
0CCA346E1B050525006D9666 /* FormTextFieldCell.swift */,
|
||||
0CCA346F1B050525006D9666 /* FormTextViewCell.swift */,
|
||||
0CDBB4F01B10699A00BE6ACF /* FormStepperCell.swift */,
|
||||
0CDBB4F21B10724600BE6ACF /* FormSliderCell.swift */,
|
||||
);
|
||||
path = cells;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA34631B050525006D9666 /* base */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA34641B050525006D9666 /* FormBaseCell.swift */,
|
||||
0CCA34651B050525006D9666 /* FormTitleCell.swift */,
|
||||
0CCA34661B050525006D9666 /* FormValueCell.swift */,
|
||||
);
|
||||
path = base;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA34701B050525006D9666 /* controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA34721B050525006D9666 /* FormSelector.swift */,
|
||||
0CCA34731B050525006D9666 /* FormViewController.swift */,
|
||||
0C9D1DF21D2267EE00909941 /* FormOptionsViewController.swift */,
|
||||
);
|
||||
path = controllers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0CCA34741B050525006D9666 /* descriptors */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0CCA34751B050525006D9666 /* FormDescriptor.swift */,
|
||||
0CCA34761B050525006D9666 /* FormRowDescriptor.swift */,
|
||||
0CCA34771B050525006D9666 /* FormSectionDescriptor.swift */,
|
||||
);
|
||||
path = descriptors;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
0CCA34291B04FBDF006D9666 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0CCA34311B04FBE0006D9666 /* SwiftForms.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
0CCA33D61B04FA5A006D9666 /* SwiftFormsApplication */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 0CCA33F61B04FA5A006D9666 /* Build configuration list for PBXNativeTarget "SwiftFormsApplication" */;
|
||||
buildPhases = (
|
||||
0CCA33D31B04FA5A006D9666 /* Sources */,
|
||||
0CCA33D41B04FA5A006D9666 /* Frameworks */,
|
||||
0CCA33D51B04FA5A006D9666 /* Resources */,
|
||||
0CCA34481B04FBE0006D9666 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
0CCA34421B04FBE0006D9666 /* PBXTargetDependency */,
|
||||
);
|
||||
name = SwiftFormsApplication;
|
||||
productName = SwiftFormsApplication;
|
||||
productReference = 0CCA33D71B04FA5A006D9666 /* SwiftFormsApplication.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
0CCA342B1B04FBDF006D9666 /* SwiftForms */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 0CCA34451B04FBE0006D9666 /* Build configuration list for PBXNativeTarget "SwiftForms" */;
|
||||
buildPhases = (
|
||||
0CCA34271B04FBDF006D9666 /* Sources */,
|
||||
0CCA34281B04FBDF006D9666 /* Frameworks */,
|
||||
0CCA34291B04FBDF006D9666 /* Headers */,
|
||||
0CCA342A1B04FBDF006D9666 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = SwiftForms;
|
||||
productName = SwiftForms;
|
||||
productReference = 0CCA342C1B04FBDF006D9666 /* SwiftForms.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
0CCA33CF1B04FA5A006D9666 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = "Miguel Angel Ortuno Ortuno";
|
||||
TargetAttributes = {
|
||||
0CCA33D61B04FA5A006D9666 = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
0CCA342B1B04FBDF006D9666 = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 0CCA33D21B04FA5A006D9666 /* Build configuration list for PBXProject "SwiftFormsApplication" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 0CCA33CE1B04FA5A006D9666;
|
||||
productRefGroup = 0CCA33D81B04FA5A006D9666 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
0CCA33D61B04FA5A006D9666 /* SwiftFormsApplication */,
|
||||
0CCA342B1B04FBDF006D9666 /* SwiftForms */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
0CCA33D51B04FA5A006D9666 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0CCA33E21B04FA5A006D9666 /* Main.storyboard in Resources */,
|
||||
0CCA34611B0502B5006D9666 /* Launch.storyboard in Resources */,
|
||||
0CCA33E41B04FA5A006D9666 /* Images.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
0CCA342A1B04FBDF006D9666 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
0CCA33D31B04FA5A006D9666 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0CCA33DF1B04FA5A006D9666 /* ViewController.swift in Sources */,
|
||||
0CCA34141B04FAD3006D9666 /* ExampleFormViewController.swift in Sources */,
|
||||
0CCA33DD1B04FA5A006D9666 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
0CCA34271B04FBDF006D9666 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0CCA34851B050525006D9666 /* FormSelector.swift in Sources */,
|
||||
0CCA34791B050525006D9666 /* FormTitleCell.swift in Sources */,
|
||||
0CDBB4F31B10724600BE6ACF /* FormSliderCell.swift in Sources */,
|
||||
0CCA34891B050525006D9666 /* FormSectionDescriptor.swift in Sources */,
|
||||
0CCA34871B050525006D9666 /* FormDescriptor.swift in Sources */,
|
||||
0CCA34781B050525006D9666 /* FormBaseCell.swift in Sources */,
|
||||
BDD1087A1C925D14000EDEE5 /* FormLabelCell.swift in Sources */,
|
||||
0CCA34831B050525006D9666 /* FormTextViewCell.swift in Sources */,
|
||||
0CB1F6C31C37F9B900CD2A7B /* FormErrorType.swift in Sources */,
|
||||
0CCA34861B050525006D9666 /* FormViewController.swift in Sources */,
|
||||
0CCA347B1B050525006D9666 /* FormButtonCell.swift in Sources */,
|
||||
0CDBB4F11B10699A00BE6ACF /* FormStepperCell.swift in Sources */,
|
||||
0CCA34801B050525006D9666 /* FormSelectorCell.swift in Sources */,
|
||||
0CCA34811B050525006D9666 /* FormSwitchCell.swift in Sources */,
|
||||
0CCA347C1B050525006D9666 /* FormCheckCell.swift in Sources */,
|
||||
0CCA347A1B050525006D9666 /* FormValueCell.swift in Sources */,
|
||||
0CCA347F1B050525006D9666 /* FormSegmentedControlCell.swift in Sources */,
|
||||
0CCA34821B050525006D9666 /* FormTextFieldCell.swift in Sources */,
|
||||
0CCA347E1B050525006D9666 /* FormPickerCell.swift in Sources */,
|
||||
0C9D1DF31D2267EE00909941 /* FormOptionsViewController.swift in Sources */,
|
||||
0CCA347D1B050525006D9666 /* FormDateCell.swift in Sources */,
|
||||
0CCA34881B050525006D9666 /* FormRowDescriptor.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
0CCA34421B04FBE0006D9666 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 0CCA342B1B04FBDF006D9666 /* SwiftForms */;
|
||||
targetProxy = 0CCA34411B04FBE0006D9666 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
0CCA33E01B04FA5A006D9666 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
0CCA33E11B04FA5A006D9666 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
0CCA33F41B04FA5A006D9666 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
0CCA33F51B04FA5A006D9666 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
0CCA33F71B04FA5A006D9666 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = SwiftFormsApplication/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ortulabs.SwiftFormsApplication;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
0CCA33F81B04FA5A006D9666 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = SwiftFormsApplication/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ortulabs.SwiftFormsApplication;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
0CCA34461B04FBE0006D9666 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = SwiftForms/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.ortulabs.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
0CCA34471B04FBE0006D9666 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = SwiftForms/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.ortulabs.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
0CCA33D21B04FA5A006D9666 /* Build configuration list for PBXProject "SwiftFormsApplication" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
0CCA33F41B04FA5A006D9666 /* Debug */,
|
||||
0CCA33F51B04FA5A006D9666 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
0CCA33F61B04FA5A006D9666 /* Build configuration list for PBXNativeTarget "SwiftFormsApplication" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
0CCA33F71B04FA5A006D9666 /* Debug */,
|
||||
0CCA33F81B04FA5A006D9666 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
0CCA34451B04FBE0006D9666 /* Build configuration list for PBXNativeTarget "SwiftForms" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
0CCA34461B04FBE0006D9666 /* Debug */,
|
||||
0CCA34471B04FBE0006D9666 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 0CCA33CF1B04FA5A006D9666 /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "0CCA342B1B04FBDF006D9666"
|
||||
BuildableName = "SwiftForms.framework"
|
||||
BlueprintName = "SwiftForms"
|
||||
ReferencedContainer = "container:SwiftFormsApplication.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "0CCA342B1B04FBDF006D9666"
|
||||
BuildableName = "SwiftForms.framework"
|
||||
BlueprintName = "SwiftForms"
|
||||
ReferencedContainer = "container:SwiftFormsApplication.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "0CCA342B1B04FBDF006D9666"
|
||||
BuildableName = "SwiftForms.framework"
|
||||
BlueprintName = "SwiftForms"
|
||||
ReferencedContainer = "container:SwiftFormsApplication.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
35
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/AppDelegate.swift
vendored
Normal file
35
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/AppDelegate.swift
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// SwiftForms
|
||||
//
|
||||
// Created by Miguel Angel Ortuno on 20/08/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : Any]?) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
}
|
||||
}
|
||||
|
||||
47
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Base.lproj/Main.storyboard
vendored
Normal file
47
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Base.lproj/Main.storyboard
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="2fJ-Vj-Fx4">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Root View Controller-->
|
||||
<scene sceneID="prn-mK-S9o">
|
||||
<objects>
|
||||
<tableViewController id="cOw-JX-PpI" customClass="ExampleFormViewController" customModule="SwiftFormsApplication" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="Dpr-KM-eKs">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="518"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="cOw-JX-PpI" id="zuU-br-WUC"/>
|
||||
<outlet property="delegate" destination="cOw-JX-PpI" id="2Oh-6L-e8h"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" title="Root View Controller" id="W98-Fb-phH"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<size key="freeformSize" width="320" height="518"/>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="ndw-47-Ukh" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-166" y="423.75"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="4el-7P-abp">
|
||||
<objects>
|
||||
<navigationController id="2fJ-Vj-Fx4" sceneMemberID="viewController">
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<size key="freeformSize" width="320" height="518"/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="l3z-Dv-0Yo">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
<segue destination="cOw-JX-PpI" kind="relationship" relationship="rootViewController" id="nL3-AH-WsZ"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="k9y-Jx-GyC" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-816" y="424"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
BIN
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Example.gif
vendored
Normal file
BIN
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Example.gif
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 MiB |
211
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/ExampleFormViewController.swift
vendored
Normal file
211
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/ExampleFormViewController.swift
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
//
|
||||
// ExampleFormViewController.swift
|
||||
// SwiftForms
|
||||
//®
|
||||
// Created by Miguel Angel Ortuno on 20/08/14.
|
||||
// Copyright (c) 2014 Miguel Angel Ortuño. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftForms
|
||||
|
||||
class ExampleFormViewController: FormViewController {
|
||||
|
||||
struct Static {
|
||||
static let nameTag = "name"
|
||||
static let passwordTag = "password"
|
||||
static let lastNameTag = "lastName"
|
||||
static let jobTag = "job"
|
||||
static let emailTag = "email"
|
||||
static let URLTag = "url"
|
||||
static let phoneTag = "phone"
|
||||
static let enabled = "enabled"
|
||||
static let check = "check"
|
||||
static let segmented = "segmented"
|
||||
static let picker = "picker"
|
||||
static let birthday = "birthday"
|
||||
static let categories = "categories"
|
||||
static let button = "button"
|
||||
static let stepper = "stepper"
|
||||
static let slider = "slider"
|
||||
static let textView = "textview"
|
||||
}
|
||||
|
||||
required init(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
self.loadForm()
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Submit", style: .plain, target: self, action: #selector(ExampleFormViewController.submit(_:)))
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
func submit(_: UIBarButtonItem!) {
|
||||
|
||||
let message = self.form.formValues().description
|
||||
|
||||
let alertController = UIAlertController(title: "Form output", message: message, preferredStyle: .alert)
|
||||
|
||||
let cancel = UIAlertAction(title: "OK", style: .cancel) { (action) in
|
||||
}
|
||||
|
||||
alertController.addAction(cancel)
|
||||
|
||||
self.present(alertController, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
// MARK: Private interface
|
||||
|
||||
fileprivate func loadForm() {
|
||||
|
||||
let form = FormDescriptor(title: "Example Form")
|
||||
|
||||
let section1 = FormSectionDescriptor(headerTitle: nil, footerTitle: nil)
|
||||
|
||||
var row = FormRowDescriptor(tag: Static.emailTag, type: .email, title: "Email")
|
||||
row.configuration.cell.appearance = ["textField.placeholder" : "john@gmail.com" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
|
||||
section1.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.passwordTag, type: .password, title: "Password")
|
||||
row.configuration.cell.appearance = ["textField.placeholder" : "Enter password" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
|
||||
section1.rows.append(row)
|
||||
|
||||
let section2 = FormSectionDescriptor(headerTitle: nil, footerTitle: nil)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.nameTag, type: .name, title: "First Name")
|
||||
row.configuration.cell.appearance = ["textField.placeholder" : "e.g. Miguel Ángel" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
|
||||
section2.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.lastNameTag, type: .name, title: "Last Name")
|
||||
row.configuration.cell.appearance = ["textField.placeholder" : "e.g. Ortuño" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
|
||||
section2.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.jobTag, type: .text, title: "Job")
|
||||
row.configuration.cell.appearance = ["textField.placeholder" : "e.g. Entrepreneur" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
|
||||
section2.rows.append(row)
|
||||
|
||||
let section3 = FormSectionDescriptor(headerTitle: nil, footerTitle: nil)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.URLTag, type: .url, title: "URL")
|
||||
row.configuration.cell.appearance = ["textField.placeholder" : "e.g. gethooksapp.com" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
|
||||
section3.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.phoneTag, type: .phone, title: "Phone")
|
||||
row.configuration.cell.appearance = ["textField.placeholder" : "e.g. 0034666777999" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
|
||||
section3.rows.append(row)
|
||||
|
||||
let section4 = FormSectionDescriptor(headerTitle: "An example header title", footerTitle: "An example footer title")
|
||||
|
||||
row = FormRowDescriptor(tag: Static.enabled, type: .booleanSwitch, title: "Enable")
|
||||
section4.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.check, type: .booleanCheck, title: "Doable")
|
||||
section4.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.segmented, type: .segmentedControl, title: "Priority")
|
||||
row.configuration.selection.options = ([0, 1, 2, 3] as [Int]) as [AnyObject]
|
||||
row.configuration.selection.optionTitleClosure = { value in
|
||||
guard let option = value as? Int else { return "" }
|
||||
switch option {
|
||||
case 0:
|
||||
return "None"
|
||||
case 1:
|
||||
return "!"
|
||||
case 2:
|
||||
return "!!"
|
||||
case 3:
|
||||
return "!!!"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
row.configuration.cell.appearance = ["titleLabel.font" : UIFont.boldSystemFont(ofSize: 30.0), "segmentedControl.tintColor" : UIColor.red]
|
||||
|
||||
section4.rows.append(row)
|
||||
|
||||
let section5 = FormSectionDescriptor(headerTitle: nil, footerTitle: nil)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.picker, type: .picker, title: "Gender")
|
||||
row.configuration.cell.showsInputToolbar = true
|
||||
row.configuration.selection.options = (["F", "M", "U"] as [String]) as [AnyObject]
|
||||
row.configuration.selection.optionTitleClosure = { value in
|
||||
guard let option = value as? String else { return "" }
|
||||
switch option {
|
||||
case "F":
|
||||
return "Female"
|
||||
case "M":
|
||||
return "Male"
|
||||
case "U":
|
||||
return "I'd rather not to say"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
row.value = "M" as AnyObject
|
||||
|
||||
section5.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.birthday, type: .date, title: "Birthday")
|
||||
row.configuration.cell.showsInputToolbar = true
|
||||
section5.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.categories, type: .multipleSelector, title: "Categories")
|
||||
row.configuration.selection.options = ([0, 1, 2, 3, 4] as [Int]) as [AnyObject]
|
||||
row.configuration.selection.allowsMultipleSelection = true
|
||||
row.configuration.selection.optionTitleClosure = { value in
|
||||
guard let option = value as? Int else { return "" }
|
||||
switch option {
|
||||
case 0:
|
||||
return "Restaurant"
|
||||
case 1:
|
||||
return "Pub"
|
||||
case 2:
|
||||
return "Shop"
|
||||
case 3:
|
||||
return "Hotel"
|
||||
case 4:
|
||||
return "Camping"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
section5.rows.append(row)
|
||||
|
||||
let section6 = FormSectionDescriptor(headerTitle: "Stepper & Slider", footerTitle: nil)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.stepper, type: .stepper, title: "Step count")
|
||||
row.configuration.stepper.maximumValue = 200.0
|
||||
row.configuration.stepper.minimumValue = 20.0
|
||||
row.configuration.stepper.steps = 2.0
|
||||
section6.rows.append(row)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.slider, type: .slider, title: "Slider")
|
||||
row.configuration.stepper.maximumValue = 200.0
|
||||
row.configuration.stepper.minimumValue = 20.0
|
||||
row.configuration.stepper.steps = 2.0
|
||||
row.value = 0.5 as AnyObject
|
||||
section6.rows.append(row)
|
||||
|
||||
let section7 = FormSectionDescriptor(headerTitle: "Multiline TextView", footerTitle: nil)
|
||||
row = FormRowDescriptor(tag: Static.textView, type: .multilineText, title: "Notes")
|
||||
section7.rows.append(row)
|
||||
|
||||
let section8 = FormSectionDescriptor(headerTitle: nil, footerTitle: nil)
|
||||
|
||||
row = FormRowDescriptor(tag: Static.button, type: .button, title: "Dismiss")
|
||||
row.configuration.button.didSelectClosure = { _ in
|
||||
self.view.endEditing(true)
|
||||
}
|
||||
section8.rows.append(row)
|
||||
|
||||
form.sections = [section1, section2, section3, section4, section5, section6, section7, section8]
|
||||
|
||||
self.form = form
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "8.0",
|
||||
"subtype" : "736h",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "8.0",
|
||||
"subtype" : "736h",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "8.0",
|
||||
"subtype" : "667h",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "retina4",
|
||||
"filename" : "iphone5_splash.png",
|
||||
"minimum-system-version" : "7.0",
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"subtype" : "retina4",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "to-status-bar",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "to-status-bar",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "to-status-bar",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "to-status-bar",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
38
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Info.plist
vendored
Normal file
38
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Info.plist
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>Launch</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
43
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Launch.storyboard
vendored
Normal file
43
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Launch.storyboard
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="9SR-7b-Iwg">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="zNr-CX-2hl">
|
||||
<objects>
|
||||
<navigationController id="9SR-7b-Iwg" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="boM-fp-avT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
<segue destination="zU2-zy-5lE" kind="relationship" relationship="rootViewController" id="RaG-Zs-crm"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="rIS-OV-1jL" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-664" y="297"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="9pp-lP-Cyp">
|
||||
<objects>
|
||||
<viewController id="zU2-zy-5lE" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="kba-MB-gng"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="cvL-oJ-V4X"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="2CP-3f-vjZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="49I-cM-xVU"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Ywx-qZ-bIj" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="358" y="297"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
BIN
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Screenshot.png
vendored
Normal file
BIN
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/Screenshot.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
23
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/ViewController.swift
vendored
Normal file
23
My Mind/Carthage/Checkouts/SwiftForms/SwiftFormsApplication/ViewController.swift
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// SwiftFormsApplication
|
||||
//
|
||||
// Created by Miguel Angel Ortuno Ortuno on 14/5/15.
|
||||
// Copyright (c) 2015 Miguel Angel Ortuno Ortuno. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
}
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user