Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 00e512a37b | |||
| f4129a367b |
@@ -21,5 +21,4 @@ DerivedData
|
||||
Pods
|
||||
Tests/Pods
|
||||
Tests/Podfile.lock
|
||||
Examples/Objective-C/Podfile.lock
|
||||
Examples/Swift/Podfile.lock
|
||||
Examples/Objective-C/Podfile.lock
|
||||
@@ -1,5 +1,4 @@
|
||||
language: objective-c
|
||||
osx_image: xcode8.2
|
||||
before_install:
|
||||
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
|
||||
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
### Version 3.3.0:
|
||||
* Added `cellConfigForSelector` to style XLFormOptionsViewController
|
||||
* Added properties to **limit number of characters** in `XLFormTextFieldCell` and `XLFormTextViewCell`
|
||||
* Minor fixes
|
||||
|
||||
### Version 3.2.0:
|
||||
* Added XL_APP_EXTENSIONS macro to allow app extensions (@MuscleRumble #357)
|
||||
* Added shouldChangeTextInRange delegate call for UITextView. (@kiancheong #782)
|
||||
* Added support for NSFormatter (@ziogaschr, @fwhenin, @bhirt-bpl #306)
|
||||
* Added `height` property to XLFormRowDescriptor to allow setting height of individual cells.
|
||||
|
||||
### Version 3.1.2:
|
||||
* Update row in `cellForRowAtIndexPath` instead of `willDisplayCell`
|
||||
* Added cancel action to image selector (by koenpunt)
|
||||
* Other minor fixes
|
||||
|
||||
### Version 3.1.1
|
||||
* Allow setting width percentage on UITextView
|
||||
* Added custom inline row example
|
||||
* Fixed bug where XLFormImageCell was not added to project
|
||||
* Add ability to `end editing` on scroll
|
||||
* Other bugs and refactor
|
||||
|
||||
### Version 3.1.0
|
||||
* Added Carthage support
|
||||
* Added NSCoding protocol
|
||||
* Allowed HTTP connections
|
||||
* Several bugfixes and improvements.
|
||||
|
||||
### Version 3.0.2
|
||||
* Fix issue when inline pickers expand beyond table.
|
||||
|
||||
### Version 3.0.1
|
||||
|
||||
* Improvements and bug fixes.
|
||||
* Ability to left, right align textfields. Ability to set up a minimum textField width.
|
||||
* If form is being shown, assigning a new form automatically reload the tableview.
|
||||
* Update objective-c and swift example projects.
|
||||
* Swift compatibility fixes.
|
||||
* Long email validation added.
|
||||
* Fixed row copy issue, now valueTransformer value is copied.
|
||||
* Fixed step counter row layout issues.
|
||||
* Fixed issue "Last form field hides beneath enabled navigation controller's toolbar".
|
||||
* Fixed issue "Navigating between cells using bottom navigation buttons causes table cell dividers to disappear".
|
||||
* Use UIAlertController instead UIActionSheet/UIAlertView if possible.
|
||||
* Hidden and disabled rows resign first responder before changing state.
|
||||
* onChangeBlock added to rowDescriptor.
|
||||
* use tintColor as default button row color.
|
||||
* By default accessoryView is no longer shown for inline rows.
|
||||
* Fix NSBundle issues to use XLForm as dynamic framework.
|
||||
|
||||
### Version 3.0.0
|
||||
|
||||
* `hidden`, `disable` properties added to `XLFormRowDescriptor`. `@YES` `@NO` or a `NSPredicate` can be used to hide, disable de row.
|
||||
* `hidden` property added to `XLFormSectionDescriptor`. `@YES` `@NO` or a `NSPredicate` can be used to hide the section.
|
||||
* Added `XLFormRowDescriptorTypeCountDownTimerInline` and `XLFormRowDescriptorTypeCountDownTimer` row type with an example.
|
||||
* Deleted `dateFormatter` property and added support to use the `NSValueTransformer` to convert the selected object to a NSString in the XLFormDateCell class.
|
||||
|
||||
* Added `XLFormRowDescriptorTypeCountDownTimerInline` and `XLFormRowDescriptorTypeCountDownTimer` row type with an example.
|
||||
* Deleted `dateFormatter` property and added support to use the `NSValueTransformer` to convert the selected object to a NSString in the XLFormDateCell class.
|
||||
|
||||
|
||||
### Version 2.2.0
|
||||
|
||||
* Fixed "(null)" caption when `XLFormRowDescriptorTypeSelectorLeftRight` row required error message is shown.
|
||||
* Refresh the cell content instead of recreating one, when the form get back from a selection.
|
||||
* Added XLFormRowDescriptor to validations error to easily show an error mask.
|
||||
* Use row tag in validation error message if row does not have a title. It is also possible to set up a custom message if needed
|
||||
* Added a convenience method to add a XLFormRowDescriptor instance before another one.
|
||||
* Allow nil values in cellConfig and cellConfigAtConfigure.
|
||||
* Fix constraints for textFieldCell when it is configured to be right aligned.
|
||||
* Add asterisk to required segmentedCells if needed.
|
||||
* Fail validation for empty strings and NSNull on required rows.
|
||||
* Segue support added to buttons and selectors.
|
||||
* Ability to configure a storyboardId or a viewController nibName to by used by button and selector rows as presented view controller.
|
||||
* Fix scrolling to top when status bar is tapped.
|
||||
* Fix wrong type of XLFormRowDescriptorTypeDecimal row. Now it's converted to NSNumber.
|
||||
* Fix issue: XLFormRegexValidator only checks regex validation for NSStrings, not working for number.
|
||||
* Callconfigure method from awakeFromNib on XLFormBaseCell.
|
||||
* Assign form.delegate from inside setForm: method.
|
||||
* Added custom cell, validation, reordering, can insert, can delete examples.
|
||||
* Added support for inputAccessoryView. Default input accessory view allows to navigate among rows. Fully optionally and customizable.
|
||||
* Added suport for row navigation. Fully optionally and customizable.
|
||||
* beginEditing: endEditing: methods added. These method are called each time a row gains / loses firstResponder. They bring the ability to do UI changes.
|
||||
* Read Only mode added. `disable` property added to XLFormDescriptor class.
|
||||
* Rename `label` XLFormTextViewCell property as `textLabel`.
|
||||
* fix position of multivalued section accessory view.
|
||||
* Can delete, can delete, can reorder section mode added. it's possible to enable some of them, don't need to enable all modes.
|
||||
|
||||
### Version 2.1.0
|
||||
|
||||
* Change `XLFormRowDescriptorTypeText`, `XLFormRowDescriptorTypeName` and `XLFormRowDescriptorTypeTextView` keyboard type to `UIKeyboardTypeDefault`.
|
||||
* Added `XLFormRowDescriptorTypeInfo` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPopover` row type and example.
|
||||
* CI added. Created Test project into Tests folder and set up Travis.
|
||||
* Documented how to customize UI. Added an example.
|
||||
* Now XLFormViewController extends from UIViewController instead of UITableViewController.
|
||||
* Added tableView property as a XLFormViewController IBOutlet.
|
||||
* Added support for storyboard reuse identifier and nib file.
|
||||
* Button selection can be handled using a selector or block.
|
||||
* Added addAsteriskToRequiredRowsTitle property to XLFormDescriptor. NO is used as value by default.
|
||||
* Image cell has been removed because it depends on AFNetworking and now needs to be implemented as a custom cell. You can find the image custom cell in Examples/Others/CustomCells.
|
||||
|
||||
### Version 2.0.0
|
||||
|
||||
* Added `XLFormRowDescriptorTypeMultipleSelector` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPickerView` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPickerViewInline` row type and example.
|
||||
* Added generic way to create inline selector rows.
|
||||
* Ability to customize row animations.
|
||||
* `(NSDictionary *)formValues;` XLFormViewController method added in order to get raw form data.
|
||||
* Added `XLFormRowDescriptorTypeSelectorSegmentedControl` row type and example.
|
||||
* AFNetworking dependency removed.
|
||||
* Added `XLFormRowDescriptorTypeStepCounter` row type and related example.
|
||||
|
||||
|
||||
### Version 1.0.1
|
||||
|
||||
* Added storyboard example.
|
||||
* Added button `XLFormRowDescriptorTypeButton` example.
|
||||
* Documented how to add a custom row.
|
||||
* Fixed issues: [#2](https://github.com/xmartlabs/XLForm/issues/2 "#2"), [#3](https://github.com/xmartlabs/XLForm/issues/3 "#3"), [#27](https://github.com/xmartlabs/XLForm/issues/27 "#27"), [#38](https://github.com/xmartlabs/XLForm/issues/38 "#38").
|
||||
* Fixed crash caused by inline date rows. [#6](https://github.com/xmartlabs/XLForm/issues/6 "#6")
|
||||
* Fixed ipad issue *invalid cell layout*. [#10](https://github.com/xmartlabs/XLForm/issues/10 "#10")
|
||||
* New convenience methods to insert sections dinamically. [#13](https://github.com/xmartlabs/XLForm/pull/13 "#13")
|
||||
* Change default label style to `UIFontTextStyleBody`. [#18](https://github.com/xmartlabs/XLForm/issues/18 "#18")
|
||||
* Added step counter row, `XLFormRowDescriptorTypeStepCounter`.
|
||||
* Added `initWithCoder` initializer to `XLFormViewController`. [#32](https://github.com/xmartlabs/XLForm/issues/32 "#32").
|
||||
* Added a convenience method to deselect a `XLFormRowDescriptor`. `-(void)deselectFormRow:(XLFormRowDescriptor *)row;`. [#33](https://github.com/xmartlabs/XLForm/issues/33 "#33").
|
||||
|
||||
|
||||
### Version 1.0.0
|
||||
|
||||
* Initial release
|
||||
@@ -132,7 +132,8 @@ NSString * kAccessoryViewNotes = @"notes";
|
||||
|
||||
|
||||
// Basic Information - Section
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"TextField Types"];
|
||||
section.footerTitle = @"This is a long text that will appear on section footer";
|
||||
[formDescriptor addFormSection:section];
|
||||
|
||||
// Name
|
||||
@@ -169,10 +170,10 @@ NSString * kAccessoryViewNotes = @"notes";
|
||||
[row.cellConfigAtConfigure setObject:@"TEXT VIEW EXAMPLE" forKey:@"textView.placeholder"];
|
||||
[section addFormRow:row];
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewCheck rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Check"];
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewCheck rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Ckeck"];
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"TextView With Label Example"];
|
||||
[formDescriptor addFormSection:section];
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewNotes rowType:XLFormRowDescriptorTypeTextView title:@"Notes"];
|
||||
[section addFormRow:row];
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "CoreDataStore.h"
|
||||
#import "ExamplesFormViewController.h"
|
||||
#import "AppDelegate.h"
|
||||
|
||||
|
||||
@@ -28,13 +28,11 @@
|
||||
#import "XLFormRatingCell.h"
|
||||
#import "FloatLabeledTextFieldCell.h"
|
||||
#import "XLFormCustomCell.h"
|
||||
#import "XLFormInlineSegmentedCell.h"
|
||||
|
||||
static NSString * const kCustomRowFirstRatingTag = @"CustomRowFirstRatingTag";
|
||||
static NSString * const kCustomRowSecondRatingTag = @"CustomRowSecondRatingTag";
|
||||
static NSString * const kCustomRowFloatLabeledTextFieldTag = @"CustomRowFloatLabeledTextFieldTag";
|
||||
static NSString * const kCustomRowWeekdays = @"CustomRowWeekdays";
|
||||
static NSString * const kCustomInline = @"kCustomInline";
|
||||
static NSString * const kCustomRowText = @"kCustomText";
|
||||
|
||||
@implementation CustomRowsViewController
|
||||
@@ -96,16 +94,6 @@ static NSString * const kCustomRowText = @"kCustomText";
|
||||
};
|
||||
[section addFormRow:row];
|
||||
|
||||
// Custom Inline Segmented row
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"Custom Inline"];
|
||||
[form addFormSection:section];
|
||||
|
||||
// Inline segmented
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCustomInline rowType:XLFormRowDescriptorTypeSegmentedInline];
|
||||
row.title = @"You support...";
|
||||
row.selectorOptions = @[@"Uruguay", @"Brazil", @"Argentina", @"Chile"];
|
||||
row.value = @"Uruguay";
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[form addFormSection:section];
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
NSString * const XLFormRowDescriptorTypeFloatLabeledTextField = @"XLFormRowDescriptorTypeFloatLabeledTextField";
|
||||
|
||||
const static CGFloat kHMargin = 15.0f;
|
||||
const static CGFloat kVMargin = 8.0f;
|
||||
const static CGFloat kFloatingLabelFontSize = 11.0f;
|
||||
|
||||
@@ -79,7 +80,7 @@ const static CGFloat kFloatingLabelFontSize = 11.0f;
|
||||
attributes:@{NSForegroundColorAttributeName: [UIColor lightGrayColor]}];
|
||||
|
||||
self.floatLabeledTextField.text = self.rowDescriptor.value ? [self.rowDescriptor.value displayText] : self.rowDescriptor.noValueDisplayText;
|
||||
[self.floatLabeledTextField setEnabled:!self.rowDescriptor.isDisabled];
|
||||
[self.floatLabeledTextField setEnabled:!self.rowDescriptor.disabled];
|
||||
|
||||
self.floatLabeledTextField.floatingLabelTextColor = [UIColor lightGrayColor];
|
||||
|
||||
@@ -88,7 +89,7 @@ const static CGFloat kFloatingLabelFontSize = 11.0f;
|
||||
|
||||
-(BOOL)formDescriptorCellCanBecomeFirstResponder
|
||||
{
|
||||
return !self.rowDescriptor.isDisabled;
|
||||
return (!self.rowDescriptor.disabled);
|
||||
}
|
||||
|
||||
-(BOOL)formDescriptorCellBecomeFirstResponder
|
||||
@@ -154,9 +155,10 @@ const static CGFloat kFloatingLabelFontSize = 11.0f;
|
||||
NSMutableArray * result = [[NSMutableArray alloc] init];
|
||||
|
||||
NSDictionary * views = @{@"floatLabeledTextField": self.floatLabeledTextField};
|
||||
NSDictionary *metrics = @{@"vMargin":@(kVMargin)};
|
||||
NSDictionary *metrics = @{@"hMargin":@(kHMargin),
|
||||
@"vMargin":@(kVMargin)};
|
||||
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[floatLabeledTextField]-|"
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(hMargin)-[floatLabeledTextField]-(hMargin)-|"
|
||||
options:0
|
||||
metrics:metrics
|
||||
views:views]];
|
||||
|
||||
@@ -55,8 +55,11 @@
|
||||
|
||||
- (void)customize
|
||||
{
|
||||
self.baseColor = [UIColor colorWithRed:(205/255.0) green:(201/255.0) blue:(201/255.0) alpha:1];
|
||||
self.highlightColor = [UIColor colorWithRed:(255/255.0) green:(215/255.0) blue:0 alpha:1];
|
||||
UIColor * grayColor = [UIColor colorWithRed:(205/255.0) green:(201/255.0) blue:(201/255.0) alpha:1];
|
||||
self.baseColor = grayColor;
|
||||
|
||||
UIColor * goldColor = [UIColor colorWithRed:(255/255.0) green:(215/255.0) blue:0 alpha:1];
|
||||
self.highlightColor = goldColor;
|
||||
self.markFont = [UIFont systemFontOfSize:23.0f];
|
||||
self.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
self.stepInterval = 1.0f;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
extern NSString * const XLFormRowDescriptorTypeRate;
|
||||
|
||||
@interface XLFormRatingCell : XLFormBaseCell
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *rateTitle;
|
||||
@property (weak, nonatomic) IBOutlet XLRatingView *ratingView;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
@@ -11,12 +10,11 @@
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="OGo-4x-YLf" customClass="XLFormRatingCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" tableViewCell="OGo-4x-YLf" id="hV6-xt-6pq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="43"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="OGo-4x-YLf" id="hV6-xt-6pq">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yhI-dj-sRk" customClass="XLRatingView">
|
||||
<rect key="frame" x="355" y="11" width="115" height="22"/>
|
||||
<rect key="frame" x="353" y="11" width="115" height="22"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="22" id="85e-Ov-qM7"/>
|
||||
@@ -24,21 +22,28 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rate" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vxp-gw-YTt">
|
||||
<rect key="frame" x="8" y="11" width="347" height="21"/>
|
||||
<rect key="frame" x="15" y="11" width="338" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="IK4-8e-SFs"/>
|
||||
<constraint firstAttribute="width" constant="150" id="hNG-F9-1wj"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="hNG-F9-1wj"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="Vxp-gw-YTt" secondAttribute="bottom" constant="11" id="0Qz-iR-Tzb"/>
|
||||
<constraint firstAttribute="centerY" secondItem="Vxp-gw-YTt" secondAttribute="centerY" id="4Vh-2e-m2p"/>
|
||||
<constraint firstAttribute="trailing" secondItem="yhI-dj-sRk" secondAttribute="trailing" constant="10" id="NPC-r7-JFl"/>
|
||||
<constraint firstAttribute="centerY" secondItem="yhI-dj-sRk" secondAttribute="centerY" id="Vw4-h8-wId"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="yhI-dj-sRk" secondAttribute="trailing" id="W8E-PI-peE"/>
|
||||
<constraint firstItem="Vxp-gw-YTt" firstAttribute="leading" secondItem="hV6-xt-6pq" secondAttribute="leading" constant="15" id="Xgq-Cy-zLQ"/>
|
||||
<constraint firstItem="Vxp-gw-YTt" firstAttribute="top" secondItem="hV6-xt-6pq" secondAttribute="top" constant="11" id="bgO-t8-Rjz"/>
|
||||
<constraint firstItem="Vxp-gw-YTt" firstAttribute="leading" secondItem="hV6-xt-6pq" secondAttribute="leadingMargin" id="mVS-0p-p0O"/>
|
||||
<constraint firstItem="yhI-dj-sRk" firstAttribute="leading" secondItem="Vxp-gw-YTt" secondAttribute="trailing" id="n0B-tg-Pik"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
|
||||
@@ -102,12 +102,12 @@ NSString *const kSaturday = @"saturday";
|
||||
self.saturdayButton.selected = [[value objectForKey:kSaturday] boolValue];
|
||||
|
||||
[self.sundayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
|
||||
[self.mondayButton setAlpha:self.sundayButton.alpha];
|
||||
[self.tuesdayButton setAlpha:self.sundayButton.alpha];
|
||||
[self.wednesdayButton setAlpha:self.sundayButton.alpha];
|
||||
[self.thursdayButton setAlpha:self.sundayButton.alpha];
|
||||
[self.fridayButton setAlpha:self.sundayButton.alpha];
|
||||
[self.saturdayButton setAlpha:self.sundayButton.alpha];
|
||||
[self.mondayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
|
||||
[self.tuesdayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
|
||||
[self.wednesdayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
|
||||
[self.thursdayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
|
||||
[self.fridayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
|
||||
[self.saturdayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
|
||||
}
|
||||
|
||||
-(NSString *)getDayFormButton:(id)sender
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
@@ -11,12 +10,11 @@
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="60" id="piA-L5-eiN" customClass="XLFormWeekDaysCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="382" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" tableViewCell="piA-L5-eiN" id="Yr6-3E-keb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="382" height="49"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="piA-L5-eiN" id="Yr6-3E-keb">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZAg-Me-yKR">
|
||||
<rect key="frame" x="8" y="0.0" width="52" height="49"/>
|
||||
<rect key="frame" x="5" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="S">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
@@ -30,14 +28,14 @@
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UjQ-Cw-7wH" userLabel="separator 1">
|
||||
<rect key="frame" x="60" y="10" width="1" height="29"/>
|
||||
<rect key="frame" x="58" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="K3N-3h-MZr"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="N3w-qP-kRZ">
|
||||
<rect key="frame" x="60" y="0.0" width="53" height="49"/>
|
||||
<rect key="frame" x="58" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="M">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
@@ -48,14 +46,14 @@
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kwc-0w-V51" userLabel="separator 2">
|
||||
<rect key="frame" x="113" y="10" width="1" height="29"/>
|
||||
<rect key="frame" x="111" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="3mE-sT-ql1"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cPl-47-rS8">
|
||||
<rect key="frame" x="113" y="0.0" width="52" height="49"/>
|
||||
<rect key="frame" x="111" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="T">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
@@ -66,14 +64,14 @@
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EiN-2p-Oig" userLabel="separator 3">
|
||||
<rect key="frame" x="165" y="10" width="1" height="29"/>
|
||||
<rect key="frame" x="164" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="JyW-GC-0A7"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6iC-Cl-RyI">
|
||||
<rect key="frame" x="165" y="0.0" width="52" height="49"/>
|
||||
<rect key="frame" x="164" y="0.0" width="54" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="W">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
@@ -84,14 +82,14 @@
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bRc-5e-QAH" userLabel="separator 4">
|
||||
<rect key="frame" x="217" y="10" width="1" height="29"/>
|
||||
<rect key="frame" x="218" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="W9F-iR-Leh"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eTo-Ip-reh">
|
||||
<rect key="frame" x="217" y="0.0" width="52" height="49"/>
|
||||
<rect key="frame" x="218" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="T">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
@@ -102,14 +100,14 @@
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dHj-rj-mjh" userLabel="separator 5">
|
||||
<rect key="frame" x="269" y="10" width="1" height="29"/>
|
||||
<rect key="frame" x="271" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="h5U-x0-9nJ"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Wjb-tu-QEo">
|
||||
<rect key="frame" x="269" y="0.0" width="53" height="49"/>
|
||||
<rect key="frame" x="271" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="F">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
@@ -120,14 +118,14 @@
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L7g-lu-boa" userLabel="separator 6">
|
||||
<rect key="frame" x="322" y="10" width="1" height="29"/>
|
||||
<rect key="frame" x="324" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="81t-Xh-wZT"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LNf-b4-GYP">
|
||||
<rect key="frame" x="322" y="0.0" width="52" height="49"/>
|
||||
<rect key="frame" x="324" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="S">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
@@ -139,9 +137,15 @@
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ZAg-Me-yKR" firstAttribute="leading" secondItem="Yr6-3E-keb" secondAttribute="leading" constant="5" id="0EB-cP-ogn"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="width" secondItem="cPl-47-rS8" secondAttribute="width" id="1ZI-HN-9ew"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="1pQ-h0-SEG"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="6iC-Cl-RyI" secondAttribute="trailing" constant="1" id="2UA-Ao-KZF"/>
|
||||
<constraint firstItem="dHj-rj-mjh" firstAttribute="height" secondItem="L7g-lu-boa" secondAttribute="height" id="4dj-Xx-ksP"/>
|
||||
<constraint firstAttribute="bottom" secondItem="EiN-2p-Oig" secondAttribute="bottom" constant="10" id="5eK-Bu-wpU"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="trailing" secondItem="Yr6-3E-keb" secondAttribute="trailingMargin" id="7Kc-RO-8KK"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="67F-sV-r6W"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="dHj-rj-mjh" secondAttribute="trailing" id="6ZX-Ub-2vw"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="height" secondItem="bRc-5e-QAH" secondAttribute="height" id="7Um-cV-f7p"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="7YT-x4-m88"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="trailing" secondItem="bRc-5e-QAH" secondAttribute="leading" id="ABd-MQ-9sp"/>
|
||||
<constraint firstAttribute="bottom" secondItem="UjQ-Cw-7wH" secondAttribute="bottom" constant="10" id="ASC-xR-Yxa"/>
|
||||
@@ -149,43 +153,87 @@
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="Aac-10-vTs"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="6iC-Cl-RyI" secondAttribute="trailing" id="BL5-PL-pac"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ZAg-Me-yKR" secondAttribute="bottom" id="BeZ-ar-qMN"/>
|
||||
<constraint firstItem="dHj-rj-mjh" firstAttribute="height" secondItem="bRc-5e-QAH" secondAttribute="height" id="DYn-Cd-g5H"/>
|
||||
<constraint firstAttribute="bottom" secondItem="kwc-0w-V51" secondAttribute="bottom" constant="10" id="EXu-BP-ftM"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LNf-b4-GYP" secondAttribute="bottom" id="EYe-ne-rqO"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="Fo8-Tp-bkn"/>
|
||||
<constraint firstItem="dHj-rj-mjh" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="GYq-pf-vR0"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="UjQ-Cw-7wH" secondAttribute="trailing" constant="72" id="HQ2-jA-X9g"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="eTo-Ip-reh" secondAttribute="trailing" id="I0s-Ze-pwV"/>
|
||||
<constraint firstAttribute="bottom" secondItem="bRc-5e-QAH" secondAttribute="bottom" constant="10" id="InL-Hk-twg"/>
|
||||
<constraint firstItem="UjQ-Cw-7wH" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="Jj4-jg-rdr"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="KQe-Ei-8jY"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="Kw5-3R-qXs"/>
|
||||
<constraint firstItem="bRc-5e-QAH" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="MXG-vB-U8F"/>
|
||||
<constraint firstItem="ZAg-Me-yKR" firstAttribute="width" secondItem="N3w-qP-kRZ" secondAttribute="width" id="Mem-UJ-5Js"/>
|
||||
<constraint firstItem="L7g-lu-boa" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="OVT-GJ-zq8"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" constant="25" id="OYQ-8o-3j8"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="width" secondItem="cPl-47-rS8" secondAttribute="width" id="Pl6-Xd-Krq"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="width" secondItem="LNf-b4-GYP" secondAttribute="width" id="Pro-fg-wBA"/>
|
||||
<constraint firstAttribute="bottom" secondItem="6iC-Cl-RyI" secondAttribute="bottom" id="Q5M-8N-hIh"/>
|
||||
<constraint firstItem="UjQ-Cw-7wH" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="RGn-ja-FRD"/>
|
||||
<constraint firstAttribute="trailing" secondItem="LNf-b4-GYP" secondAttribute="trailing" constant="5" id="RlS-d5-rIx"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="trailing" secondItem="cPl-47-rS8" secondAttribute="leading" id="Rs4-Pl-R8X"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="bRc-5e-QAH" secondAttribute="trailing" id="SO9-U6-cVO"/>
|
||||
<constraint firstAttribute="bottom" secondItem="N3w-qP-kRZ" secondAttribute="bottom" id="STf-aE-Y2E"/>
|
||||
<constraint firstAttribute="bottom" secondItem="kwc-0w-V51" secondAttribute="bottom" constant="10" id="SWG-oy-aZJ"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="TAb-IV-m7A"/>
|
||||
<constraint firstAttribute="bottom" secondItem="cPl-47-rS8" secondAttribute="bottom" id="Tmp-md-564"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="height" secondItem="UjQ-Cw-7wH" secondAttribute="height" id="Uli-Qb-6Om"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="VcV-kz-XBb"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="width" secondItem="6iC-Cl-RyI" secondAttribute="width" id="X0k-jG-o63"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="eTo-Ip-reh" secondAttribute="trailing" id="cOc-P1-ZhU"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="Wjb-tu-QEo" secondAttribute="trailing" id="dSr-cr-ebR"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="fgT-6k-CaP"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="Wjb-tu-QEo" secondAttribute="trailing" id="gNl-wJ-ujY"/>
|
||||
<constraint firstItem="ZAg-Me-yKR" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="glN-lT-q1z"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="width" secondItem="Wjb-tu-QEo" secondAttribute="width" id="hEH-9C-pGZ"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="height" secondItem="kwc-0w-V51" secondAttribute="height" id="hOI-fd-H7m"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="i5C-wG-rRN"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="trailing" secondItem="dHj-rj-mjh" secondAttribute="leading" id="jsw-H6-2gQ"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="lQE-r9-9JT"/>
|
||||
<constraint firstAttribute="bottom" secondItem="L7g-lu-boa" secondAttribute="bottom" constant="10" id="lv1-xB-0zR"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="oQe-Qf-9ZO"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="pn7-s8-fDj"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="qIf-aB-2ZY"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="EiN-2p-Oig" secondAttribute="trailing" id="sAE-Nl-Puc"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="L7g-lu-boa" secondAttribute="trailing" id="t1q-Nc-vbg"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="tVL-uj-6Ma"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="trailing" secondItem="L7g-lu-boa" secondAttribute="leading" id="u3Q-pF-E3A"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Wjb-tu-QEo" secondAttribute="bottom" id="uh4-LM-Ieo"/>
|
||||
<constraint firstItem="ZAg-Me-yKR" firstAttribute="leading" secondItem="Yr6-3E-keb" secondAttribute="leadingMargin" id="w9K-VP-JpE"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" constant="25" id="vrx-0B-GOB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="eTo-Ip-reh" secondAttribute="bottom" id="xIu-Vy-Nff"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="UjQ-Cw-7wH" secondAttribute="trailing" id="xWy-Uf-QEm"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="xsx-BM-yQ5"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="yEX-Wv-CZQ"/>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="67F-sV-r6W"/>
|
||||
<exclude reference="xWy-Uf-QEm"/>
|
||||
<exclude reference="1pQ-h0-SEG"/>
|
||||
<exclude reference="HQ2-jA-X9g"/>
|
||||
<exclude reference="OYQ-8o-3j8"/>
|
||||
<exclude reference="Rs4-Pl-R8X"/>
|
||||
<exclude reference="SWG-oy-aZJ"/>
|
||||
<exclude reference="TAb-IV-m7A"/>
|
||||
<exclude reference="Uli-Qb-6Om"/>
|
||||
<exclude reference="lQE-r9-9JT"/>
|
||||
<exclude reference="vrx-0B-GOB"/>
|
||||
<exclude reference="KQe-Ei-8jY"/>
|
||||
<exclude reference="sAE-Nl-Puc"/>
|
||||
<exclude reference="7Um-cV-f7p"/>
|
||||
<exclude reference="hOI-fd-H7m"/>
|
||||
<exclude reference="2UA-Ao-KZF"/>
|
||||
<exclude reference="SO9-U6-cVO"/>
|
||||
<exclude reference="6ZX-Ub-2vw"/>
|
||||
<exclude reference="cOc-P1-ZhU"/>
|
||||
<exclude reference="4dj-Xx-ksP"/>
|
||||
<exclude reference="DYn-Cd-g5H"/>
|
||||
<exclude reference="dSr-cr-ebR"/>
|
||||
<exclude reference="t1q-Nc-vbg"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="fridayButton" destination="Wjb-tu-QEo" id="AcP-Qg-i9P"/>
|
||||
@@ -196,7 +244,7 @@
|
||||
<outlet property="tuesdayButton" destination="cPl-47-rS8" id="wIn-mO-cUx"/>
|
||||
<outlet property="wednesdayButton" destination="6iC-Cl-RyI" id="GQe-Oy-pcd"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="443" y="197"/>
|
||||
<point key="canvasLocation" x="296" y="222"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
@@ -57,7 +57,6 @@ NSString *const kCountDownTimer = @"countDownTimer";
|
||||
// Date
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDateInline rowType:XLFormRowDescriptorTypeDateInline title:@"Date"];
|
||||
row.value = [NSDate new];
|
||||
[row.cellConfigAtConfigure setObject:[NSLocale localeWithLocaleIdentifier:@"FR_fr" ] forKey:@"locale"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Time
|
||||
@@ -72,12 +71,7 @@ NSString *const kCountDownTimer = @"countDownTimer";
|
||||
|
||||
// CountDownTimer
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCountDownTimerInline rowType:XLFormRowDescriptorTypeCountDownTimerInline title:@"Countdown Timer"];
|
||||
NSDateComponents * dateComp = [NSDateComponents new];
|
||||
dateComp.hour = 0;
|
||||
dateComp.minute = 7;
|
||||
dateComp.timeZone = [NSTimeZone systemTimeZone];
|
||||
NSCalendar * calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
|
||||
row.value = [calendar dateFromComponents:dateComp];
|
||||
row.value = [NSDate new];
|
||||
[section addFormRow:row];
|
||||
|
||||
|
||||
@@ -104,7 +98,7 @@ NSString *const kCountDownTimer = @"countDownTimer";
|
||||
|
||||
// CountDownTimer
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCountDownTimerInline rowType:XLFormRowDescriptorTypeCountDownTimer title:@"Countdown Timer"];
|
||||
row.value = [calendar dateFromComponents:dateComp];
|
||||
row.value = [NSDate new];
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"Disabled Dates"];
|
||||
@@ -154,36 +148,15 @@ NSString *const kCountDownTimer = @"countDownTimer";
|
||||
|
||||
-(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue
|
||||
{
|
||||
// super implementation must be called
|
||||
[super formRowDescriptorValueHasChanged:formRow oldValue:oldValue newValue:newValue];
|
||||
if([formRow.tag isEqualToString:kDatePicker])
|
||||
{
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"DatePicker"
|
||||
message:@"Value Has changed!"
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil];
|
||||
|
||||
[message show];
|
||||
#else
|
||||
if ([UIAlertController class]) {
|
||||
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"DatePicker"
|
||||
message:@"Value Has changed!"
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:@"OK"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:nil]];
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
else{
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"DatePicker"
|
||||
message:@"Value Has changed!"
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil];
|
||||
[message show];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#import "CustomRowsViewController.h"
|
||||
#import "AccessoryViewFormViewController.h"
|
||||
#import "PredicateFormViewController.h"
|
||||
#import "FormattersViewController.h"
|
||||
|
||||
NSString * const kTextFieldAndTextView = @"TextFieldAndTextView";
|
||||
NSString * const kSelectors = @"Selectors";
|
||||
@@ -47,7 +46,6 @@ NSString * const kMultivaluedOnlyReorder = @"MultivaluedOnlyReorder";
|
||||
NSString * const kMultivaluedOnlyInsert = @"MultivaluedOnlyInsert";
|
||||
NSString * const kMultivaluedOnlyDelete = @"MultivaluedOnlyDelete";
|
||||
NSString * const kValidations= @"Validations";
|
||||
NSString * const kFormatters = @"Formatters";
|
||||
|
||||
@interface ExamplesFormViewController ()
|
||||
|
||||
@@ -91,7 +89,7 @@ NSString * const kFormatters = @"Formatters";
|
||||
|
||||
// NativeEventFormViewController
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"realExamples" rowType:XLFormRowDescriptorTypeButton title:@"iOS Calendar Event Form"];
|
||||
row.action.formSegueIdentifier = @"NativeEventNavigationViewControllerSegue";
|
||||
row.action.formSegueIdenfifier = @"NativeEventNavigationViewControllerSegue";
|
||||
[section addFormRow:row];
|
||||
|
||||
|
||||
@@ -107,7 +105,7 @@ NSString * const kFormatters = @"Formatters";
|
||||
|
||||
// Selectors
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectors rowType:XLFormRowDescriptorTypeButton title:@"Selectors"];
|
||||
row.action.formSegueIdentifier = @"SelectorsFormViewControllerSegue";
|
||||
row.action.formSegueIdenfifier = @"SelectorsFormViewControllerSegue";
|
||||
[section addFormRow:row];
|
||||
|
||||
// Dates
|
||||
@@ -115,14 +113,9 @@ NSString * const kFormatters = @"Formatters";
|
||||
row.action.viewControllerClass = [DatesFormViewController class];
|
||||
[section addFormRow:row];
|
||||
|
||||
// NSFormatters
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kFormatters rowType:XLFormRowDescriptorTypeButton title:@"NSFormatter Support"];
|
||||
row.action.viewControllerClass = [FormattersViewController class];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Others
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kOthes rowType:XLFormRowDescriptorTypeButton title:@"Other Rows"];
|
||||
row.action.formSegueIdentifier = @"OthersFormViewControllerSegue";
|
||||
row.action.formSegueIdenfifier = @"OthersFormViewControllerSegue";
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"Multivalued example"];
|
||||
@@ -173,22 +166,22 @@ NSString * const kFormatters = @"Formatters";
|
||||
[form addFormSection:section];
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kValidations rowType:XLFormRowDescriptorTypeButton title:@"Validation Examples"];
|
||||
row.action.formSegueIdentifier = @"ValidationExamplesFormViewControllerSegue";
|
||||
row.action.formSegueIdenfifier = @"ValidationExamplesFormViewControllerSegue";
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"Using Predicates"];
|
||||
[form addFormSection:section];
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredicates rowType:XLFormRowDescriptorTypeButton title:@"Very basic predicates"];
|
||||
row.action.formSegueIdentifier = @"BasicPredicateViewControllerSegue";
|
||||
row.action.formSegueIdenfifier = @"BasicPredicateViewControllerSegue";
|
||||
[section addFormRow:row];
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredicates rowType:XLFormRowDescriptorTypeButton title:@"Blog Example Hide predicates"];
|
||||
row.action.formSegueIdentifier = @"BlogExampleViewSegue";
|
||||
row.action.formSegueIdenfifier = @"BlogExampleViewSegue";
|
||||
[section addFormRow:row];
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredicates rowType:XLFormRowDescriptorTypeButton title:@"Another example"];
|
||||
row.action.formSegueIdentifier = @"PredicateFormViewControllerSegue";
|
||||
row.action.formSegueIdenfifier = @"PredicateFormViewControllerSegue";
|
||||
[section addFormRow:row];
|
||||
|
||||
self.form = form;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
//
|
||||
// FormattersViewController.h
|
||||
// XLForm
|
||||
//
|
||||
// Created by Freddy Henin on 12/29/14.
|
||||
// Copyright (c) 2014 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XLFormViewController.h"
|
||||
|
||||
@interface FormattersViewController : XLFormViewController
|
||||
|
||||
@end
|
||||
@@ -1,120 +0,0 @@
|
||||
//
|
||||
// FormattersViewController.m
|
||||
// XLForm
|
||||
//
|
||||
// Created by Freddy Henin on 12/29/14.
|
||||
// Copyright (c) 2014 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
#import "XLForm.h"
|
||||
|
||||
#import "FormattersViewController.h"
|
||||
|
||||
#import <SHSPhoneComponent/SHSPhoneNumberFormatter+UserConfig.h>
|
||||
|
||||
|
||||
// Simple little class to demonstraite currency formatting. Unfortunally we have to subclass
|
||||
// NSNumberFormatter to work aroundn some long known rounding bugs with NSNumberFormatter
|
||||
// http://stackoverflow.com/questions/12580162/nsstring-to-nsdate-conversion-issue
|
||||
@interface CurrencyFormatter : NSNumberFormatter
|
||||
|
||||
@property (readonly) NSDecimalNumberHandler *roundingBehavior;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CurrencyFormatter
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self setNumberStyle: NSNumberFormatterCurrencyStyle];
|
||||
[self setGeneratesDecimalNumbers:YES];
|
||||
|
||||
NSUInteger currencyScale = [self maximumFractionDigits];
|
||||
|
||||
_roundingBehavior = [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundPlain scale:currencyScale raiseOnExactness:FALSE raiseOnOverflow:TRUE raiseOnUnderflow:TRUE raiseOnDivideByZero:TRUE];
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
//- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error
|
||||
//{
|
||||
// NSDecimalNumber *number;
|
||||
// BOOL success = [super getObjectValue:&number forString:string errorDescription:error];
|
||||
//
|
||||
// if (success) {
|
||||
// *anObject = [number decimalNumberByRoundingAccordingToBehavior:_roundingBehavior];
|
||||
// }
|
||||
// else {
|
||||
// *anObject = nil;
|
||||
// }
|
||||
//
|
||||
// return success;
|
||||
//}
|
||||
|
||||
@end
|
||||
|
||||
@interface FormattersViewController ()
|
||||
@end
|
||||
|
||||
@implementation FormattersViewController
|
||||
|
||||
-(id)init
|
||||
{
|
||||
XLFormDescriptor * formDescriptor = [XLFormDescriptor formDescriptorWithTitle:@"Text Fields"];
|
||||
XLFormSectionDescriptor * section;
|
||||
XLFormRowDescriptor * row;
|
||||
|
||||
formDescriptor.assignFirstResponderOnShow = NO;
|
||||
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
section.title = @"NSFormatter Support";
|
||||
section.footerTitle = @"Rows can be configured to use the formatter as you type or to toggle on and off during for display/editing. You will most likely need custom NSFormatter objects to do on the fly formatting since NSNumberFormatter is pretty limited in this regard.";
|
||||
[formDescriptor addFormSection:section];
|
||||
|
||||
// Phone
|
||||
SHSPhoneNumberFormatter *formatter = [[SHSPhoneNumberFormatter alloc] init];
|
||||
[formatter setDefaultOutputPattern:@"(###) ###-####" imagePath:nil];
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"phone" rowType:XLFormRowDescriptorTypePhone title:@"US Phone"];
|
||||
row.valueFormatter = formatter;
|
||||
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
|
||||
|
||||
row.useValueFormatterDuringInput = YES;
|
||||
[section addFormRow:row];
|
||||
|
||||
// Currency
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"currency" rowType:XLFormRowDescriptorTypeDecimal title:@"USD"];
|
||||
CurrencyFormatter *numberFormatter = [[CurrencyFormatter alloc] init];
|
||||
row.valueFormatter = numberFormatter;
|
||||
row.value = [NSDecimalNumber numberWithDouble:9.95];
|
||||
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Accounting
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"percent" rowType:XLFormRowDescriptorTypeNumber title:@"Test Score"];
|
||||
NSNumberFormatter *acctFormatter = [[NSNumberFormatter alloc] init];
|
||||
[acctFormatter setNumberStyle:NSNumberFormatterPercentStyle];
|
||||
row.valueFormatter = acctFormatter;
|
||||
row.value = @(0.75);
|
||||
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
|
||||
[section addFormRow:row];
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"megabytes" rowType:XLFormRowDescriptorTypeInfo title:@"Megabytes"];
|
||||
row.valueFormatter = [NSByteCountFormatter new];
|
||||
row.value = @(1024);
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[formDescriptor addFormSection:section];
|
||||
|
||||
return [super initWithForm:formDescriptor];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -30,7 +30,6 @@
|
||||
NSString *const kName = @"name";
|
||||
NSString *const kEmail = @"email";
|
||||
NSString *const kTwitter = @"twitter";
|
||||
NSString *const kZipCode = @"zipCode";
|
||||
NSString *const kNumber = @"number";
|
||||
NSString *const kInteger = @"integer";
|
||||
NSString *const kDecimal = @"decimal";
|
||||
@@ -73,10 +72,6 @@ NSString *const kNotes = @"notes";
|
||||
row.value = @"@no_editable";
|
||||
[section addFormRow:row];
|
||||
|
||||
// Zip Code
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kZipCode rowType:XLFormRowDescriptorTypeZipCode title:@"Zip Code"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Number
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kNumber rowType:XLFormRowDescriptorTypeNumber title:@"Number"];
|
||||
[section addFormRow:row];
|
||||
@@ -134,34 +129,8 @@ NSString *const kNotes = @"notes";
|
||||
return;
|
||||
}
|
||||
[self.tableView endEditing:YES];
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Valid Form", nil)
|
||||
message:@"No errors found"
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", nil)
|
||||
otherButtonTitles:nil];
|
||||
[message show];
|
||||
#else
|
||||
if ([UIAlertController class]){
|
||||
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Valid Form", nil)
|
||||
message:@"No errors found"
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:nil]];
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
|
||||
}
|
||||
else{
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Valid Form", nil)
|
||||
message:@"No errors found"
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", nil)
|
||||
otherButtonTitles:nil];
|
||||
[message show];
|
||||
}
|
||||
#endif
|
||||
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Valid Form", nil) message:@"No errors found" delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
|
||||
[alertView show];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -71,6 +71,18 @@
|
||||
row.selectorOptions = @[@"Option 1", @"Option 2", @"Option 3"];
|
||||
section.multivaluedRowTemplate = [row copy];
|
||||
[section addFormRow:row];
|
||||
|
||||
|
||||
// Add Section Button
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[form addFormSection:section];
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"AddSectionButton" rowType:XLFormRowDescriptorTypeButton title:@"Add Section"];
|
||||
row.action.formSelector = @selector(didTouchAddSectionButton:);
|
||||
[row.cellConfigAtConfigure setObject:[UIColor clearColor] forKey:@"backgroundColor"];
|
||||
[row.cellConfig setObject:[UIColor grayColor] forKey:@"textLabel.color"];
|
||||
[row.cellConfig setObject:[UIFont fontWithName:@"Helvetica" size:17] forKey:@"textLabel.font"];
|
||||
[section addFormRow:row];
|
||||
|
||||
return [super initWithForm:form];
|
||||
}
|
||||
|
||||
@@ -85,66 +97,29 @@
|
||||
|
||||
-(void)addDidTouch:(UIBarButtonItem * __unused)sender
|
||||
{
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
|
||||
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:nil
|
||||
delegate:self
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel")
|
||||
destructiveButtonTitle:@"Remove Last Section"
|
||||
otherButtonTitles:@"Add a section at the end", self.form.isDisabled ? @"Enable Form" : @"Disable Form", nil];
|
||||
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove Last Section" otherButtonTitles:@"Add a section at the end", self.form.isDisabled ? @"Enable Form" : @"Disable Form", nil];
|
||||
[actionSheet showInView:self.view];
|
||||
#else
|
||||
if ([UIAlertController class]){
|
||||
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:nil
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
__weak __typeof(self)weakSelf = self;
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:@"Remove Last Section"
|
||||
style:UIAlertActionStyleDestructive
|
||||
handler:^(UIAlertAction *action) {
|
||||
if (weakSelf.form.formSections.count > 0){
|
||||
// remove last section
|
||||
[weakSelf.form removeFormSectionAtIndex:(weakSelf.form.formSections.count - 1)];
|
||||
}
|
||||
}]];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:@"Add a section at the end"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
// add a new section
|
||||
XLFormSectionDescriptor * newSection = [XLFormSectionDescriptor formSectionWithTitle:[NSString stringWithFormat:@"Section created at %@", [NSDateFormatter localizedStringFromDate:[NSDate new] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]] sectionOptions:XLFormSectionOptionCanInsert | XLFormSectionOptionCanDelete];
|
||||
newSection.multivaluedTag = [NSString stringWithFormat:@"multivaluedPushSelector_%@", @(weakSelf.form.formSections.count)];
|
||||
XLFormRowDescriptor * newRow = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorPush title:@"Tap to select ;).."];
|
||||
newRow.selectorOptions = @[@"Option 1", @"Option 2", @"Option 3"];
|
||||
[newSection addFormRow:newRow];
|
||||
[weakSelf.form addFormSection:newSection];
|
||||
}]];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:self.form.isDisabled ? @"Enable Form" : @"Disable Form"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
weakSelf.form.disabled = !weakSelf.form.disabled;
|
||||
[weakSelf.tableView endEditing:YES];
|
||||
[weakSelf.tableView reloadData];
|
||||
}]];
|
||||
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
else{
|
||||
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:nil
|
||||
delegate:self
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
destructiveButtonTitle:@"Remove Last Section"
|
||||
otherButtonTitles:@"Add a section at the end", self.form.isDisabled ? @"Enable Form" : @"Disable Form", nil];
|
||||
[actionSheet showInView:self.view];
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
|
||||
-(void)didTouchAddSectionButton:(XLFormRowDescriptor *)sender
|
||||
{
|
||||
// Create a new section
|
||||
XLFormSectionDescriptor * newSection = [XLFormSectionDescriptor formSectionWithTitle:[NSString stringWithFormat:@"Section created at %@", [NSDateFormatter localizedStringFromDate:[NSDate new] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]]];
|
||||
newSection.multivaluedTag = [NSString stringWithFormat:@"multivaluedPushSelector_%@", @(self.form.formSections.count-1)];
|
||||
|
||||
// Add rows to the new section
|
||||
XLFormRowDescriptor * newRow = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorPush title:@"Language"];
|
||||
newRow.selectorOptions = @[@"Option 1", @"Option 2", @"Option 3"];
|
||||
[newSection addFormRow:newRow];
|
||||
newRow = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorPush title:@"Level"];
|
||||
newRow.selectorOptions = @[@"Option A", @"Option B", @"Option C"];
|
||||
[newSection addFormRow:newRow];
|
||||
|
||||
// Add new section
|
||||
[self.form addFormSection:newSection beforeSection:sender.sectionDescriptor];
|
||||
[self deselectFormRow:sender];
|
||||
}
|
||||
|
||||
#pragma mark - UIActionSheetDelegate
|
||||
|
||||
@@ -165,14 +140,13 @@
|
||||
[newSection addFormRow:newRow];
|
||||
[self.form addFormSection:newSection];
|
||||
}
|
||||
else if (![[actionSheet buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"Cancel")]){
|
||||
else {
|
||||
self.form.disabled = !self.form.disabled;
|
||||
[self.tableView endEditing:YES];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -92,57 +92,12 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
|
||||
|
||||
-(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
|
||||
{
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
|
||||
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle
|
||||
delegate:self
|
||||
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle delegate:self
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
destructiveButtonTitle:nil
|
||||
otherButtonTitles:NSLocalizedString(@"XLFormImageSelectorCell_ChooseExistingPhoto", @"Choose Existing Photo"), NSLocalizedString(@"XLFormImageSelectorCell_TakePicture", @"Take a Picture"), nil];
|
||||
actionSheet.tag = self.tag;
|
||||
[actionSheet showInView:self.formViewController.view];
|
||||
#else
|
||||
if ([UIAlertController class]) {
|
||||
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:self.rowDescriptor.selectorTitle
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
__weak __typeof(self)weakSelf = self;
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"XLFormImageSelectorCell_ChooseExistingPhoto", @"Choose Existing Photo")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
UIImagePickerController * imagePickerController = [[UIImagePickerController alloc] init];
|
||||
imagePickerController.delegate = weakSelf;
|
||||
imagePickerController.allowsEditing = YES;
|
||||
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
|
||||
imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
|
||||
[weakSelf.formViewController presentViewController:imagePickerController animated:YES completion:nil];
|
||||
}]];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"XLFormImageSelectorCell_TakePicture", @"Take a Picture")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
UIImagePickerController * imagePickerController = [[UIImagePickerController alloc] init];
|
||||
imagePickerController.delegate = weakSelf;
|
||||
imagePickerController.allowsEditing = YES;
|
||||
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
|
||||
imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
|
||||
[weakSelf.formViewController presentViewController:imagePickerController animated:YES completion:nil];
|
||||
}]];
|
||||
|
||||
[self.formViewController presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
else{
|
||||
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle
|
||||
delegate:self
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
destructiveButtonTitle:nil
|
||||
otherButtonTitles:NSLocalizedString(@"XLFormImageSelectorCell_ChooseExistingPhoto", @"Choose Existing Photo"), NSLocalizedString(@"XLFormImageSelectorCell_TakePicture", @"Take a Picture"), nil];
|
||||
actionSheet.tag = self.tag;
|
||||
[actionSheet showInView:self.formViewController.view];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma mark - LayoutConstraints
|
||||
@@ -154,7 +109,7 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
|
||||
|
||||
NSDictionary *metrics = @{@"margin":@5.0};
|
||||
|
||||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[text]" options:0 metrics:metrics views:uiComponents]];
|
||||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(margin)-[text]" options:0 metrics:metrics views:uiComponents]];
|
||||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(margin)-[text]" options:0 metrics:metrics views:uiComponents]];
|
||||
|
||||
|
||||
@@ -213,14 +168,9 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
|
||||
[self.textLabel removeObserver:self forKeyPath:@"text"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
|
||||
|
||||
#pragma mark - UIActionSheetDelegate
|
||||
|
||||
- (void)actionSheet:(UIActionSheet * __unused)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
|
||||
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
|
||||
{
|
||||
UIImagePickerController * imagePickerController = [[UIImagePickerController alloc] init];
|
||||
imagePickerController.delegate = self;
|
||||
@@ -237,8 +187,6 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#pragma mark - UIImagePickerControllerDelegate
|
||||
|
||||
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
|
||||
|
||||
@@ -27,14 +27,13 @@
|
||||
#import "OthersFormViewController.h"
|
||||
|
||||
NSString *const kSwitchBool = @"switchBool";
|
||||
NSString *const kSwitchCheck = @"switchCheck";
|
||||
NSString *const kSwitchCheck = @"switchBool";
|
||||
NSString *const kStepCounter = @"stepCounter";
|
||||
NSString *const kSlider = @"slider";
|
||||
NSString *const kSegmentedControl = @"segmentedControl";
|
||||
NSString *const kCustom = @"custom";
|
||||
NSString *const kInfo = @"info";
|
||||
NSString *const kButton = @"button";
|
||||
NSString *const kImage = @"image";
|
||||
NSString *const kButtonLeftAligned = @"buttonLeftAligned";
|
||||
NSString *const kButtonWithSegueId = @"buttonWithSegueId";
|
||||
NSString *const kButtonWithSegueClass = @"buttonWithSegueClass";
|
||||
@@ -45,7 +44,7 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
|
||||
@implementation OthersFormViewController
|
||||
|
||||
|
||||
-(instancetype)initWithCoder:(NSCoder *)coder
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder:coder];
|
||||
if (self) {
|
||||
@@ -54,7 +53,7 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
|
||||
return self;
|
||||
}
|
||||
|
||||
-(instancetype)init
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self){
|
||||
@@ -74,23 +73,16 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
|
||||
[form addFormSection:section];
|
||||
|
||||
// Switch
|
||||
XLFormRowDescriptor * row = [XLFormRowDescriptor formRowDescriptorWithTag:kSwitchBool rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Switch"];
|
||||
[row.cellConfigAtConfigure setObject:[UIColor redColor] forKey:@"switchControl.onTintColor"];
|
||||
[section addFormRow:row];
|
||||
[section addFormRow:[XLFormRowDescriptor formRowDescriptorWithTag:kSwitchBool rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Switch"]];
|
||||
|
||||
// check
|
||||
[section addFormRow:[XLFormRowDescriptor formRowDescriptorWithTag:kSwitchCheck rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Check"]];
|
||||
|
||||
// step counter
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kStepCounter rowType:XLFormRowDescriptorTypeStepCounter title:@"Step counter"];
|
||||
row.value = @50;
|
||||
[row.cellConfigAtConfigure setObject:@YES forKey:@"stepControl.wraps"];
|
||||
[row.cellConfigAtConfigure setObject:@10 forKey:@"stepControl.stepValue"];
|
||||
[row.cellConfigAtConfigure setObject:@10 forKey:@"stepControl.minimumValue"];
|
||||
[row.cellConfigAtConfigure setObject:@100 forKey:@"stepControl.maximumValue"];
|
||||
[section addFormRow:row];
|
||||
[section addFormRow:[XLFormRowDescriptor formRowDescriptorWithTag:kStepCounter rowType:XLFormRowDescriptorTypeStepCounter title:@"Step counter"]];
|
||||
|
||||
// Segmented Control
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSegmentedControl rowType:XLFormRowDescriptorTypeSelectorSegmentedControl title:@"Fruits"];
|
||||
XLFormRowDescriptor * row = [XLFormRowDescriptor formRowDescriptorWithTag:kSegmentedControl rowType:XLFormRowDescriptorTypeSelectorSegmentedControl title:@"Fruits"];
|
||||
row.selectorOptions = @[@"Apple", @"Orange", @"Pear"];
|
||||
row.value = @"Pear";
|
||||
[section addFormRow:row];
|
||||
@@ -104,10 +96,6 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
|
||||
[row.cellConfigAtConfigure setObject:@(4) forKey:@"steps"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Image
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kImage rowType:XLFormRowDescriptorTypeImage title:@"Image"];
|
||||
row.value = [UIImage imageNamed:@"default_avatar"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Info cell
|
||||
XLFormRowDescriptor *infoRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kInfo rowType:XLFormRowDescriptorTypeInfo];
|
||||
@@ -122,46 +110,22 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
|
||||
|
||||
// Button
|
||||
XLFormRowDescriptor * buttonRow = [XLFormRowDescriptor formRowDescriptorWithTag:kButton rowType:XLFormRowDescriptorTypeButton title:@"Button"];
|
||||
[buttonRow.cellConfig setObject:[UIColor colorWithRed:0.0 green:122.0/255.0 blue:1.0 alpha:1.0] forKey:@"textLabel.textColor"];
|
||||
buttonRow.action.formSelector = @selector(didTouchButton:);
|
||||
[section addFormRow:buttonRow];
|
||||
|
||||
|
||||
// Left Button
|
||||
XLFormRowDescriptor * buttonLeftAlignedRow = [XLFormRowDescriptor formRowDescriptorWithTag:kButtonLeftAligned rowType:XLFormRowDescriptorTypeButton title:@"Button with Block"];
|
||||
[buttonLeftAlignedRow.cellConfig setObject:@(NSTextAlignmentNatural) forKey:@"textLabel.textAlignment"];
|
||||
[buttonLeftAlignedRow.cellConfig setObject:[UIColor colorWithRed:0.0 green:122.0/255.0 blue:1.0 alpha:1.0] forKey:@"textLabel.textColor"];
|
||||
[buttonLeftAlignedRow.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
|
||||
[buttonLeftAlignedRow.cellConfig setObject:@(UITableViewCellAccessoryDisclosureIndicator) forKey:@"accessoryType"];
|
||||
|
||||
__typeof(self) __weak weakSelf = self;
|
||||
buttonLeftAlignedRow.action.formBlock = ^(XLFormRowDescriptor * sender){
|
||||
if ([[sender.sectionDescriptor.formDescriptor formRowWithTag:kSwitchBool].value boolValue]){
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil)
|
||||
message:@"Button has checked the switch value..."
|
||||
delegate:weakSelf
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", nil)
|
||||
otherButtonTitles:nil];
|
||||
[message show];
|
||||
#else
|
||||
if ([UIAlertController class]) {
|
||||
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Switch is ON", nil)
|
||||
message:@"Button has checked the switch value..."
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:nil]];
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
else{
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil)
|
||||
message:@"Button has checked the switch value..."
|
||||
delegate:weakSelf
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", nil)
|
||||
otherButtonTitles:nil];
|
||||
[message show];
|
||||
}
|
||||
#endif
|
||||
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil) message:@"Button has checked the switch value..." delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
|
||||
[alertView show];
|
||||
}
|
||||
[weakSelf deselectFormRow:sender];
|
||||
[self deselectFormRow:sender];
|
||||
};
|
||||
[section addFormRow:buttonLeftAlignedRow];
|
||||
|
||||
@@ -174,7 +138,7 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
|
||||
|
||||
// Button with SegueId
|
||||
XLFormRowDescriptor * buttonWithSegueId = [XLFormRowDescriptor formRowDescriptorWithTag:kButtonWithSegueClass rowType:XLFormRowDescriptorTypeButton title:@"Button with Segue Idenfifier"];
|
||||
buttonWithSegueId.action.formSegueIdentifier = @"MapViewControllerSegue";
|
||||
buttonWithSegueId.action.formSegueIdenfifier = @"MapViewControllerSegue";
|
||||
[section addFormRow:buttonWithSegueId];
|
||||
|
||||
|
||||
@@ -196,33 +160,8 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
|
||||
-(void)didTouchButton:(XLFormRowDescriptor *)sender
|
||||
{
|
||||
if ([[sender.sectionDescriptor.formDescriptor formRowWithTag:kSwitchBool].value boolValue]){
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil)
|
||||
message:@"Button has checked the switch value..."
|
||||
delegate:self
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", nil)
|
||||
otherButtonTitles:nil];
|
||||
[message show];
|
||||
#else
|
||||
if ([UIAlertController class]) {
|
||||
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Switch is ON", nil)
|
||||
message:@"Button has checked the switch value..."
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:nil]];
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
|
||||
}
|
||||
else{
|
||||
UIAlertView *message = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil)
|
||||
message:@"Button has checked the switch value..."
|
||||
delegate:self
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", nil)
|
||||
otherButtonTitles:nil];
|
||||
[message show];
|
||||
}
|
||||
#endif
|
||||
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil) message:@"Button has checked the switch value..." delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
|
||||
[alertView show];
|
||||
}
|
||||
[self deselectFormRow:sender];
|
||||
}
|
||||
|
||||
@@ -31,8 +31,11 @@ NSString *const kFilm = @"films1";
|
||||
NSString *const kFilm2 = @"films2";
|
||||
NSString *const kMusic = @"music";
|
||||
|
||||
@implementation BlogExampleViewController
|
||||
@interface BlogExampleViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation BlogExampleViewController
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder:coder];
|
||||
@@ -71,7 +74,7 @@ NSString *const kMusic = @"music";
|
||||
[section addFormRow:hobbyRow];
|
||||
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"Some more questions"];
|
||||
section.hidden = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"$%@.value.@count == 0", hobbyRow]];
|
||||
section.hidden = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"$%@.value.@count = 0", hobbyRow]];
|
||||
section.footerTitle = @"BlogExampleViewController.m";
|
||||
[form addFormSection:section];
|
||||
|
||||
|
||||
@@ -103,14 +103,11 @@ NSString *const kPredDep2 = @"preddep2";
|
||||
[section addFormRow:row];
|
||||
row.hidden = [NSString stringWithFormat:@"$%@.isDisabled == 1 AND $%@.value contains[c] 'Out'", pred4, pred];
|
||||
|
||||
typeof(self) __weak weakself = self;
|
||||
row.onChangeBlock = ^(id oldValue, id newValue, XLFormRowDescriptor* __unused rowDescriptor){
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Account Field changed" message:[NSString stringWithFormat:@"Old value: %@\nNew value: %@", oldValue, newValue ] preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
|
||||
[weakself.navigationController presentViewController:alert animated:YES completion:nil];
|
||||
};
|
||||
|
||||
|
||||
|
||||
self.form = form;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -30,6 +30,12 @@
|
||||
|
||||
@implementation NativeEventNavigationViewController
|
||||
|
||||
-(id)init
|
||||
{
|
||||
self = [super initWithRootViewController:[[NativeEventFormViewController alloc] init]];
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
@@ -209,17 +215,17 @@
|
||||
[dateStartCell setFormDatePickerMode:XLFormDateDatePickerModeDateTime];
|
||||
[dateEndCell setFormDatePickerMode:XLFormDateDatePickerModeDateTime];
|
||||
}
|
||||
[self updateFormRow:startDateDescriptor];
|
||||
[self updateFormRow:endDateDescriptor];
|
||||
[dateStartCell update];
|
||||
[dateEndCell update];
|
||||
}
|
||||
else if ([rowDescriptor.tag isEqualToString:@"starts"]){
|
||||
XLFormRowDescriptor * startDateDescriptor = [self.form formRowWithTag:@"starts"];
|
||||
XLFormRowDescriptor * endDateDescriptor = [self.form formRowWithTag:@"ends"];
|
||||
XLFormDateCell * dateEndCell = (XLFormDateCell *)[endDateDescriptor cellForFormController:self];
|
||||
if ([startDateDescriptor.value compare:endDateDescriptor.value] == NSOrderedDescending) {
|
||||
// startDateDescriptor is later than endDateDescriptor
|
||||
endDateDescriptor.value = [[NSDate alloc] initWithTimeInterval:(60*60*24) sinceDate:startDateDescriptor.value];
|
||||
[endDateDescriptor.cellConfig removeObjectForKey:@"detailTextLabel.attributedText"];
|
||||
[self updateFormRow:endDateDescriptor];
|
||||
[dateEndCell update];
|
||||
}
|
||||
}
|
||||
else if ([rowDescriptor.tag isEqualToString:@"ends"]){
|
||||
@@ -228,16 +234,10 @@
|
||||
XLFormDateCell * dateEndCell = (XLFormDateCell *)[endDateDescriptor cellForFormController:self];
|
||||
if ([startDateDescriptor.value compare:endDateDescriptor.value] == NSOrderedDescending) {
|
||||
// startDateDescriptor is later than endDateDescriptor
|
||||
[dateEndCell update]; // force detailTextLabel update
|
||||
NSDictionary *strikeThroughAttribute = [NSDictionary dictionaryWithObject:@1
|
||||
forKey:NSStrikethroughStyleAttributeName];
|
||||
NSAttributedString* strikeThroughText = [[NSAttributedString alloc] initWithString:dateEndCell.detailTextLabel.text attributes:strikeThroughAttribute];
|
||||
[endDateDescriptor.cellConfig setObject:strikeThroughText forKey:@"detailTextLabel.attributedText"];
|
||||
[self updateFormRow:endDateDescriptor];
|
||||
}
|
||||
else{
|
||||
[endDateDescriptor.cellConfig removeObjectForKey:@"detailTextLabel.attributedText"];
|
||||
[self updateFormRow:endDateDescriptor];
|
||||
dateEndCell.detailTextLabel.attributedText = strikeThroughText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// UIFormViewCotroller+NativeEvetFormViewController.h
|
||||
// XLForm
|
||||
//
|
||||
// Created by Martin Barreto on 4/2/14.
|
||||
// Copyright (c) 2014 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
|
||||
@interface UIFormViewCotroller (NativeEventFormViewController)
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// UIFormViewCotroller+NativeEvetFormViewController.m
|
||||
// XLForm
|
||||
//
|
||||
// Created by Martin Barreto on 4/2/14.
|
||||
// Copyright (c) 2014 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#import "UIFormViewCotroller+NativeEvetFormViewController.h"
|
||||
|
||||
@implementation UIFormViewCotroller (NativeEvetFormViewController)
|
||||
|
||||
@end
|
||||
@@ -29,32 +29,9 @@
|
||||
NSString *const kSelectorUser = @"selectorUser";
|
||||
NSString *const kSelectorUserPopover = @"kSelectorUserPopover";
|
||||
|
||||
@interface UserTransformer : NSValueTransformer
|
||||
@end
|
||||
|
||||
@implementation UserTransformer
|
||||
|
||||
+ (Class)transformedValueClass
|
||||
{
|
||||
return [NSString class];
|
||||
}
|
||||
|
||||
+ (BOOL)allowsReverseTransformation
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (id)transformedValue:(id)value
|
||||
{
|
||||
if (!value) return nil;
|
||||
NSDictionary *user = (NSDictionary *) value;
|
||||
return [user valueForKeyPath:@"user.name"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation DynamicSelectorsFormViewController
|
||||
|
||||
|
||||
-(id)init
|
||||
{
|
||||
self = [super init];
|
||||
@@ -71,24 +48,19 @@ NSString *const kSelectorUserPopover = @"kSelectorUserPopover";
|
||||
|
||||
// Selector Push
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorUser rowType:XLFormRowDescriptorTypeSelectorPush title:@"User"];
|
||||
row.action.viewControllerStoryboardId = @"UsersTableViewController";
|
||||
row.valueTransformer = [UserTransformer class];
|
||||
row.action.viewControllerClass = [UsersTableViewController class];
|
||||
[section addFormRow:row];
|
||||
|
||||
// if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad){
|
||||
// // Selector PopOver
|
||||
// row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorUserPopover rowType:XLFormRowDescriptorTypeSelectorPopover title:@"User Popover"];
|
||||
// row.action.viewControllerClass = [UsersTableViewController class];
|
||||
// [section addFormRow:row];
|
||||
// }
|
||||
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad){
|
||||
// Selector PopOver
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorUserPopover rowType:XLFormRowDescriptorTypeSelectorPopover title:@"User Popover"];
|
||||
row.action.viewControllerClass = [UsersTableViewController class];
|
||||
[section addFormRow:row];
|
||||
}
|
||||
self.form = form;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (UIStoryboard *)storyboardForRow:(XLFormRowDescriptor *)formRow
|
||||
{
|
||||
return [UIStoryboard storyboardWithName:@"iPhoneStoryboard" bundle:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -24,11 +24,8 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "XLFormRowDescriptor.h"
|
||||
#import "XLRemoteDataStoreController.h"
|
||||
#import "XLTableViewController.h"
|
||||
|
||||
@interface UsersTableViewController : XLRemoteDataStoreController <XLFormRowDescriptorViewController, XLFormRowDescriptorPopoverViewController>
|
||||
@interface UsersTableViewController : XLTableViewController <XLFormRowDescriptorViewController, XLFormRowDescriptorPopoverViewController>
|
||||
|
||||
@property BOOL isSearchResultsController;
|
||||
@property NSLayoutConstraint *topConstraint;
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "UsersTableViewController.h"
|
||||
#import "HTTPSessionManager.h"
|
||||
#import "UserLocalDataLoader.h"
|
||||
#import "UserRemoteDataLoader.h"
|
||||
#import "User+Additions.h"
|
||||
|
||||
// AFNetworking
|
||||
#import <AFNetworking/UIImageView+AFNetworking.h>
|
||||
@@ -63,6 +65,7 @@
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Views
|
||||
|
||||
-(UIImageView *)userImage
|
||||
@@ -98,7 +101,7 @@
|
||||
NSDictionary *metrics = @{@"imgSize":@50.0,
|
||||
@"margin" :@12.0};
|
||||
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[image(imgSize)]-[name]"
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(margin)-[image(imgSize)]-[name]"
|
||||
options:NSLayoutFormatAlignAllTop
|
||||
metrics:metrics
|
||||
views:views]];
|
||||
@@ -107,7 +110,6 @@
|
||||
options:0
|
||||
metrics:metrics
|
||||
views:views]];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -115,69 +117,56 @@
|
||||
@end
|
||||
|
||||
|
||||
@interface UsersTableViewController () <UISearchControllerDelegate>
|
||||
|
||||
@property (nonatomic, readonly) UsersTableViewController * searchResultController;
|
||||
@property (nonatomic, readonly) UISearchController * searchController;
|
||||
@interface UsersTableViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation UsersTableViewController
|
||||
|
||||
@synthesize rowDescriptor = _rowDescriptor;
|
||||
@synthesize popoverController = __popoverController;
|
||||
@synthesize searchController = _searchController;
|
||||
@synthesize searchResultController = _searchResultController;
|
||||
|
||||
static NSString *const kCellIdentifier = @"CellIdentifier";
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder:coder];
|
||||
if (self) {
|
||||
[self initialize];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if(self)
|
||||
{
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
[self initialize];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)initialize
|
||||
-(void)initialize
|
||||
{
|
||||
self.dataLoader = [[XLDataLoader alloc] initWithURLString:@"/mobile/users.json" offsetParamName:@"offset" limitParamName:@"limit" searchStringParamName:@"filter"];
|
||||
self.dataLoader.delegate = self;
|
||||
self.dataLoader.storeDelegate = self;
|
||||
self.dataLoader.limit = 4;
|
||||
self.dataLoader.collectionKeyPath = @"";
|
||||
// Enable the pagination
|
||||
self.loadingPagingEnabled = YES;
|
||||
|
||||
// Support Search Controller
|
||||
self.supportSearchController = YES;
|
||||
|
||||
[self setLocalDataLoader:[[UserLocalDataLoader alloc] init]];
|
||||
[self setRemoteDataLoader:[[UserRemoteDataLoader alloc] init]];
|
||||
|
||||
// Search
|
||||
[self setSearchLocalDataLoader:[[UserLocalDataLoader alloc] init]];
|
||||
[self setSearchRemoteDataLoader:[[UserRemoteDataLoader alloc] init]];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self.tableView registerClass:[UserCell class] forCellReuseIdentifier:kCellIdentifier];
|
||||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
if (!self.isSearchResultsController){
|
||||
self.tableView.tableHeaderView = self.searchController.searchBar;
|
||||
}
|
||||
else{
|
||||
[self.tableView setContentInset:UIEdgeInsetsMake(64, 0, 0, 0)];
|
||||
[self.tableView setScrollIndicatorInsets:self.tableView.contentInset];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
[self.searchController.searchBar sizeToFit];
|
||||
// SearchBar
|
||||
self.tableView.tableHeaderView = self.searchDisplayController.searchBar;
|
||||
|
||||
// register cells
|
||||
[self.searchDisplayController.searchResultsTableView registerClass:[UserCell class] forCellReuseIdentifier:kCellIdentifier];
|
||||
[self.tableView registerClass:[UserCell class] forCellReuseIdentifier:kCellIdentifier];
|
||||
|
||||
[self customizeAppearance];
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource
|
||||
@@ -185,28 +174,49 @@ static NSString *const kCellIdentifier = @"CellIdentifier";
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
UserCell *cell = (UserCell *) [tableView dequeueReusableCellWithIdentifier:kCellIdentifier forIndexPath:indexPath];;
|
||||
|
||||
NSDictionary *dataItem = [self.dataStore dataAtIndexPath:indexPath];
|
||||
|
||||
cell.userName.text = [dataItem valueForKeyPath:@"user.name"];
|
||||
[cell.userImage setImageWithURL:[NSURL URLWithString:[dataItem valueForKeyPath:@"user.imageURL"]] placeholderImage:[UIImage imageNamed:@"default-avatar"]];
|
||||
|
||||
cell.accessoryType = [[self.rowDescriptor.value valueForKeyPath:@"user.id"] isEqual:[dataItem valueForKeyPath:@"user.id"]] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
||||
User * user = nil;
|
||||
if (tableView == self.tableView){
|
||||
user = (User *)[self.localDataLoader objectAtIndexPath:indexPath];
|
||||
}
|
||||
else{
|
||||
user = (User *)[self.searchLocalDataLoader objectAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
cell.userName.text = user.userName;
|
||||
NSMutableURLRequest* imageRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:user.userImageURL]];
|
||||
[imageRequest setValue:@"image/*" forHTTPHeaderField:@"Accept"];
|
||||
__typeof__(cell) __weak weakCell = cell;
|
||||
[cell.userImage setImageWithURLRequest: imageRequest
|
||||
placeholderImage:[User defaultProfileImage]
|
||||
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
|
||||
if (image) {
|
||||
[weakCell.userImage setImage:image];
|
||||
}
|
||||
}
|
||||
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
|
||||
}];
|
||||
cell.accessoryType = [[self.rowDescriptor.value formValue] isEqual:user.userId] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate
|
||||
|
||||
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return 73.0f;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UITableViewDelegate
|
||||
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSDictionary *dataItem = [self.dataStore dataAtIndexPath:indexPath];
|
||||
|
||||
self.rowDescriptor.value = dataItem;
|
||||
User * user = nil;
|
||||
if (tableView == self.tableView){
|
||||
user = (User *)[self.localDataLoader objectAtIndexPath:indexPath];
|
||||
}
|
||||
else{
|
||||
user = (User *)[self.searchLocalDataLoader objectAtIndexPath:indexPath];
|
||||
}
|
||||
self.rowDescriptor.value = user;
|
||||
|
||||
if (self.popoverController){
|
||||
[self.popoverController dismissPopoverAnimated:YES];
|
||||
@@ -217,36 +227,19 @@ static NSString *const kCellIdentifier = @"CellIdentifier";
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XLDataLoaderDelegate
|
||||
|
||||
-(AFHTTPSessionManager *)sessionManagerForDataLoader:(XLDataLoader *)dataLoader
|
||||
#pragma mark - Helpers
|
||||
|
||||
-(void)customizeAppearance
|
||||
{
|
||||
return [HTTPSessionManager sharedClient];
|
||||
}
|
||||
|
||||
#pragma mark - UISearchController
|
||||
|
||||
-(UISearchController *)searchController
|
||||
{
|
||||
if (_searchController) return _searchController;
|
||||
[[self navigationItem] setTitle:@"Select a User"];
|
||||
|
||||
self.definesPresentationContext = YES;
|
||||
_searchController = [[UISearchController alloc] initWithSearchResultsController:self.searchResultController];
|
||||
_searchController.delegate = self;
|
||||
_searchController.searchResultsUpdater = self.searchResultController;
|
||||
_searchController.searchBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
[_searchController.searchBar sizeToFit];
|
||||
return _searchController;
|
||||
[self.tableView setBackgroundColor:[UIColor colorWithWhite:0.9 alpha:1.0]];
|
||||
[self.tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
|
||||
|
||||
[self.searchDisplayController.searchResultsTableView setBackgroundColor:[UIColor colorWithWhite:0.9 alpha:1.0]];
|
||||
[self.searchDisplayController.searchResultsTableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
|
||||
}
|
||||
|
||||
|
||||
-(UsersTableViewController *)searchResultController
|
||||
{
|
||||
if (_searchResultController) return _searchResultController;
|
||||
_searchResultController = [[UsersTableViewController alloc]init];
|
||||
_searchResultController.dataLoader.limit = 0; // no paging in search result
|
||||
_searchResultController.isSearchResultsController = YES;
|
||||
return _searchResultController;
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// XLRatingView.swift
|
||||
//
|
||||
// CoreDataStore.h
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.com )
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
|
||||
//
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -23,26 +24,30 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
class XLRatingView : AXRatingView {
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
|
||||
|
||||
func customize() {
|
||||
baseColor = UIColor(red: (205/255.0), green: (201/255.0), blue: (201/255.0), alpha: 1)
|
||||
highlightColor = UIColor(red: (255/255.0), green: (215/255.0), blue: 0, alpha: 1)
|
||||
markFont = UIFont.systemFont(ofSize: 23.0)
|
||||
stepInterval = 1.0
|
||||
}
|
||||
|
||||
}
|
||||
#import <CoreData/CoreData.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface CoreDataStore : NSObject
|
||||
|
||||
+(id)defaultStore;
|
||||
|
||||
+ (NSManagedObjectContext *)mainQueueContext;
|
||||
+ (NSManagedObjectContext *)privateQueueContext;
|
||||
|
||||
+ (void)savePrivateQueueContext;
|
||||
+ (void)saveMainQueueContext;
|
||||
|
||||
+ (NSManagedObjectID *)managedObjectIDFromString:(NSString *)managedObjectIDString;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface NSManagedObject (Additions)
|
||||
|
||||
+(instancetype)findFirstByAttribute:(NSString *)attribute withValue:(id)value inContext:(NSManagedObjectContext *)context;
|
||||
|
||||
+(NSFetchRequest*)fetchRequest;
|
||||
|
||||
+(instancetype)insert:(NSManagedObjectContext *)context;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,227 @@
|
||||
//
|
||||
// CoreDataStore.m
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
#import "CoreDataStore.h"
|
||||
|
||||
static NSString *const TBCoreDataModelFileName = @"Model";
|
||||
|
||||
@interface CoreDataStore ()
|
||||
|
||||
@property (strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
|
||||
@property (strong, nonatomic) NSManagedObjectModel *managedObjectModel;
|
||||
|
||||
@property (strong, nonatomic) NSManagedObjectContext *mainQueueContext;
|
||||
@property (strong, nonatomic) NSManagedObjectContext *privateQueueContext;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CoreDataStore
|
||||
|
||||
|
||||
+ (instancetype)defaultStore {
|
||||
static CoreDataStore *_defaultStore = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_defaultStore = [[self alloc] init];
|
||||
});
|
||||
return _defaultStore;
|
||||
}
|
||||
|
||||
#pragma mark - Singleton Access
|
||||
|
||||
+ (NSManagedObjectContext *)mainQueueContext
|
||||
{
|
||||
return [[self defaultStore] mainQueueContext];
|
||||
}
|
||||
|
||||
+ (NSManagedObjectContext *)privateQueueContext
|
||||
{
|
||||
return [[self defaultStore] privateQueueContext];
|
||||
}
|
||||
|
||||
+(void)savePrivateQueueContext
|
||||
{
|
||||
NSError * error;
|
||||
[[self privateQueueContext] save:&error];
|
||||
NSAssert(!error, [error localizedDescription]);
|
||||
}
|
||||
|
||||
+ (void)saveMainQueueContext
|
||||
{
|
||||
NSError * error;
|
||||
[[self mainQueueContext] save:&error];
|
||||
NSAssert(!error, [error localizedDescription]);
|
||||
}
|
||||
|
||||
+ (NSManagedObjectID *)managedObjectIDFromString:(NSString *)managedObjectIDString
|
||||
{
|
||||
return [[[self defaultStore] persistentStoreCoordinator] managedObjectIDForURIRepresentation:[NSURL URLWithString:managedObjectIDString]];
|
||||
}
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contextDidSavePrivateQueueContext:)name:NSManagedObjectContextDidSaveNotification object:[self privateQueueContext]];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contextDidSaveMainQueueContext:) name:NSManagedObjectContextDidSaveNotification object:[self mainQueueContext]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
#pragma mark - Notifications
|
||||
|
||||
- (void)contextDidSavePrivateQueueContext:(NSNotification *)notification
|
||||
{
|
||||
@synchronized(self) {
|
||||
[self.mainQueueContext performBlock:^{
|
||||
for(NSManagedObject *object in [[notification userInfo] objectForKey:NSUpdatedObjectsKey]) {
|
||||
[[self.mainQueueContext objectWithID:[object objectID]] willAccessValueForKey:nil];
|
||||
}
|
||||
[self.mainQueueContext mergeChangesFromContextDidSaveNotification:notification];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)contextDidSaveMainQueueContext:(NSNotification *)notification
|
||||
{
|
||||
@synchronized(self) {
|
||||
[self.privateQueueContext performBlock:^{
|
||||
[self.privateQueueContext mergeChangesFromContextDidSaveNotification:notification];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters
|
||||
|
||||
- (NSManagedObjectContext *)mainQueueContext
|
||||
{
|
||||
if (!_mainQueueContext) {
|
||||
_mainQueueContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
|
||||
_mainQueueContext.persistentStoreCoordinator = self.persistentStoreCoordinator;
|
||||
}
|
||||
|
||||
return _mainQueueContext;
|
||||
}
|
||||
|
||||
- (NSManagedObjectContext *)privateQueueContext
|
||||
{
|
||||
if (!_privateQueueContext) {
|
||||
_privateQueueContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
|
||||
_privateQueueContext.persistentStoreCoordinator = self.persistentStoreCoordinator;
|
||||
}
|
||||
|
||||
return _privateQueueContext;
|
||||
}
|
||||
|
||||
#pragma mark - Stack Setup
|
||||
|
||||
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
|
||||
{
|
||||
if (!_persistentStoreCoordinator) {
|
||||
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];
|
||||
NSError *error = nil;
|
||||
|
||||
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[self persistentStoreURL] options:[self persistentStoreOptions] error:&error]) {
|
||||
NSLog(@"Error adding persistent store. %@, %@", error, error.userInfo);
|
||||
}
|
||||
}
|
||||
|
||||
return _persistentStoreCoordinator;
|
||||
}
|
||||
|
||||
- (NSManagedObjectModel *)managedObjectModel
|
||||
{
|
||||
if (!_managedObjectModel) {
|
||||
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:TBCoreDataModelFileName withExtension:@"momd"];
|
||||
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
|
||||
}
|
||||
|
||||
return _managedObjectModel;
|
||||
}
|
||||
|
||||
- (NSURL *)persistentStoreURL
|
||||
{
|
||||
return [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Model.sqlite"];
|
||||
}
|
||||
|
||||
- (NSDictionary *)persistentStoreOptions
|
||||
{
|
||||
return @{NSInferMappingModelAutomaticallyOption: @YES, NSMigratePersistentStoresAutomaticallyOption: @YES, NSSQLitePragmasOption: @{@"synchronous": @"OFF"}};
|
||||
}
|
||||
|
||||
#pragma mark - Application's Documents directory
|
||||
|
||||
// Returns the URL to the application's Documents directory.
|
||||
- (NSURL *)applicationDocumentsDirectory
|
||||
{
|
||||
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation NSManagedObject (Additions)
|
||||
|
||||
|
||||
+(instancetype)findFirstByAttribute:(NSString *)attribute withValue:(id)value inContext:(NSManagedObjectContext *)context
|
||||
{
|
||||
NSString * predicateStr = [NSString stringWithFormat:@"%@ = %%@", attribute];
|
||||
NSPredicate * searchByAttValue = [NSPredicate predicateWithFormat:predicateStr argumentArray:@[value]];
|
||||
NSFetchRequest * fetchRequest = [self fetchRequest];
|
||||
fetchRequest.predicate = searchByAttValue;
|
||||
fetchRequest.fetchLimit = 1;
|
||||
NSArray *result = [context executeFetchRequest:fetchRequest error:nil];
|
||||
return [result lastObject];
|
||||
}
|
||||
|
||||
+(NSFetchRequest*)fetchRequest
|
||||
{
|
||||
return [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass(self)];
|
||||
}
|
||||
|
||||
+(NSEntityDescription*)entityDescriptor:(NSManagedObjectContext *)context
|
||||
{
|
||||
return [NSEntityDescription entityForName:NSStringFromClass(self) inManagedObjectContext:context];
|
||||
}
|
||||
|
||||
+(instancetype)insert:(NSManagedObjectContext *)context
|
||||
{
|
||||
return [[NSManagedObject alloc] initWithEntity:[self entityDescriptor:context] insertIntoManagedObjectContext:context];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//
|
||||
// CLLocationValueTrasformer.swift
|
||||
// User+Additions.h
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.com )
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
|
||||
//
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -23,24 +23,19 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "XLForm.h"
|
||||
#import "User.h"
|
||||
|
||||
import MapKit
|
||||
@interface User (Additions) <XLFormOptionObject>
|
||||
|
||||
class CLLocationValueTrasformer : ValueTransformer {
|
||||
+ (User *)createOrUpdateWithServiceResult:(NSDictionary *)data inContext:(NSManagedObjectContext *)context;
|
||||
|
||||
override class func transformedValueClass() -> AnyClass {
|
||||
return NSString.self
|
||||
}
|
||||
|
||||
|
||||
override class func allowsReverseTransformation() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
override func transformedValue(_ value: Any?) -> Any? {
|
||||
if let valueData = value, let location = valueData as? CLLocation{
|
||||
return String(format: "%0.4f, %0.4f", location.coordinate.latitude, location.coordinate.longitude)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
+ (UIImage *)defaultProfileImage;
|
||||
|
||||
+ (NSPredicate *)getPredicateBySearchInput:(NSString *)search;
|
||||
|
||||
+ (NSFetchRequest *)getFetchRequest;
|
||||
|
||||
+ (NSFetchRequest *)getFetchRequestBySearchInput:(NSString *)search;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// User+Additions.m
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
|
||||
#import "CoreDataStore.h"
|
||||
#import "User+Additions.h"
|
||||
|
||||
#define USER_ID @"id"
|
||||
#define USER_IMAGE_URL @"imageURL"
|
||||
#define USER_NAME @"name"
|
||||
|
||||
|
||||
@implementation User (Additions)
|
||||
|
||||
+ (User *)createOrUpdateWithServiceResult:(NSDictionary *)data inContext:(NSManagedObjectContext *)context;
|
||||
{
|
||||
User *user = [User findFirstByAttribute:@"userId" withValue:data[USER_ID] inContext:context];
|
||||
if (!user)
|
||||
{
|
||||
user = [User insert:context];
|
||||
}
|
||||
user.userId = data[USER_ID];
|
||||
user.userImageURL = data[USER_IMAGE_URL] ;
|
||||
user.userName = data[USER_NAME];
|
||||
return user;
|
||||
}
|
||||
|
||||
+ (UIImage *)defaultProfileImage
|
||||
{
|
||||
return [UIImage imageNamed:@"default-avatar"];
|
||||
}
|
||||
|
||||
+ (NSPredicate *)getPredicateBySearchInput:(NSString *)search {
|
||||
|
||||
if (search && ![search isEqualToString:@""]) {
|
||||
return [NSPredicate predicateWithFormat:@"userName CONTAINS[cd] %@" , search];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (NSFetchRequest *)getFetchRequest {
|
||||
return [User getFetchRequestBySearchInput:nil];
|
||||
}
|
||||
|
||||
+ (NSFetchRequest *)getFetchRequestBySearchInput:(NSString *)search {
|
||||
NSFetchRequest * fetchRequest = [User fetchRequest];
|
||||
fetchRequest.predicate = [User getPredicateBySearchInput:search];
|
||||
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"userName" ascending:YES selector:@selector(caseInsensitiveCompare:)]];
|
||||
return fetchRequest;
|
||||
}
|
||||
|
||||
#pragma mark - XLFormOptionObject
|
||||
|
||||
-(NSString *)formDisplayText
|
||||
{
|
||||
return self.userName;
|
||||
}
|
||||
|
||||
-(id)formValue
|
||||
{
|
||||
return self.userId;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -1,7 +1,8 @@
|
||||
// XLFormRatingCell.swift
|
||||
//
|
||||
// User.h
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.com )
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
|
||||
//
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -22,35 +23,14 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
let XLFormRowDescriptorTypeRate = "XLFormRowDescriptorTypeRate"
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreData/CoreData.h>
|
||||
|
||||
|
||||
class XLFormRatingCell : XLFormBaseCell {
|
||||
|
||||
@IBOutlet weak var rateTitle: UILabel!
|
||||
@IBOutlet weak var ratingView: XLRatingView!
|
||||
|
||||
|
||||
override func configure() {
|
||||
super.configure()
|
||||
selectionStyle = .none
|
||||
ratingView.addTarget(self, action: #selector(XLFormRatingCell.rateChanged(_:)), for:.valueChanged)
|
||||
}
|
||||
|
||||
|
||||
override func update() {
|
||||
super.update()
|
||||
ratingView.value = (rowDescriptor!.value! as AnyObject).floatValue
|
||||
rateTitle.text = rowDescriptor!.title
|
||||
ratingView.alpha = rowDescriptor!.isDisabled() ? 0.6 : 1
|
||||
rateTitle.alpha = rowDescriptor!.isDisabled() ? 0.6 : 1
|
||||
}
|
||||
|
||||
//MARK: Events
|
||||
|
||||
func rateChanged(_ ratingView : XLRatingView){
|
||||
rowDescriptor!.value = ratingView.value
|
||||
}
|
||||
|
||||
}
|
||||
@interface User : NSManagedObject
|
||||
|
||||
@property (nonatomic, retain) NSNumber * userId;
|
||||
@property (nonatomic, retain) NSString * userName;
|
||||
@property (nonatomic, retain) NSString * userImageURL;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// User.m
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
#import "User.h"
|
||||
|
||||
|
||||
@implementation User
|
||||
|
||||
@dynamic userId;
|
||||
@dynamic userName;
|
||||
@dynamic userImageURL;
|
||||
|
||||
@end
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// XLFormBaseCell.h
|
||||
// UserLocalDataLoader.h
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
|
||||
@@ -23,11 +23,8 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "XLFormBaseCell.h"
|
||||
#import "XLLocalDataLoader.h"
|
||||
|
||||
@interface XLFormImageCell : XLFormBaseCell
|
||||
@interface UserLocalDataLoader : XLLocalDataLoader
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// UserLocalDataLoader.m
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
#import "UserLocalDataLoader.h"
|
||||
#import "User+Additions.h"
|
||||
#import "CoreDataStore.h"
|
||||
|
||||
@implementation UserLocalDataLoader
|
||||
{
|
||||
NSString *_searchString;
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
NSFetchedResultsController * fetchResultController = [[NSFetchedResultsController alloc] initWithFetchRequest:[User getFetchRequest]
|
||||
managedObjectContext:[CoreDataStore mainQueueContext]
|
||||
sectionNameKeyPath:nil
|
||||
cacheName:nil];
|
||||
[self setFetchedResultsController:fetchResultController];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)changeSearchString:(NSString *)searchString
|
||||
{
|
||||
_searchString = searchString;
|
||||
[self refreshPredicate];
|
||||
}
|
||||
|
||||
- (void)refreshPredicate
|
||||
{
|
||||
[self setPredicate:[User getPredicateBySearchInput:_searchString]];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// UserRemoteDataLoader.h
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
#import "XLRemoteDataLoader.h"
|
||||
|
||||
@interface UserRemoteDataLoader : XLRemoteDataLoader
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// UserRemoteDataLoader.m
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
|
||||
#import "UserRemoteDataLoader.h"
|
||||
#import "HTTPSessionManager.h"
|
||||
#import "CoreDataStore.h"
|
||||
#import "User+Additions.h"
|
||||
|
||||
@implementation UserRemoteDataLoader
|
||||
|
||||
-(NSString *)URLString
|
||||
{
|
||||
return @"/mobile/users.json";
|
||||
}
|
||||
|
||||
-(NSDictionary *)parameters
|
||||
{
|
||||
NSString *filterParam = self.searchString ?: @"";
|
||||
return @{@"filter" : filterParam,
|
||||
@"offset" : @(self.offset),
|
||||
@"limit" : @(self.limit)};
|
||||
}
|
||||
|
||||
-(AFHTTPSessionManager *)sessionManager
|
||||
{
|
||||
return [HTTPSessionManager sharedClient];
|
||||
}
|
||||
|
||||
-(void)successulDataLoad {
|
||||
// change flags
|
||||
// [self fetchedData] contains the data coming from the server
|
||||
NSArray * itemsArray = [[self fetchedData] objectForKey:kXLRemoteDataLoaderDefaultKeyForNonDictionaryResponse];
|
||||
|
||||
// This flag indicates if there is more data to load
|
||||
_hasMoreToLoad = !((itemsArray.count == 0) || (itemsArray.count < _limit && itemsArray.count != 0));
|
||||
[[CoreDataStore privateQueueContext] performBlock:^{
|
||||
for (NSDictionary *item in itemsArray) {
|
||||
// Creates or updates the User and the user who created it with the data that came from the server
|
||||
[User createOrUpdateWithServiceResult:item[@"user"] inContext:[CoreDataStore privateQueueContext]];
|
||||
}
|
||||
[self removeOutdatedData:itemsArray inContext:[CoreDataStore privateQueueContext]];
|
||||
[CoreDataStore savePrivateQueueContext];
|
||||
}];
|
||||
[super successulDataLoad];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Auxiliary Functions
|
||||
|
||||
- (void)removeOutdatedData:(NSArray *)data inContext:(NSManagedObjectContext *)context
|
||||
{
|
||||
// First, remove older data
|
||||
NSFetchRequest * fetchRequest = [User getFetchRequestBySearchInput:self.searchString];
|
||||
|
||||
fetchRequest.fetchLimit = self.limit;
|
||||
fetchRequest.fetchOffset = self.offset;
|
||||
|
||||
NSError *error;
|
||||
NSArray * oldObjects = [context executeFetchRequest:fetchRequest error:&error];
|
||||
|
||||
NSArray * arrayToIterate = [oldObjects copy];
|
||||
|
||||
if (error) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Error"
|
||||
message:error.localizedFailureReason ?: error.localizedDescription
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil, nil];
|
||||
[alertView show];
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
for (User *user in arrayToIterate)
|
||||
{
|
||||
NSArray *filteredArray = [data filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"user.id == %@" argumentArray:@[user.userId]]];
|
||||
if (filteredArray.count == 0) {
|
||||
// This User no longer exists
|
||||
[context deleteObject:user];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -212,13 +212,11 @@ NSString *const kSelectorWithStoryboardId = @"selectorWithStoryboardId";
|
||||
mutableRightOptions = [rightOptions mutableCopy];
|
||||
[mutableRightOptions removeObjectAtIndex:1];
|
||||
leftRightSelectorOption = [XLFormLeftRightSelectorOption formLeftRightSelectorOptionWithLeftValue:[XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"] httpParameterKey:@"option_2" rightOptions:mutableRightOptions];
|
||||
leftRightSelectorOption.leftValueChangePolicy = XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseFirstOption;
|
||||
[leftRightSelectorOptions addObject:leftRightSelectorOption];
|
||||
|
||||
mutableRightOptions = [rightOptions mutableCopy];
|
||||
[mutableRightOptions removeObjectAtIndex:2];
|
||||
leftRightSelectorOption = [XLFormLeftRightSelectorOption formLeftRightSelectorOptionWithLeftValue:[XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Option 3"] httpParameterKey:@"option_3" rightOptions:mutableRightOptions];
|
||||
leftRightSelectorOption.leftValueChangePolicy = XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseLastOption;
|
||||
[leftRightSelectorOptions addObject:leftRightSelectorOption];
|
||||
|
||||
mutableRightOptions = [rightOptions mutableCopy];
|
||||
@@ -319,6 +317,34 @@ NSString *const kSelectorWithStoryboardId = @"selectorWithStoryboardId";
|
||||
row.action.viewControllerClass = [CustomSelectorsFormViewController class];
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"Disabled & Required Selectors"];
|
||||
[form addFormSection:section];
|
||||
|
||||
|
||||
|
||||
// Disabled Selector Push
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorPushDisabled rowType:XLFormRowDescriptorTypeSelectorPush title:@"Push"];
|
||||
row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"];
|
||||
row.disabled = @YES;
|
||||
[section addFormRow:row];
|
||||
|
||||
|
||||
|
||||
// --------- Disabled Selector Action Sheet
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorActionSheetDisabled rowType:XLFormRowDescriptorTypeSelectorActionSheet title:@"Sheet"];
|
||||
row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Option 3"];
|
||||
row.disabled = @YES;
|
||||
[section addFormRow:row];
|
||||
|
||||
// --------- Disabled Selector Left Right
|
||||
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorLeftRightDisabled rowType:XLFormRowDescriptorTypeSelectorLeftRight title:@"Left Right"];
|
||||
row.leftRightSelectorLeftOptionSelected = [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"];
|
||||
row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(3) displayText:@"Right Option 4"];
|
||||
row.disabled = @YES;
|
||||
[section addFormRow:row];
|
||||
|
||||
|
||||
// --------- Selector definition types
|
||||
|
||||
@@ -334,8 +360,8 @@ NSString *const kSelectorWithStoryboardId = @"selectorWithStoryboardId";
|
||||
[section addFormRow:row];
|
||||
|
||||
// selector with SegueId
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorWithSegueId rowType:XLFormRowDescriptorTypeSelectorPush title:@"Selector with Segue Identifier"];
|
||||
row.action.formSegueIdentifier = @"MapViewControllerSegue";
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorWithSegueClass rowType:XLFormRowDescriptorTypeSelectorPush title:@"Selector with Segue Idenfifier"];
|
||||
row.action.formSegueIdenfifier = @"MapViewControllerSegue";
|
||||
row.valueTransformer = [CLLocationValueTrasformer class];
|
||||
row.value = [[CLLocation alloc] initWithLatitude:-33 longitude:-56];
|
||||
[section addFormRow:row];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="p4n-1v-pzo">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="p4n-1v-pzo">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Navigation Controller-->
|
||||
@@ -13,7 +13,6 @@
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="SNt-hk-N3V">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</navigationBar>
|
||||
<nil name="viewControllers"/>
|
||||
<connections>
|
||||
@@ -33,12 +32,10 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="HPb-Nx-E1G"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="wpr-wE-9nj">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
|
||||
<navigationItem key="navigationItem" id="Hf0-cB-ORN"/>
|
||||
<connections>
|
||||
<segue destination="WMh-VN-FWi" kind="push" identifier="MapViewControllerSegue" id="wAD-tS-AFZ"/>
|
||||
@@ -62,11 +59,9 @@
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="JY7-WL-SnH">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="JY7-WL-SnH" firstAttribute="leading" secondItem="tun-QW-CGC" secondAttribute="leading" id="bSe-SV-rx6"/>
|
||||
@@ -98,11 +93,9 @@
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="Lxj-Sb-kC6">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Lxj-Sb-kC6" firstAttribute="top" secondItem="kOR-67-djF" secondAttribute="bottom" id="PT1-Xo-3Ql"/>
|
||||
@@ -136,12 +129,10 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="scM-da-Sg0"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="hrV-fb-58s">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
|
||||
<navigationItem key="navigationItem" id="RJB-cz-SnF"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Fvo-wr-5Ca" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
@@ -162,11 +153,9 @@
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="Fty-3j-BeF">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="xtJ-Wo-mhU" firstAttribute="top" secondItem="Fty-3j-BeF" secondAttribute="bottom" id="CbV-4f-RzP"/>
|
||||
@@ -195,12 +184,10 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="Lsg-dH-McH"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="6EZ-O7-FjX">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
|
||||
<navigationItem key="navigationItem" id="Lsd-xH-7IN"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="rZL-10-YZn" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
@@ -216,12 +203,10 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="CTu-Y5-7Qw"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="bNj-SD-83w">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
|
||||
<navigationItem key="navigationItem" id="Buo-Af-6Q1"/>
|
||||
<connections>
|
||||
<segue destination="WMh-VN-FWi" kind="push" identifier="MapViewControllerSegue" id="Mtw-x2-E0b"/>
|
||||
@@ -240,12 +225,10 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="cgQ-Vs-ICN"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="JjC-E5-SyY">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
|
||||
<navigationItem key="navigationItem" id="BjG-Bq-0lD"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="LmS-YR-mFY" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
@@ -260,7 +243,6 @@
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="fO3-V7-XXu">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</navigationBar>
|
||||
<nil name="viewControllers"/>
|
||||
<connections>
|
||||
@@ -269,7 +251,7 @@
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="eqB-vl-BzH" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="586" y="-654"/>
|
||||
<point key="canvasLocation" x="588" y="-635"/>
|
||||
</scene>
|
||||
<!--Basic Predicate View Controller-->
|
||||
<scene sceneID="pD4-sm-x3a">
|
||||
@@ -280,56 +262,23 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="2b4-gN-85p"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="NZg-t1-g19">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
|
||||
<navigationItem key="navigationItem" id="1lh-jZ-lIV"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Tlw-q2-pcu" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-159" y="1151"/>
|
||||
</scene>
|
||||
<!--Users Table View Controller-->
|
||||
<scene sceneID="lGi-0L-kUk">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="UsersTableViewController" automaticallyAdjustsScrollViewInsets="NO" definesPresentationContext="YES" modalPresentationStyle="currentContext" id="MON-q2-1DB" customClass="UsersTableViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="at2-Ds-EcY"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="uVG-bI-IMr"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="sMH-hT-NCg">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView autoresizesSubviews="NO" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="fLo-Gu-rqr">
|
||||
<rect key="frame" x="0.0" y="20" width="320" height="548"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="uVG-bI-IMr" firstAttribute="top" secondItem="fLo-Gu-rqr" secondAttribute="bottom" id="25A-HG-wek"/>
|
||||
<constraint firstItem="fLo-Gu-rqr" firstAttribute="top" secondItem="at2-Ds-EcY" secondAttribute="bottom" id="3N4-a2-LLf"/>
|
||||
<constraint firstAttribute="trailing" secondItem="fLo-Gu-rqr" secondAttribute="trailing" id="IXV-p6-sAw"/>
|
||||
<constraint firstItem="fLo-Gu-rqr" firstAttribute="leading" secondItem="sMH-hT-NCg" secondAttribute="leading" id="Xjr-w6-wlu"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="LIq-iZ-ILx"/>
|
||||
<connections>
|
||||
<outlet property="tableView" destination="fLo-Gu-rqr" id="2ES-0n-eVG"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="flB-2M-8zS" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1346" y="1178"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||
</simulatedMetricsContainer>
|
||||
<inferredMetricsTieBreakers>
|
||||
<segue reference="Mtw-x2-E0b"/>
|
||||
<segue reference="wAD-tS-AFZ"/>
|
||||
</inferredMetricsTieBreakers>
|
||||
</document>
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
#import "XLForm.h"
|
||||
#import "ValidationExamplesFormViewController.h"
|
||||
|
||||
@interface ValidationExamplesFormViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation ValidationExamplesFormViewController
|
||||
|
||||
NSString * const kValidationName = @"kName";
|
||||
@@ -89,7 +93,7 @@ NSString * const kValidationInteger = @"kInteger";
|
||||
|
||||
// number Section
|
||||
section = [XLFormSectionDescriptor formSectionWithTitle:@"Validation Numbers"];
|
||||
section.footerTitle = @"greater than 50 and less than 100";
|
||||
section.footerTitle = @"grather than 50 and less than 100";
|
||||
[formDescriptor addFormSection:section];
|
||||
|
||||
// Integer
|
||||
@@ -97,7 +101,7 @@ NSString * const kValidationInteger = @"kInteger";
|
||||
[row.cellConfigAtConfigure setObject:@"Required..." forKey:@"textField.placeholder"];
|
||||
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
|
||||
row.required = YES;
|
||||
[row addValidator:[XLFormRegexValidator formRegexValidatorWithMsg:@"greater than 50 and less than 100" regex:@"^([5-9][0-9]|100)$"]];
|
||||
[row addValidator:[XLFormRegexValidator formRegexValidatorWithMsg:@"grather than 50 and less than 100" regex:@"^([5-9][0-9]|100)$"]];
|
||||
[section addFormRow:row];
|
||||
|
||||
self.form = formDescriptor;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// XLFormInlineSegmentedCell.h
|
||||
// XLForm
|
||||
//
|
||||
// Created by mathias Claassen on 16/12/15.
|
||||
// Copyright © 2015 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#import <XLForm/XLForm.h>
|
||||
|
||||
extern NSString * const XLFormRowDescriptorTypeSegmentedInline;
|
||||
extern NSString * const XLFormRowDescriptorTypeSegmentedControl;
|
||||
|
||||
@interface XLFormInlineSegmentedCell : XLFormBaseCell
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface XLFormInlineSegmentedControl : XLFormBaseCell<XLFormInlineRowDescriptorCell>
|
||||
|
||||
@property (strong, nonatomic) UISegmentedControl* segmentedControl;
|
||||
@end
|
||||
@@ -1,194 +0,0 @@
|
||||
//
|
||||
// XLFormInlineSegmentedCell.m
|
||||
// XLForm
|
||||
//
|
||||
// Created by mathias Claassen on 16/12/15.
|
||||
// Copyright © 2015 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XLFormInlineSegmentedCell.h"
|
||||
|
||||
NSString * const XLFormRowDescriptorTypeSegmentedInline = @"XLFormRowDescriptorTypeSegmentedInline";
|
||||
NSString * const XLFormRowDescriptorTypeSegmentedControl = @"XLFormRowDescriptorTypeSegmentedControl";
|
||||
|
||||
@implementation XLFormInlineSegmentedCell
|
||||
|
||||
+(void)load
|
||||
{
|
||||
[XLFormViewController.cellClassesForRowDescriptorTypes setObject:[XLFormInlineSegmentedCell class] forKey:XLFormRowDescriptorTypeSegmentedInline];
|
||||
[XLFormViewController.inlineRowDescriptorTypesForRowDescriptorTypes setObject:XLFormRowDescriptorTypeSegmentedControl forKey:XLFormRowDescriptorTypeSegmentedInline];
|
||||
}
|
||||
|
||||
- (BOOL)canBecomeFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(BOOL)becomeFirstResponder
|
||||
{
|
||||
if (self.isFirstResponder){
|
||||
return [super becomeFirstResponder];
|
||||
}
|
||||
BOOL result = [super becomeFirstResponder];
|
||||
if (result){
|
||||
XLFormRowDescriptor * inlineRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:[XLFormViewController inlineRowDescriptorTypesForRowDescriptorTypes][self.rowDescriptor.rowType]];
|
||||
UITableViewCell<XLFormDescriptorCell> * cell = [inlineRowDescriptor cellForFormController:self.formViewController];
|
||||
NSAssert([cell conformsToProtocol:@protocol(XLFormInlineRowDescriptorCell)], @"inline cell must conform to XLFormInlineRowDescriptorCell");
|
||||
UITableViewCell<XLFormInlineRowDescriptorCell> * inlineCell = (UITableViewCell<XLFormInlineRowDescriptorCell> *)cell;
|
||||
inlineCell.inlineRowDescriptor = self.rowDescriptor;
|
||||
[self.rowDescriptor.sectionDescriptor addFormRow:inlineRowDescriptor afterRow:self.rowDescriptor];
|
||||
[self.formViewController ensureRowIsVisible:inlineRowDescriptor];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
-(BOOL)resignFirstResponder
|
||||
{
|
||||
if (![self isFirstResponder]) {
|
||||
return [super resignFirstResponder];
|
||||
}
|
||||
NSIndexPath * selectedRowPath = [self.formViewController.form indexPathOfFormRow:self.rowDescriptor];
|
||||
NSIndexPath * nextRowPath = [NSIndexPath indexPathForRow:selectedRowPath.row + 1 inSection:selectedRowPath.section];
|
||||
XLFormRowDescriptor * nextFormRow = [self.formViewController.form formRowAtIndex:nextRowPath];
|
||||
XLFormSectionDescriptor * formSection = [self.formViewController.form.formSections objectAtIndex:nextRowPath.section];
|
||||
BOOL result = [super resignFirstResponder];
|
||||
if (result) {
|
||||
[formSection removeFormRow:nextFormRow];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - XLFormDescriptorCell
|
||||
|
||||
-(void)configure
|
||||
{
|
||||
[super configure];
|
||||
}
|
||||
|
||||
-(void)update
|
||||
{
|
||||
[super update];
|
||||
self.accessoryType = UITableViewCellAccessoryNone;
|
||||
self.editingAccessoryType = UITableViewCellAccessoryNone;
|
||||
[self.textLabel setText:self.rowDescriptor.title];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.detailTextLabel.text = [self valueDisplayText];
|
||||
}
|
||||
|
||||
-(BOOL)formDescriptorCellCanBecomeFirstResponder
|
||||
{
|
||||
return !(self.rowDescriptor.isDisabled);
|
||||
}
|
||||
|
||||
-(BOOL)formDescriptorCellBecomeFirstResponder
|
||||
{
|
||||
|
||||
if ([self isFirstResponder]){
|
||||
[self resignFirstResponder];
|
||||
return NO;
|
||||
}
|
||||
return [self becomeFirstResponder];
|
||||
}
|
||||
|
||||
-(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
|
||||
{
|
||||
[controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Helpers
|
||||
|
||||
-(NSString *)valueDisplayText
|
||||
{
|
||||
return (self.rowDescriptor.value ? [self.rowDescriptor.value displayText] : self.rowDescriptor.noValueDisplayText);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
@implementation XLFormInlineSegmentedControl
|
||||
|
||||
@synthesize segmentedControl = _segmentedControl;
|
||||
@synthesize inlineRowDescriptor = _inlineRowDescriptor;
|
||||
|
||||
|
||||
+(void)load
|
||||
{
|
||||
[XLFormViewController.cellClassesForRowDescriptorTypes setObject:[XLFormInlineSegmentedControl class] forKey:XLFormRowDescriptorTypeSegmentedControl];
|
||||
}
|
||||
|
||||
-(void)configure
|
||||
{
|
||||
[super configure];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.segmentedControl];
|
||||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[segmentedControl]-|"
|
||||
options:NSLayoutFormatAlignAllCenterY
|
||||
metrics:0
|
||||
views:@{@"segmentedControl": self.segmentedControl}]];
|
||||
[self.segmentedControl addTarget:self action:@selector(valueChanged) forControlEvents:UIControlEventValueChanged];
|
||||
}
|
||||
|
||||
-(void)update
|
||||
{
|
||||
[super update];
|
||||
[self updateSegmentedControl];
|
||||
self.segmentedControl.selectedSegmentIndex = [self selectedIndex];
|
||||
self.segmentedControl.enabled = !self.rowDescriptor.isDisabled;
|
||||
}
|
||||
|
||||
-(UISegmentedControl *)segmentedControl
|
||||
{
|
||||
if (_segmentedControl) return _segmentedControl;
|
||||
|
||||
_segmentedControl = [UISegmentedControl autolayoutView];
|
||||
[_segmentedControl setContentHuggingPriority:500 forAxis:UILayoutConstraintAxisHorizontal];
|
||||
return _segmentedControl;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Action
|
||||
|
||||
-(void)valueChanged
|
||||
{
|
||||
self.inlineRowDescriptor.value = [self.inlineRowDescriptor.selectorOptions objectAtIndex:self.segmentedControl.selectedSegmentIndex];
|
||||
[self.formViewController updateFormRow:self.inlineRowDescriptor];
|
||||
}
|
||||
|
||||
#pragma mark - Helper
|
||||
|
||||
-(NSArray *)getItems
|
||||
{
|
||||
NSMutableArray * result = [[NSMutableArray alloc] init];
|
||||
for (id option in self.inlineRowDescriptor.selectorOptions)
|
||||
[result addObject:[option displayText]];
|
||||
return result;
|
||||
}
|
||||
|
||||
-(void)updateSegmentedControl
|
||||
{
|
||||
[self.segmentedControl removeAllSegments];
|
||||
|
||||
[[self getItems] enumerateObjectsUsingBlock:^(id object, NSUInteger idex, __unused BOOL *stop){
|
||||
[self.segmentedControl insertSegmentWithTitle:[object displayText] atIndex:idex animated:NO];
|
||||
}];
|
||||
}
|
||||
|
||||
-(NSInteger)selectedIndex
|
||||
{
|
||||
XLFormRowDescriptor * formRow = self.inlineRowDescriptor ?: self.rowDescriptor;
|
||||
if (formRow.value){
|
||||
for (id option in formRow.selectorOptions){
|
||||
if ([[option valueData] isEqual:[formRow.value valueData]]){
|
||||
return [formRow.selectorOptions indexOfObject:option];
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,14 +1,10 @@
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '8.0'
|
||||
|
||||
target 'XLForm' do
|
||||
platform :ios, '7.0'
|
||||
|
||||
pod 'XLForm', :path => '../../'
|
||||
|
||||
#Following pods are used for custom row examples
|
||||
pod 'AFNetworking', '~> 2.0', :inhibit_warnings => true
|
||||
pod 'XLData', :git => 'https://github.com/xmartlabs/XLData.git', :commit => '1f9019b56242a2019c7f7e11ec4ef823c397ebcf', :inhibit_warnings => true
|
||||
pod 'XLDataLoader', '~> 1.1', :inhibit_warnings => true
|
||||
pod 'JVFloatLabeledTextField', '1.0.2', :inhibit_warnings => true
|
||||
pod 'AXRatingView', '1.0.3', :inhibit_warnings => true
|
||||
pod 'SHSPhoneComponent'
|
||||
end
|
||||
@@ -1,78 +0,0 @@
|
||||
PODS:
|
||||
- AFNetworking (2.6.3):
|
||||
- AFNetworking/NSURLConnection (= 2.6.3)
|
||||
- AFNetworking/NSURLSession (= 2.6.3)
|
||||
- AFNetworking/Reachability (= 2.6.3)
|
||||
- AFNetworking/Security (= 2.6.3)
|
||||
- AFNetworking/Serialization (= 2.6.3)
|
||||
- AFNetworking/UIKit (= 2.6.3)
|
||||
- AFNetworking/NSURLConnection (2.6.3):
|
||||
- AFNetworking/Reachability
|
||||
- AFNetworking/Security
|
||||
- AFNetworking/Serialization
|
||||
- AFNetworking/NSURLSession (2.6.3):
|
||||
- AFNetworking/Reachability
|
||||
- AFNetworking/Security
|
||||
- AFNetworking/Serialization
|
||||
- AFNetworking/Reachability (2.6.3)
|
||||
- AFNetworking/Security (2.6.3)
|
||||
- AFNetworking/Serialization (2.6.3)
|
||||
- AFNetworking/UIKit (2.6.3):
|
||||
- AFNetworking/NSURLConnection
|
||||
- AFNetworking/NSURLSession
|
||||
- AXRatingView (1.0.3)
|
||||
- JVFloatLabeledTextField (1.0.2)
|
||||
- SHSPhoneComponent (2.15)
|
||||
- XLData (2.0.0):
|
||||
- XLData/Core (= 2.0.0)
|
||||
- XLData/CoreData (= 2.0.0)
|
||||
- XLData/CoreRemote (= 2.0.0)
|
||||
- XLData/DataStore (= 2.0.0)
|
||||
- XLData/RemoteCoreData (= 2.0.0)
|
||||
- XLData/RemoteDataStore (= 2.0.0)
|
||||
- XLData/Core (2.0.0)
|
||||
- XLData/CoreData (2.0.0):
|
||||
- XLData/Core
|
||||
- XLData/CoreRemote (2.0.0):
|
||||
- AFNetworking (~> 2.0)
|
||||
- XLData/DataStore (2.0.0):
|
||||
- XLData/Core
|
||||
- XLData/RemoteCoreData (2.0.0):
|
||||
- XLData/CoreData
|
||||
- XLData/CoreRemote
|
||||
- XLData/RemoteDataStore (2.0.0):
|
||||
- XLData/CoreRemote
|
||||
- XLData/DataStore
|
||||
- XLForm (3.1.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- AFNetworking (~> 2.0)
|
||||
- AXRatingView (= 1.0.3)
|
||||
- JVFloatLabeledTextField (= 1.0.2)
|
||||
- SHSPhoneComponent
|
||||
- XLData (from `https://github.com/xmartlabs/XLData.git`, commit `1f9019b56242a2019c7f7e11ec4ef823c397ebcf`)
|
||||
- XLForm (from `../../`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
XLData:
|
||||
:commit: 1f9019b56242a2019c7f7e11ec4ef823c397ebcf
|
||||
:git: https://github.com/xmartlabs/XLData.git
|
||||
XLForm:
|
||||
:path: ../../
|
||||
|
||||
CHECKOUT OPTIONS:
|
||||
XLData:
|
||||
:commit: 1f9019b56242a2019c7f7e11ec4ef823c397ebcf
|
||||
:git: https://github.com/xmartlabs/XLData.git
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
|
||||
AXRatingView: ccaadc1bbda99a4b7e1d556059482d2b933a9f4e
|
||||
JVFloatLabeledTextField: 58a3a32cfb800e5b224f676987e7c13abf50a14d
|
||||
SHSPhoneComponent: 4cec0653a150ad63cbc52b0c8b29ce2d3c9c26f0
|
||||
XLData: df725c6179e2e0c80bf56a1ecad9afd169707a6d
|
||||
XLForm: 6bb3c20857e2983cf494cb8b4d666c2a24673d5e
|
||||
|
||||
PODFILE CHECKSUM: 80615792e859be64c95add3bb57c1596234faf95
|
||||
|
||||
COCOAPODS: 1.0.0
|
||||
@@ -27,33 +27,36 @@
|
||||
28815E2E1A8589F600B674D2 /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28815E2D1A8589F600B674D2 /* MapViewController.xib */; };
|
||||
28A7661F193248BD00D69546 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28A7661E193248BD00D69546 /* CoreData.framework */; };
|
||||
28A76625193251E500D69546 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A76624193251E500D69546 /* AppDelegate.m */; };
|
||||
28A7662E1932E98A00D69546 /* HTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A7662D1932E98A00D69546 /* HTTPSessionManager.m */; };
|
||||
28A7663B1932EA1F00D69546 /* UserLocalDataLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766361932EA1F00D69546 /* UserLocalDataLoader.m */; };
|
||||
28A7663C1932EA1F00D69546 /* UserRemoteDataLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766381932EA1F00D69546 /* UserRemoteDataLoader.m */; };
|
||||
28A766451932EC9C00D69546 /* CoreDataStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766401932EC9C00D69546 /* CoreDataStore.m */; };
|
||||
28A766461932EC9C00D69546 /* User+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766421932EC9C00D69546 /* User+Additions.m */; };
|
||||
28A7664A1932ED3400D69546 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 28A766481932ED3400D69546 /* Model.xcdatamodeld */; };
|
||||
28A7664D1932EE0B00D69546 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A7664C1932EE0B00D69546 /* User.m */; };
|
||||
28A766551932F22400D69546 /* UsersTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766541932F22400D69546 /* UsersTableViewController.m */; };
|
||||
28A7665E1932F61100D69546 /* DynamicSelectorsFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A7665D1932F61100D69546 /* DynamicSelectorsFormViewController.m */; };
|
||||
28A8083E190D9083009D77F8 /* iPhoneStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 28A8083D190D9083009D77F8 /* iPhoneStoryboard.storyboard */; };
|
||||
28A85D5918E346C100E81A26 /* XLFormImageSelectorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A85D5818E346C100E81A26 /* XLFormImageSelectorCell.m */; };
|
||||
28DBB04118D76FDC00FB8A8B /* MultivaluedFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28DBB04018D76FDC00FB8A8B /* MultivaluedFormViewController.m */; };
|
||||
28F89F2E1AA4EA5600E90218 /* ValidationExamplesFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28F89F2D1AA4EA5600E90218 /* ValidationExamplesFormViewController.m */; };
|
||||
2CA9A3FC06E94345A2FDE415 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F6DF43B7BBF44F72A4493E8E /* libPods.a */; };
|
||||
3C0357F01AB0D82300200C8A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C0357EF1AB0D82300200C8A /* Images.xcassets */; };
|
||||
3C3B01D51AB741EF0027CD45 /* XLFormRatingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01D31AB741EF0027CD45 /* XLFormRatingCell.m */; };
|
||||
3C3B01D61AB741EF0027CD45 /* XLFormRatingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C3B01D41AB741EF0027CD45 /* XLFormRatingCell.xib */; };
|
||||
3C3B01DA1AB7497D0027CD45 /* XLFormWeekDaysCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01D81AB7497D0027CD45 /* XLFormWeekDaysCell.m */; };
|
||||
3C3B01DB1AB7497D0027CD45 /* XLFormWeekDaysCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C3B01D91AB7497D0027CD45 /* XLFormWeekDaysCell.xib */; };
|
||||
3C3B01E21AB7499A0027CD45 /* XLRatingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01E01AB7499A0027CD45 /* XLRatingView.m */; };
|
||||
3C3B01F01AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01EF1AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m */; };
|
||||
3CDAFC7A1AB0AFA4000F75B6 /* CustomRowsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CDAFC791AB0AFA4000F75B6 /* CustomRowsViewController.m */; };
|
||||
5BB6B032D80344C9E7D956CD /* libPods-XLForm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19383D268EF8024CB33FCCA4 /* libPods-XLForm.a */; };
|
||||
66B6266E1AE0055100007886 /* DateAndTimeValueTrasformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 66B6266D1AE0055100007886 /* DateAndTimeValueTrasformer.m */; };
|
||||
BF01E9281C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BF01E9271C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m */; };
|
||||
BF9DB1D51AE0436600B985E7 /* BlogExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9DB1D21AE0436600B985E7 /* BlogExampleViewController.m */; };
|
||||
BF9DB1D61AE0436600B985E7 /* PredicateFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9DB1D41AE0436600B985E7 /* PredicateFormViewController.m */; };
|
||||
BFA5F4B11BB48F8E00D045BD /* XLFormRatingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C3B01D41AB741EF0027CD45 /* XLFormRatingCell.xib */; };
|
||||
BFE91AFB1AE159B200DE5231 /* BasicPredicateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BFE91AFA1AE159B200DE5231 /* BasicPredicateViewController.m */; };
|
||||
D51B8B2C19126664008C0478 /* XLFormCustomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D51B8B2B19126664008C0478 /* XLFormCustomCell.m */; };
|
||||
DEA6EF911B57D6CC000F4893 /* HTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DEA6EF901B57D6CC000F4893 /* HTTPSessionManager.m */; };
|
||||
DEB8235C1AD5529A00AF9FE2 /* FormattersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DEB8235B1AD5529A00AF9FE2 /* FormattersViewController.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
19383D268EF8024CB33FCCA4 /* libPods-XLForm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-XLForm.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
281E5BE719538F4A006D93C5 /* CLLocationValueTrasformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLLocationValueTrasformer.h; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/CLLocationValueTrasformer.h; sourceTree = "<group>"; };
|
||||
281E5BE819538F4A006D93C5 /* CLLocationValueTrasformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLLocationValueTrasformer.m; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/CLLocationValueTrasformer.m; sourceTree = "<group>"; };
|
||||
282EB27A1AB5FF33004A736F /* AccessoryViewFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessoryViewFormViewController.h; path = Examples/AccessoryViews/AccessoryViewFormViewController.h; sourceTree = "<group>"; };
|
||||
@@ -89,6 +92,19 @@
|
||||
28815E2D1A8589F600B674D2 /* MapViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MapViewController.xib; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/MapViewController.xib; sourceTree = "<group>"; };
|
||||
28A7661E193248BD00D69546 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
28A76624193251E500D69546 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Examples/AppDelegate.m; sourceTree = "<group>"; };
|
||||
28A7662C1932E98A00D69546 /* HTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPSessionManager.h; path = Examples/Selectors/Helpers/HTTPSessionManager.h; sourceTree = "<group>"; };
|
||||
28A7662D1932E98A00D69546 /* HTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPSessionManager.m; path = Examples/Selectors/Helpers/HTTPSessionManager.m; sourceTree = "<group>"; };
|
||||
28A766351932EA1F00D69546 /* UserLocalDataLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserLocalDataLoader.h; sourceTree = "<group>"; };
|
||||
28A766361932EA1F00D69546 /* UserLocalDataLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserLocalDataLoader.m; sourceTree = "<group>"; };
|
||||
28A766371932EA1F00D69546 /* UserRemoteDataLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserRemoteDataLoader.h; sourceTree = "<group>"; };
|
||||
28A766381932EA1F00D69546 /* UserRemoteDataLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserRemoteDataLoader.m; sourceTree = "<group>"; };
|
||||
28A7663F1932EC9C00D69546 /* CoreDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreDataStore.h; sourceTree = "<group>"; };
|
||||
28A766401932EC9C00D69546 /* CoreDataStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreDataStore.m; sourceTree = "<group>"; };
|
||||
28A766411932EC9C00D69546 /* User+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "User+Additions.h"; sourceTree = "<group>"; };
|
||||
28A766421932EC9C00D69546 /* User+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "User+Additions.m"; sourceTree = "<group>"; };
|
||||
28A766491932ED3400D69546 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
|
||||
28A7664B1932EE0B00D69546 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
|
||||
28A7664C1932EE0B00D69546 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
|
||||
28A766531932F22400D69546 /* UsersTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UsersTableViewController.h; path = Examples/Selectors/DynamicSelector/UsersTableViewController.h; sourceTree = "<group>"; };
|
||||
28A766541932F22400D69546 /* UsersTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UsersTableViewController.m; path = Examples/Selectors/DynamicSelector/UsersTableViewController.m; sourceTree = "<group>"; };
|
||||
28A7665C1932F61100D69546 /* DynamicSelectorsFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicSelectorsFormViewController.h; path = Examples/Selectors/DynamicSelector/DynamicSelectorsFormViewController.h; sourceTree = "<group>"; };
|
||||
@@ -113,12 +129,10 @@
|
||||
3C3B01EF1AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FloatLabeledTextFieldCell.m; path = Examples/CustomRows/FloatLabeledTextField/FloatLabeledTextFieldCell.m; sourceTree = "<group>"; };
|
||||
3CDAFC781AB0AFA4000F75B6 /* CustomRowsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomRowsViewController.h; path = Examples/CustomRows/CustomRowsViewController.h; sourceTree = "<group>"; };
|
||||
3CDAFC791AB0AFA4000F75B6 /* CustomRowsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CustomRowsViewController.m; path = Examples/CustomRows/CustomRowsViewController.m; sourceTree = "<group>"; };
|
||||
5F6FC67A75254B60005DC716 /* Pods-XLForm.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XLForm.debug.xcconfig"; path = "Pods/Target Support Files/Pods-XLForm/Pods-XLForm.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
66B6266C1AE0055100007886 /* DateAndTimeValueTrasformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DateAndTimeValueTrasformer.h; path = Examples/Dates/DateAndTimeValueTrasformer.h; sourceTree = "<group>"; };
|
||||
66B6266D1AE0055100007886 /* DateAndTimeValueTrasformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DateAndTimeValueTrasformer.m; path = Examples/Dates/DateAndTimeValueTrasformer.m; sourceTree = "<group>"; };
|
||||
B98C1213E7C714A861219C81 /* Pods-XLForm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XLForm.release.xcconfig"; path = "Pods/Target Support Files/Pods-XLForm/Pods-XLForm.release.xcconfig"; sourceTree = "<group>"; };
|
||||
BF01E9261C21F0BB00BDE045 /* XLFormInlineSegmentedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLFormInlineSegmentedCell.h; path = "Inline Segmented/XLFormInlineSegmentedCell.h"; sourceTree = "<group>"; };
|
||||
BF01E9271C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLFormInlineSegmentedCell.m; path = "Inline Segmented/XLFormInlineSegmentedCell.m"; sourceTree = "<group>"; };
|
||||
7B0D2D6A86E2A41ED22E8A35 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
976A33EE62A018A7257B4878 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
|
||||
BF9DB1D11AE0436600B985E7 /* BlogExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlogExampleViewController.h; path = Examples/PredicateExamples/BlogExampleViewController.h; sourceTree = SOURCE_ROOT; };
|
||||
BF9DB1D21AE0436600B985E7 /* BlogExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BlogExampleViewController.m; path = Examples/PredicateExamples/BlogExampleViewController.m; sourceTree = SOURCE_ROOT; };
|
||||
BF9DB1D31AE0436600B985E7 /* PredicateFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PredicateFormViewController.h; path = Examples/PredicateExamples/PredicateFormViewController.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -127,10 +141,7 @@
|
||||
BFE91AFA1AE159B200DE5231 /* BasicPredicateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BasicPredicateViewController.m; path = Examples/PredicateExamples/BasicPredicateViewController.m; sourceTree = SOURCE_ROOT; };
|
||||
D51B8B2A19126664008C0478 /* XLFormCustomCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLFormCustomCell.h; path = Examples/Others/CustomCells/XLFormCustomCell.h; sourceTree = "<group>"; };
|
||||
D51B8B2B19126664008C0478 /* XLFormCustomCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLFormCustomCell.m; path = Examples/Others/CustomCells/XLFormCustomCell.m; sourceTree = "<group>"; };
|
||||
DEA6EF8F1B57D6CC000F4893 /* HTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPSessionManager.h; path = Examples/Selectors/HTTPSessionManager.h; sourceTree = "<group>"; };
|
||||
DEA6EF901B57D6CC000F4893 /* HTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPSessionManager.m; path = Examples/Selectors/HTTPSessionManager.m; sourceTree = "<group>"; };
|
||||
DEB8235A1AD5529A00AF9FE2 /* FormattersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormattersViewController.h; sourceTree = "<group>"; };
|
||||
DEB8235B1AD5529A00AF9FE2 /* FormattersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FormattersViewController.m; sourceTree = "<group>"; };
|
||||
F6DF43B7BBF44F72A4493E8E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -142,13 +153,22 @@
|
||||
2850C5FE18D0F706002B7D0A /* CoreGraphics.framework in Frameworks */,
|
||||
2850C60018D0F706002B7D0A /* UIKit.framework in Frameworks */,
|
||||
2850C5FC18D0F706002B7D0A /* Foundation.framework in Frameworks */,
|
||||
5BB6B032D80344C9E7D956CD /* libPods-XLForm.a in Frameworks */,
|
||||
2CA9A3FC06E94345A2FDE415 /* libPods.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
15E61D225B0D27FAB51BDD90 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7B0D2D6A86E2A41ED22E8A35 /* Pods.debug.xcconfig */,
|
||||
976A33EE62A018A7257B4878 /* Pods.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
282C5EEF18D33C1800A5D47C /* Inputs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -203,6 +223,7 @@
|
||||
children = (
|
||||
283B59AF19531DDA000828CD /* CustomSelectors */,
|
||||
28A766521932F1FA00D69546 /* DynamicSelector */,
|
||||
28A7662B1932E92D00D69546 /* Helpers */,
|
||||
2843EB4918D496F600F13E2B /* SelectorsFormViewController.h */,
|
||||
2843EB4A18D496F600F13E2B /* SelectorsFormViewController.m */,
|
||||
);
|
||||
@@ -255,7 +276,7 @@
|
||||
2850C60118D0F706002B7D0A /* XLForm */,
|
||||
2850C5FA18D0F706002B7D0A /* Frameworks */,
|
||||
2850C5F918D0F706002B7D0A /* Products */,
|
||||
B6478577DDCB0DDDD433C572 /* Pods */,
|
||||
15E61D225B0D27FAB51BDD90 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -274,7 +295,7 @@
|
||||
2850C5FB18D0F706002B7D0A /* Foundation.framework */,
|
||||
2850C5FD18D0F706002B7D0A /* CoreGraphics.framework */,
|
||||
2850C5FF18D0F706002B7D0A /* UIKit.framework */,
|
||||
19383D268EF8024CB33FCCA4 /* libPods-XLForm.a */,
|
||||
F6DF43B7BBF44F72A4493E8E /* libPods.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -306,7 +327,6 @@
|
||||
282EB2791AB5FD66004A736F /* AccessoryViews */,
|
||||
3CDAFC741AB0AEE5000F75B6 /* CustomRows */,
|
||||
28F89F2B1AA4E99500E90218 /* Validations */,
|
||||
DEB823591AD5529A00AF9FE2 /* Formatters */,
|
||||
283C6B7A1999BA1B00A5283D /* UICustomization */,
|
||||
28A76624193251E500D69546 /* AppDelegate.m */,
|
||||
28A8083C190D903D009D77F8 /* StoryboardExample */,
|
||||
@@ -335,10 +355,55 @@
|
||||
name = CustomCells;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28A7662B1932E92D00D69546 /* Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28A7663D1932EC9C00D69546 /* Data */,
|
||||
28A766301932EA1F00D69546 /* DataLoaders */,
|
||||
28A7662C1932E98A00D69546 /* HTTPSessionManager.h */,
|
||||
28A7662D1932E98A00D69546 /* HTTPSessionManager.m */,
|
||||
);
|
||||
name = Helpers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28A766301932EA1F00D69546 /* DataLoaders */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28A766351932EA1F00D69546 /* UserLocalDataLoader.h */,
|
||||
28A766361932EA1F00D69546 /* UserLocalDataLoader.m */,
|
||||
28A766371932EA1F00D69546 /* UserRemoteDataLoader.h */,
|
||||
28A766381932EA1F00D69546 /* UserRemoteDataLoader.m */,
|
||||
);
|
||||
name = DataLoaders;
|
||||
path = Examples/Selectors/Helpers/DataLoaders;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28A7663D1932EC9C00D69546 /* Data */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28A7663E1932EC9C00D69546 /* Store */,
|
||||
28A766411932EC9C00D69546 /* User+Additions.h */,
|
||||
28A766421932EC9C00D69546 /* User+Additions.m */,
|
||||
28A766481932ED3400D69546 /* Model.xcdatamodeld */,
|
||||
28A7664B1932EE0B00D69546 /* User.h */,
|
||||
28A7664C1932EE0B00D69546 /* User.m */,
|
||||
);
|
||||
name = Data;
|
||||
path = Examples/Selectors/Helpers/Data;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28A7663E1932EC9C00D69546 /* Store */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28A7663F1932EC9C00D69546 /* CoreDataStore.h */,
|
||||
28A766401932EC9C00D69546 /* CoreDataStore.m */,
|
||||
);
|
||||
path = Store;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28A766521932F1FA00D69546 /* DynamicSelector */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DEA6EF8E1B57D698000F4893 /* SessionManager */,
|
||||
28A7665A1932F55700D69546 /* XLFormRowViewController */,
|
||||
28A7665C1932F61100D69546 /* DynamicSelectorsFormViewController.h */,
|
||||
28A7665D1932F61100D69546 /* DynamicSelectorsFormViewController.m */,
|
||||
@@ -414,7 +479,6 @@
|
||||
3CDAFC741AB0AEE5000F75B6 /* CustomRows */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BF01E9251C21F02D00BDE045 /* Inline Segmented */,
|
||||
3C3B01D01AB741C40027CD45 /* Rating */,
|
||||
3C3B01E31AB74AC10027CD45 /* FloatLabeledTextField */,
|
||||
3C3B01D11AB741CC0027CD45 /* Weekdays */,
|
||||
@@ -424,24 +488,6 @@
|
||||
name = CustomRows;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B6478577DDCB0DDDD433C572 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5F6FC67A75254B60005DC716 /* Pods-XLForm.debug.xcconfig */,
|
||||
B98C1213E7C714A861219C81 /* Pods-XLForm.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BF01E9251C21F02D00BDE045 /* Inline Segmented */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BF01E9261C21F0BB00BDE045 /* XLFormInlineSegmentedCell.h */,
|
||||
BF01E9271C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m */,
|
||||
);
|
||||
name = "Inline Segmented";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BFD5D6F41AD2FFC1006F04FA /* PredicateExamples */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -456,25 +502,6 @@
|
||||
path = Examples/PredicateDisabling;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DEA6EF8E1B57D698000F4893 /* SessionManager */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DEA6EF8F1B57D6CC000F4893 /* HTTPSessionManager.h */,
|
||||
DEA6EF901B57D6CC000F4893 /* HTTPSessionManager.m */,
|
||||
);
|
||||
name = SessionManager;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DEB823591AD5529A00AF9FE2 /* Formatters */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DEB8235A1AD5529A00AF9FE2 /* FormattersViewController.h */,
|
||||
DEB8235B1AD5529A00AF9FE2 /* FormattersViewController.m */,
|
||||
);
|
||||
name = Formatters;
|
||||
path = Examples/Formatters;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -482,12 +509,11 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2850C62418D0F707002B7D0A /* Build configuration list for PBXNativeTarget "XLForm" */;
|
||||
buildPhases = (
|
||||
EBE0335CCC7588D83B89A92A /* 📦 Check Pods Manifest.lock */,
|
||||
0EA9FCE3DA0D444498836D37 /* Check Pods Manifest.lock */,
|
||||
2850C5F418D0F706002B7D0A /* Sources */,
|
||||
2850C5F518D0F706002B7D0A /* Frameworks */,
|
||||
2850C5F618D0F706002B7D0A /* Resources */,
|
||||
32EB30E0A90A4E91864B1D3C /* 📦 Embed Pods Frameworks */,
|
||||
DE3D12F5596780A66C6C3D4A /* 📦 Copy Pods Resources */,
|
||||
CFE72E068B5F4D9BB45FB757 /* Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -504,7 +530,7 @@
|
||||
2850C5F018D0F706002B7D0A /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0700;
|
||||
LastUpgradeCheck = 0510;
|
||||
ORGANIZATIONNAME = Xmartlabs;
|
||||
};
|
||||
buildConfigurationList = 2850C5F318D0F706002B7D0A /* Build configuration list for PBXProject "XLForm" */;
|
||||
@@ -531,10 +557,10 @@
|
||||
files = (
|
||||
28468EA718EF594900DBB015 /* Localizable.strings in Resources */,
|
||||
2850C60618D0F706002B7D0A /* InfoPlist.strings in Resources */,
|
||||
BFA5F4B11BB48F8E00D045BD /* XLFormRatingCell.xib in Resources */,
|
||||
28815E2E1A8589F600B674D2 /* MapViewController.xib in Resources */,
|
||||
3C0357F01AB0D82300200C8A /* Images.xcassets in Resources */,
|
||||
3C3B01DB1AB7497D0027CD45 /* XLFormWeekDaysCell.xib in Resources */,
|
||||
3C3B01D61AB741EF0027CD45 /* XLFormRatingCell.xib in Resources */,
|
||||
28A8083E190D9083009D77F8 /* iPhoneStoryboard.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -542,44 +568,14 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
32EB30E0A90A4E91864B1D3C /* 📦 Embed Pods Frameworks */ = {
|
||||
0EA9FCE3DA0D444498836D37 /* Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XLForm/Pods-XLForm-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
DE3D12F5596780A66C6C3D4A /* 📦 Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XLForm/Pods-XLForm-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
EBE0335CCC7588D83B89A92A /* 📦 Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Check Pods Manifest.lock";
|
||||
name = "Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -587,6 +583,21 @@
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
CFE72E068B5F4D9BB45FB757 /* Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -597,12 +608,15 @@
|
||||
283B59B7195334AF000828CD /* CustomSelectorsFormViewController.m in Sources */,
|
||||
28A766551932F22400D69546 /* UsersTableViewController.m in Sources */,
|
||||
3CDAFC7A1AB0AFA4000F75B6 /* CustomRowsViewController.m in Sources */,
|
||||
DEA6EF911B57D6CC000F4893 /* HTTPSessionManager.m in Sources */,
|
||||
28A7663B1932EA1F00D69546 /* UserLocalDataLoader.m in Sources */,
|
||||
282EB27C1AB5FF33004A736F /* AccessoryViewFormViewController.m in Sources */,
|
||||
BF9DB1D51AE0436600B985E7 /* BlogExampleViewController.m in Sources */,
|
||||
2850C60818D0F706002B7D0A /* main.m in Sources */,
|
||||
D51B8B2C19126664008C0478 /* XLFormCustomCell.m in Sources */,
|
||||
28A7664D1932EE0B00D69546 /* User.m in Sources */,
|
||||
28A7664A1932ED3400D69546 /* Model.xcdatamodeld in Sources */,
|
||||
3C3B01F01AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m in Sources */,
|
||||
28A766461932EC9C00D69546 /* User+Additions.m in Sources */,
|
||||
28DBB04118D76FDC00FB8A8B /* MultivaluedFormViewController.m in Sources */,
|
||||
28A85D5918E346C100E81A26 /* XLFormImageSelectorCell.m in Sources */,
|
||||
28468E9818EC686500DBB015 /* NativeEventFormViewController.m in Sources */,
|
||||
@@ -615,12 +629,13 @@
|
||||
2843EB5618D4F7B700F13E2B /* DatesFormViewController.m in Sources */,
|
||||
283C6B7D1999BAF100A5283D /* UICustomizationFormViewController.m in Sources */,
|
||||
3C3B01E21AB7499A0027CD45 /* XLRatingView.m in Sources */,
|
||||
28A7662E1932E98A00D69546 /* HTTPSessionManager.m in Sources */,
|
||||
283B59B219532415000828CD /* MapViewController.m in Sources */,
|
||||
2843EB4718D4915800F13E2B /* ExamplesFormViewController.m in Sources */,
|
||||
BF01E9281C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m in Sources */,
|
||||
28A766451932EC9C00D69546 /* CoreDataStore.m in Sources */,
|
||||
BF9DB1D61AE0436600B985E7 /* PredicateFormViewController.m in Sources */,
|
||||
28A7663C1932EA1F00D69546 /* UserRemoteDataLoader.m in Sources */,
|
||||
BFE91AFB1AE159B200DE5231 /* BasicPredicateViewController.m in Sources */,
|
||||
DEB8235C1AD5529A00AF9FE2 /* FormattersViewController.m in Sources */,
|
||||
2843EB5218D4CFC700F13E2B /* OthersFormViewController.m in Sources */,
|
||||
2843EB4B18D496F600F13E2B /* SelectorsFormViewController.m in Sources */,
|
||||
28468EA418EF41D300DBB015 /* InputsFormViewController.m in Sources */,
|
||||
@@ -668,7 +683,6 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
@@ -683,7 +697,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
@@ -715,7 +729,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -723,15 +737,14 @@
|
||||
};
|
||||
2850C62518D0F707002B7D0A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 5F6FC67A75254B60005DC716 /* Pods-XLForm.debug.xcconfig */;
|
||||
baseConfigurationReference = 7B0D2D6A86E2A41ED22E8A35 /* Pods.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "XLForm/XLForm-Prefix.pch";
|
||||
INFOPLIST_FILE = "XLForm/XLForm-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
WRAPPER_EXTENSION = app;
|
||||
@@ -740,16 +753,14 @@
|
||||
};
|
||||
2850C62618D0F707002B7D0A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = B98C1213E7C714A861219C81 /* Pods-XLForm.release.xcconfig */;
|
||||
baseConfigurationReference = 976A33EE62A018A7257B4878 /* Pods.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "XLForm/XLForm-Prefix.pch";
|
||||
INFOPLIST_FILE = "XLForm/XLForm-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
WRAPPER_EXTENSION = app;
|
||||
@@ -778,6 +789,19 @@
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCVersionGroup section */
|
||||
28A766481932ED3400D69546 /* Model.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
28A766491932ED3400D69546 /* Model.xcdatamodel */,
|
||||
);
|
||||
currentVersion = 28A766491932ED3400D69546 /* Model.xcdatamodel */;
|
||||
path = Model.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
/* End XCVersionGroup section */
|
||||
};
|
||||
rootObject = 2850C5F018D0F706002B7D0A /* Project object */;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
@@ -14,7 +9,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<string>com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -22,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.1</string>
|
||||
<string>2.0.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3.0.1</string>
|
||||
<string>2.0.1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//
|
||||
// DynamicSelectorsFormViewController.swift
|
||||
// DatesFormViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.com )
|
||||
//
|
||||
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
|
||||
//
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -23,41 +23,49 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
class DynamicSelectorsFormViewController : XLFormViewController {
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
initializeForm()
|
||||
|
||||
class DatesFormViewController: XLFormViewController {
|
||||
|
||||
struct tag {
|
||||
static let dateTime = "dateTime"
|
||||
static let date = "date"
|
||||
static let time = "time"
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
initializeForm()
|
||||
required init(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder);
|
||||
self.initializeForm()
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
}
|
||||
|
||||
func initializeForm() {
|
||||
let form = XLFormDescriptor(title: "Selectors")
|
||||
|
||||
var form : XLFormDescriptor
|
||||
var section : XLFormSectionDescriptor
|
||||
var row : XLFormRowDescriptor
|
||||
|
||||
// Basic Information
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Dynamic Selectors")
|
||||
section.footerTitle = "DynamicSelectorsFormViewController.swift"
|
||||
form = XLFormDescriptor.formDescriptorWithTitle("Dates") as XLFormDescriptor
|
||||
|
||||
section = XLFormSectionDescriptor.formSectionWithTitle("Inline Dates") as XLFormSectionDescriptor
|
||||
form.addFormSection(section)
|
||||
|
||||
// Selector Push
|
||||
row = XLFormRowDescriptor(tag: "selectorUser", rowType:XLFormRowDescriptorTypeSelectorPush, title:"User")
|
||||
row.action.viewControllerClass = UsersTableViewController.self
|
||||
// Date
|
||||
row = XLFormRowDescriptor(tag: tag.date, rowType: XLFormRowDescriptorTypeDateInline, title:"Date")
|
||||
row.value = NSDate()
|
||||
section.addFormRow(row)
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
// Selector PopOver
|
||||
row = XLFormRowDescriptor(tag: "selectorUserPopover", rowType:XLFormRowDescriptorTypeSelectorPopover, title:"User Popover")
|
||||
row.action.viewControllerClass = UsersTableViewController.self
|
||||
section.addFormRow(row)
|
||||
}
|
||||
self.form = form
|
||||
// Time
|
||||
row = XLFormRowDescriptor(tag: tag.time, rowType: XLFormRowDescriptorTypeTimeInline, title: "Time")
|
||||
row.value = NSDate()
|
||||
section.addFormRow(row)
|
||||
|
||||
// DateTime
|
||||
row = XLFormRowDescriptor(tag: tag.dateTime, rowType: XLFormRowDescriptorTypeDateTimeInline, title: "Date Time")
|
||||
row.value = NSDate()
|
||||
section.addFormRow(row)
|
||||
self.form = form;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,8 +2,6 @@ platform :ios, '8.0'
|
||||
|
||||
target 'SwiftExample' do
|
||||
|
||||
pod 'XLForm', :path => '../../'
|
||||
pod 'JVFloatLabeledTextField', '1.0.2', :inhibit_warnings => true
|
||||
pod 'AXRatingView', '1.0.3', :inhibit_warnings => true
|
||||
pod 'XLForm', :path => '../../'
|
||||
|
||||
end
|
||||
|
||||
@@ -7,80 +7,26 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2724071466166BFA1E54E659 /* libPods-SwiftExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 854F8DF43072D7C59CBECB68 /* libPods-SwiftExample.a */; };
|
||||
2847A6A41AAF2679000A2ABE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2847A6A31AAF2679000A2ABE /* AppDelegate.swift */; };
|
||||
2847A6A91AAF2679000A2ABE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2847A6A71AAF2679000A2ABE /* Main.storyboard */; };
|
||||
2847A6AB1AAF2679000A2ABE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2847A6AA1AAF2679000A2ABE /* Images.xcassets */; };
|
||||
2860673E1AEDBD4A002F1E04 /* CustomRowsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067321AEDBD4A002F1E04 /* CustomRowsViewController.swift */; };
|
||||
2860673F1AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067341AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift */; };
|
||||
286067411AEDBD4A002F1E04 /* XLFormRatingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067391AEDBD4A002F1E04 /* XLFormRatingCell.swift */; };
|
||||
286067421AEDBD4A002F1E04 /* XLFormRatingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860673A1AEDBD4A002F1E04 /* XLFormRatingCell.xib */; };
|
||||
286067431AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2860673C1AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift */; };
|
||||
286067441AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860673D1AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib */; };
|
||||
286067461AEDC3D7002F1E04 /* XLRatingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067451AEDC3D7002F1E04 /* XLRatingView.swift */; };
|
||||
286E8B751AE809EF00F2767A /* DynamicSelectorsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B731AE809EF00F2767A /* DynamicSelectorsFormViewController.swift */; };
|
||||
286E8B781AE80C4300F2767A /* UsersTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B771AE80C4300F2767A /* UsersTableViewController.swift */; };
|
||||
286E8B7E1AE86C8900F2767A /* XLFormCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B7C1AE86C8900F2767A /* XLFormCustomCell.swift */; };
|
||||
286E8B7F1AE86C8900F2767A /* OthersFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B7D1AE86C8900F2767A /* OthersFormViewController.swift */; };
|
||||
286E8B861AE9286B00F2767A /* CustomSelectorsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B811AE9286B00F2767A /* CustomSelectorsFormViewController.swift */; };
|
||||
286E8B871AE9286B00F2767A /* CLLocationValueTrasformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B831AE9286B00F2767A /* CLLocationValueTrasformer.swift */; };
|
||||
286E8B881AE9286B00F2767A /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B841AE9286B00F2767A /* MapViewController.swift */; };
|
||||
286E8B891AE9286B00F2767A /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 286E8B851AE9286B00F2767A /* MapViewController.xib */; };
|
||||
286E8B8C1AE9993F00F2767A /* MultivaluedFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B8B1AE9993F00F2767A /* MultivaluedFormViewController.swift */; };
|
||||
288646151AE59474007A8B9B /* ExamplesFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 288646141AE59474007A8B9B /* ExamplesFormViewController.swift */; };
|
||||
288646181AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 288646171AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard */; };
|
||||
2886461C1AE5C958007A8B9B /* NativeEventFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2886461A1AE5C958007A8B9B /* NativeEventFormViewController.swift */; };
|
||||
2886461F1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2886461E1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift */; };
|
||||
28B920751AE6F02F00BD6382 /* InputsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28B920741AE6F02F00BD6382 /* InputsFormViewController.swift */; };
|
||||
28B920781AE73AA600BD6382 /* SelectorsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28B920771AE73AA600BD6382 /* SelectorsFormViewController.swift */; };
|
||||
28D832571AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832561AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift */; };
|
||||
28D832631AEBE4E4009E3B3F /* BasicPredicateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832601AEBE4E4009E3B3F /* BasicPredicateViewController.swift */; };
|
||||
28D832671AEBEAA0009E3B3F /* BlogExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832661AEBEAA0009E3B3F /* BlogExampleViewController.swift */; };
|
||||
28D832691AEBFE9F009E3B3F /* PredicateFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832681AEBFE9F009E3B3F /* PredicateFormViewController.swift */; };
|
||||
28D8326C1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D8326B1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift */; };
|
||||
28D8326F1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D8326E1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift */; };
|
||||
2847A6AE1AAF2679000A2ABE /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2847A6AC1AAF2679000A2ABE /* LaunchScreen.xib */; };
|
||||
28F490221AAFBBC600C8E0CC /* DatesFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */; };
|
||||
BF01E92B1C21FF2800BDE045 /* InlineSegmentedCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF01E92A1C21FF2800BDE045 /* InlineSegmentedCell.swift */; };
|
||||
DD7B43598E698717584375E9 /* libPods-SwiftExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9CFB9BA3A82D5F6FE7CCE5A5 /* libPods-SwiftExample.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2847A69E1AAF2679000A2ABE /* SwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2847A6A21AAF2679000A2ABE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
2847A6A31AAF2679000A2ABE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AppDelegate.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
2847A6A31AAF2679000A2ABE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
2847A6A81AAF2679000A2ABE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
2847A6AA1AAF2679000A2ABE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
2847A6AD1AAF2679000A2ABE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||
2847A6C31AAF2B14000A2ABE /* SwiftExample-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SwiftExample-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
286067321AEDBD4A002F1E04 /* CustomRowsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CustomRowsViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
286067341AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FloatLabeledTextFieldCell.swift; sourceTree = "<group>"; };
|
||||
286067391AEDBD4A002F1E04 /* XLFormRatingCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLFormRatingCell.swift; sourceTree = "<group>"; };
|
||||
2860673A1AEDBD4A002F1E04 /* XLFormRatingCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = XLFormRatingCell.xib; sourceTree = "<group>"; };
|
||||
2860673C1AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLFormWeekDaysCell.swift; sourceTree = "<group>"; };
|
||||
2860673D1AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = XLFormWeekDaysCell.xib; sourceTree = "<group>"; };
|
||||
286067451AEDC3D7002F1E04 /* XLRatingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLRatingView.swift; sourceTree = "<group>"; };
|
||||
286E8B731AE809EF00F2767A /* DynamicSelectorsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DynamicSelectorsFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
286E8B771AE80C4300F2767A /* UsersTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UsersTableViewController.swift; path = SwiftExample/DynamicSelector/UsersTableViewController.swift; sourceTree = SOURCE_ROOT; };
|
||||
286E8B7C1AE86C8900F2767A /* XLFormCustomCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLFormCustomCell.swift; sourceTree = "<group>"; };
|
||||
286E8B7D1AE86C8900F2767A /* OthersFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = OthersFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
286E8B811AE9286B00F2767A /* CustomSelectorsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CustomSelectorsFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
286E8B831AE9286B00F2767A /* CLLocationValueTrasformer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CLLocationValueTrasformer.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
286E8B841AE9286B00F2767A /* MapViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
|
||||
286E8B851AE9286B00F2767A /* MapViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MapViewController.xib; sourceTree = "<group>"; };
|
||||
286E8B8B1AE9993F00F2767A /* MultivaluedFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = MultivaluedFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
288646141AE59474007A8B9B /* ExamplesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ExamplesFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
288646171AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = iPhoneStoryboard.storyboard; sourceTree = "<group>"; };
|
||||
2886461A1AE5C958007A8B9B /* NativeEventFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = NativeEventFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
2886461E1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateAndTimeValueTrasformer.swift; sourceTree = "<group>"; };
|
||||
28B920741AE6F02F00BD6382 /* InputsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = InputsFormViewController.swift; path = SwiftExample/Inputs/InputsFormViewController.swift; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
28B920771AE73AA600BD6382 /* SelectorsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorsFormViewController.swift; sourceTree = "<group>"; };
|
||||
28D832561AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AccessoryViewFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
28D832601AEBE4E4009E3B3F /* BasicPredicateViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicPredicateViewController.swift; sourceTree = "<group>"; };
|
||||
28D832661AEBEAA0009E3B3F /* BlogExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BlogExampleViewController.swift; path = SwiftExample/PredicateExamples/BlogExampleViewController.swift; sourceTree = SOURCE_ROOT; };
|
||||
28D832681AEBFE9F009E3B3F /* PredicateFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PredicateFormViewController.swift; path = SwiftExample/PredicateExamples/PredicateFormViewController.swift; sourceTree = SOURCE_ROOT; };
|
||||
28D8326B1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationExamplesFormViewController.swift; sourceTree = "<group>"; };
|
||||
28D8326E1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UICustomizationFormViewController.swift; sourceTree = "<group>"; };
|
||||
28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DatesFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatesFormViewController.swift; sourceTree = "<group>"; };
|
||||
2EB9C638FC2450A0B9786D1E /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = "<group>"; };
|
||||
420D9BAB7B0D2AF9487DD060 /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9CFB9BA3A82D5F6FE7CCE5A5 /* libPods-SwiftExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwiftExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
BF01E92A1C21FF2800BDE045 /* InlineSegmentedCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = InlineSegmentedCell.swift; path = InlineSegmentedCell/InlineSegmentedCell.swift; sourceTree = "<group>"; };
|
||||
854F8DF43072D7C59CBECB68 /* libPods-SwiftExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwiftExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -88,7 +34,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
DD7B43598E698717584375E9 /* libPods-SwiftExample.a in Frameworks */,
|
||||
2724071466166BFA1E54E659 /* libPods-SwiftExample.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -116,20 +62,11 @@
|
||||
2847A6A01AAF2679000A2ABE /* SwiftExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28D832551AEBC4A7009E3B3F /* AccessoryViews */,
|
||||
286067311AEDBD4A002F1E04 /* CustomRows */,
|
||||
28F490201AAFBBC600C8E0CC /* Dates */,
|
||||
28B920711AE6EB6100BD6382 /* Inputs */,
|
||||
286E8B8A1AE9993F00F2767A /* MultiValuedSections */,
|
||||
286E8B7A1AE86C8900F2767A /* Others */,
|
||||
28D8325F1AEBE4E4009E3B3F /* PredicateExamples */,
|
||||
288646191AE5C958007A8B9B /* RealExamples */,
|
||||
28B920761AE7378400BD6382 /* Selectors */,
|
||||
288646161AE5C7EA007A8B9B /* StoryboardExample */,
|
||||
28D8326D1AEC2D1B009E3B3F /* UICustomization */,
|
||||
28D8326A1AEC177E009E3B3F /* Validations */,
|
||||
288646141AE59474007A8B9B /* ExamplesFormViewController.swift */,
|
||||
2847A6A31AAF2679000A2ABE /* AppDelegate.swift */,
|
||||
2847A6A71AAF2679000A2ABE /* Main.storyboard */,
|
||||
2847A6AA1AAF2679000A2ABE /* Images.xcassets */,
|
||||
2847A6AC1AAF2679000A2ABE /* LaunchScreen.xib */,
|
||||
2847A6A11AAF2679000A2ABE /* Supporting Files */,
|
||||
);
|
||||
path = SwiftExample;
|
||||
@@ -138,196 +75,25 @@
|
||||
2847A6A11AAF2679000A2ABE /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2847A6AA1AAF2679000A2ABE /* Images.xcassets */,
|
||||
2847A6A21AAF2679000A2ABE /* Info.plist */,
|
||||
2847A6C31AAF2B14000A2ABE /* SwiftExample-Bridging-Header.h */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286067311AEDBD4A002F1E04 /* CustomRows */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BF01E9291C21FEF700BDE045 /* Inline Segmented */,
|
||||
286067321AEDBD4A002F1E04 /* CustomRowsViewController.swift */,
|
||||
286067331AEDBD4A002F1E04 /* FloatLabeledTextField */,
|
||||
286067351AEDBD4A002F1E04 /* Rating */,
|
||||
2860673B1AEDBD4A002F1E04 /* Weekdays */,
|
||||
);
|
||||
name = CustomRows;
|
||||
path = SwiftExample/CustomRows;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
286067331AEDBD4A002F1E04 /* FloatLabeledTextField */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286067341AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift */,
|
||||
);
|
||||
path = FloatLabeledTextField;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286067351AEDBD4A002F1E04 /* Rating */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286067361AEDBD4A002F1E04 /* RatingView */,
|
||||
286067391AEDBD4A002F1E04 /* XLFormRatingCell.swift */,
|
||||
2860673A1AEDBD4A002F1E04 /* XLFormRatingCell.xib */,
|
||||
);
|
||||
path = Rating;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286067361AEDBD4A002F1E04 /* RatingView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286067451AEDC3D7002F1E04 /* XLRatingView.swift */,
|
||||
);
|
||||
path = RatingView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2860673B1AEDBD4A002F1E04 /* Weekdays */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2860673C1AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift */,
|
||||
2860673D1AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib */,
|
||||
);
|
||||
path = Weekdays;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286E8B6C1AE8099F00F2767A /* DynamicSelector */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286E8B771AE80C4300F2767A /* UsersTableViewController.swift */,
|
||||
286E8B731AE809EF00F2767A /* DynamicSelectorsFormViewController.swift */,
|
||||
);
|
||||
path = DynamicSelector;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286E8B7A1AE86C8900F2767A /* Others */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286E8B7B1AE86C8900F2767A /* CustomCells */,
|
||||
286E8B7D1AE86C8900F2767A /* OthersFormViewController.swift */,
|
||||
);
|
||||
path = Others;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286E8B7B1AE86C8900F2767A /* CustomCells */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286E8B7C1AE86C8900F2767A /* XLFormCustomCell.swift */,
|
||||
);
|
||||
path = CustomCells;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286E8B801AE9286B00F2767A /* CustomSelectors */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286E8B811AE9286B00F2767A /* CustomSelectorsFormViewController.swift */,
|
||||
286E8B821AE9286B00F2767A /* XLFormRowViewController */,
|
||||
);
|
||||
path = CustomSelectors;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286E8B821AE9286B00F2767A /* XLFormRowViewController */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286E8B831AE9286B00F2767A /* CLLocationValueTrasformer.swift */,
|
||||
286E8B841AE9286B00F2767A /* MapViewController.swift */,
|
||||
286E8B851AE9286B00F2767A /* MapViewController.xib */,
|
||||
);
|
||||
path = XLFormRowViewController;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
286E8B8A1AE9993F00F2767A /* MultiValuedSections */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286E8B8B1AE9993F00F2767A /* MultivaluedFormViewController.swift */,
|
||||
);
|
||||
path = MultiValuedSections;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
288646161AE5C7EA007A8B9B /* StoryboardExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
288646171AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard */,
|
||||
);
|
||||
path = StoryboardExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
288646191AE5C958007A8B9B /* RealExamples */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2886461A1AE5C958007A8B9B /* NativeEventFormViewController.swift */,
|
||||
);
|
||||
path = RealExamples;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28B920711AE6EB6100BD6382 /* Inputs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28B920741AE6F02F00BD6382 /* InputsFormViewController.swift */,
|
||||
);
|
||||
path = Inputs;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28B920761AE7378400BD6382 /* Selectors */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
286E8B801AE9286B00F2767A /* CustomSelectors */,
|
||||
286E8B6C1AE8099F00F2767A /* DynamicSelector */,
|
||||
28B920771AE73AA600BD6382 /* SelectorsFormViewController.swift */,
|
||||
);
|
||||
name = Selectors;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28D832551AEBC4A7009E3B3F /* AccessoryViews */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28D832561AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift */,
|
||||
);
|
||||
path = AccessoryViews;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28D8325F1AEBE4E4009E3B3F /* PredicateExamples */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28D832681AEBFE9F009E3B3F /* PredicateFormViewController.swift */,
|
||||
28D832601AEBE4E4009E3B3F /* BasicPredicateViewController.swift */,
|
||||
28D832661AEBEAA0009E3B3F /* BlogExampleViewController.swift */,
|
||||
);
|
||||
path = PredicateExamples;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28D8326A1AEC177E009E3B3F /* Validations */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28D8326B1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift */,
|
||||
);
|
||||
path = Validations;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28D8326D1AEC2D1B009E3B3F /* UICustomization */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28D8326E1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift */,
|
||||
);
|
||||
path = UICustomization;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28F490201AAFBBC600C8E0CC /* Dates */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2886461E1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift */,
|
||||
28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */,
|
||||
);
|
||||
name = Dates;
|
||||
path = SwiftExample/Dates;
|
||||
path = Examples/Dates;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
402AE3EC1FACD058DCF0A2D3 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9CFB9BA3A82D5F6FE7CCE5A5 /* libPods-SwiftExample.a */,
|
||||
854F8DF43072D7C59CBECB68 /* libPods-SwiftExample.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -341,14 +107,6 @@
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BF01E9291C21FEF700BDE045 /* Inline Segmented */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BF01E92A1C21FF2800BDE045 /* InlineSegmentedCell.swift */,
|
||||
);
|
||||
name = "Inline Segmented";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -356,12 +114,11 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2847A6BD1AAF2679000A2ABE /* Build configuration list for PBXNativeTarget "SwiftExample" */;
|
||||
buildPhases = (
|
||||
21FCE00817B1AE1029F382A4 /* 📦 Check Pods Manifest.lock */,
|
||||
21FCE00817B1AE1029F382A4 /* Check Pods Manifest.lock */,
|
||||
2847A69A1AAF2679000A2ABE /* Sources */,
|
||||
2847A69B1AAF2679000A2ABE /* Frameworks */,
|
||||
2847A69C1AAF2679000A2ABE /* Resources */,
|
||||
A0F2DA95250A4C3E69515D96 /* 📦 Copy Pods Resources */,
|
||||
DCA1F7B1D7E04613B3E151C1 /* 📦 Embed Pods Frameworks */,
|
||||
A0F2DA95250A4C3E69515D96 /* Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -378,14 +135,11 @@
|
||||
2847A6961AAF2679000A2ABE /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0800;
|
||||
LastUpgradeCheck = 0620;
|
||||
ORGANIZATIONNAME = Xmartlabs;
|
||||
TargetAttributes = {
|
||||
2847A69D1AAF2679000A2ABE = {
|
||||
CreatedOnToolsVersion = 6.2;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -412,10 +166,8 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
288646181AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard in Resources */,
|
||||
286E8B891AE9286B00F2767A /* MapViewController.xib in Resources */,
|
||||
286067441AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib in Resources */,
|
||||
286067421AEDBD4A002F1E04 /* XLFormRatingCell.xib in Resources */,
|
||||
2847A6A91AAF2679000A2ABE /* Main.storyboard in Resources */,
|
||||
2847A6AE1AAF2679000A2ABE /* LaunchScreen.xib in Resources */,
|
||||
2847A6AB1AAF2679000A2ABE /* Images.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -423,14 +175,14 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
21FCE00817B1AE1029F382A4 /* 📦 Check Pods Manifest.lock */ = {
|
||||
21FCE00817B1AE1029F382A4 /* Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Check Pods Manifest.lock";
|
||||
name = "Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -438,14 +190,14 @@
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
A0F2DA95250A4C3E69515D96 /* 📦 Copy Pods Resources */ = {
|
||||
A0F2DA95250A4C3E69515D96 /* Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Copy Pods Resources";
|
||||
name = "Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -453,21 +205,6 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
DCA1F7B1D7E04613B3E151C1 /* 📦 Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -475,38 +212,32 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
28B920781AE73AA600BD6382 /* SelectorsFormViewController.swift in Sources */,
|
||||
28D832671AEBEAA0009E3B3F /* BlogExampleViewController.swift in Sources */,
|
||||
BF01E92B1C21FF2800BDE045 /* InlineSegmentedCell.swift in Sources */,
|
||||
28D8326C1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift in Sources */,
|
||||
286067411AEDBD4A002F1E04 /* XLFormRatingCell.swift in Sources */,
|
||||
28F490221AAFBBC600C8E0CC /* DatesFormViewController.swift in Sources */,
|
||||
286E8B8C1AE9993F00F2767A /* MultivaluedFormViewController.swift in Sources */,
|
||||
28D8326F1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift in Sources */,
|
||||
2860673E1AEDBD4A002F1E04 /* CustomRowsViewController.swift in Sources */,
|
||||
286E8B781AE80C4300F2767A /* UsersTableViewController.swift in Sources */,
|
||||
286067461AEDC3D7002F1E04 /* XLRatingView.swift in Sources */,
|
||||
288646151AE59474007A8B9B /* ExamplesFormViewController.swift in Sources */,
|
||||
286067431AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift in Sources */,
|
||||
2860673F1AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift in Sources */,
|
||||
286E8B7E1AE86C8900F2767A /* XLFormCustomCell.swift in Sources */,
|
||||
286E8B871AE9286B00F2767A /* CLLocationValueTrasformer.swift in Sources */,
|
||||
2886461C1AE5C958007A8B9B /* NativeEventFormViewController.swift in Sources */,
|
||||
286E8B7F1AE86C8900F2767A /* OthersFormViewController.swift in Sources */,
|
||||
2847A6A41AAF2679000A2ABE /* AppDelegate.swift in Sources */,
|
||||
28D832691AEBFE9F009E3B3F /* PredicateFormViewController.swift in Sources */,
|
||||
28D832571AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift in Sources */,
|
||||
286E8B861AE9286B00F2767A /* CustomSelectorsFormViewController.swift in Sources */,
|
||||
2886461F1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift in Sources */,
|
||||
28B920751AE6F02F00BD6382 /* InputsFormViewController.swift in Sources */,
|
||||
28D832631AEBE4E4009E3B3F /* BasicPredicateViewController.swift in Sources */,
|
||||
286E8B751AE809EF00F2767A /* DynamicSelectorsFormViewController.swift in Sources */,
|
||||
286E8B881AE9286B00F2767A /* MapViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
2847A6A71AAF2679000A2ABE /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2847A6A81AAF2679000A2ABE /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2847A6AC1AAF2679000A2ABE /* LaunchScreen.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2847A6AD1AAF2679000A2ABE /* Base */,
|
||||
);
|
||||
name = LaunchScreen.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2847A6BB1AAF2679000A2ABE /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
@@ -521,19 +252,15 @@
|
||||
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;
|
||||
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",
|
||||
@@ -546,7 +273,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
@@ -568,10 +295,8 @@
|
||||
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";
|
||||
@@ -579,17 +304,15 @@
|
||||
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.4;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -600,13 +323,10 @@
|
||||
baseConfigurationReference = 420D9BAB7B0D2AF9487DD060 /* Pods-SwiftExample.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
INFOPLIST_FILE = SwiftExample/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "SwiftExample/SwiftExample-Bridging-Header.h";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -615,13 +335,10 @@
|
||||
baseConfigurationReference = 2EB9C638FC2450A0B9786D1E /* Pods-SwiftExample.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
INFOPLIST_FILE = SwiftExample/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "SwiftExample/SwiftExample-Bridging-Header.h";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
//
|
||||
// AccessoryViewFormViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
|
||||
|
||||
class AccessoryViewFormViewController : XLFormViewController {
|
||||
|
||||
|
||||
fileprivate struct Tags {
|
||||
static let AccessoryViewRowNavigationEnabled = "RowNavigationEnabled"
|
||||
static let AccessoryViewRowNavigationShowAccessoryView = "RowNavigationShowAccessoryView"
|
||||
static let AccessoryViewRowNavigationStopDisableRow = "rowNavigationStopDisableRow"
|
||||
static let AccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow = "rowNavigationSkipCanNotBecomeFirstResponderRow"
|
||||
static let AccessoryViewRowNavigationStopInlineRow = "rowNavigationStopInlineRow"
|
||||
static let AccessoryViewName = "name"
|
||||
static let AccessoryViewEmail = "email"
|
||||
static let AccessoryViewTwitter = "twitter"
|
||||
static let AccessoryViewUrl = "url"
|
||||
static let AccessoryViewDate = "date"
|
||||
static let AccessoryViewTextView = "textView"
|
||||
static let AccessoryViewCheck = "check"
|
||||
static let AccessoryViewNotes = "notes"
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
func initializeForm() {
|
||||
|
||||
let form : XLFormDescriptor
|
||||
var section : XLFormSectionDescriptor
|
||||
var row : XLFormRowDescriptor
|
||||
|
||||
form = XLFormDescriptor(title: "Accessory View")
|
||||
form.rowNavigationOptions = .enabled
|
||||
|
||||
// Configuration section
|
||||
section = XLFormSectionDescriptor()
|
||||
section.title = "Row Navigation Settings"
|
||||
section.footerTitle = "Changing the Settings values you will navigate differently"
|
||||
form.addFormSection(section)
|
||||
|
||||
// RowNavigationEnabled
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationEnabled, rowType: XLFormRowDescriptorTypeBooleanSwitch, title: "Row Navigation Enabled?")
|
||||
row.value = true
|
||||
section.addFormRow(row)
|
||||
|
||||
// RowNavigationShowAccessoryView
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationShowAccessoryView, rowType:XLFormRowDescriptorTypeBooleanCheck, title:"Show input accessory row?")
|
||||
row.value = form.rowNavigationOptions.contains(.enabled)
|
||||
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
|
||||
section.addFormRow(row)
|
||||
|
||||
// RowNavigationStopDisableRow
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationStopDisableRow, rowType: XLFormRowDescriptorTypeBooleanCheck, title:"Stop when reach disabled row?")
|
||||
row.value = form.rowNavigationOptions.contains(.stopDisableRow)
|
||||
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
|
||||
section.addFormRow(row)
|
||||
|
||||
// RowNavigationStopInlineRow
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationStopInlineRow, rowType: XLFormRowDescriptorTypeBooleanCheck, title: "Stop when reach inline row?")
|
||||
row.value = form.rowNavigationOptions.contains(.stopInlineRow)
|
||||
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
|
||||
section.addFormRow(row)
|
||||
|
||||
// RowNavigationSkipCanNotBecomeFirstResponderRow
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow, rowType:XLFormRowDescriptorTypeBooleanCheck, title:"Skip Can Not Become First Responder Row?")
|
||||
row.value = form.rowNavigationOptions.contains(XLFormRowNavigationOptions.skipCanNotBecomeFirstResponderRow)
|
||||
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor()
|
||||
form.addFormSection(section)
|
||||
|
||||
// Name
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewName, rowType: XLFormRowDescriptorTypeText, title: "Name")
|
||||
row.isRequired = true
|
||||
section.addFormRow(row)
|
||||
|
||||
// Email
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewEmail, rowType: XLFormRowDescriptorTypeEmail, title: "Email")
|
||||
// validate the email
|
||||
row.addValidator(XLFormValidator.email())
|
||||
section.addFormRow(row)
|
||||
|
||||
// Twitter
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewTwitter, rowType: XLFormRowDescriptorTypeTwitter, title: "Twitter")
|
||||
row.disabled = NSNumber(value: true as Bool)
|
||||
row.value = "@no_editable"
|
||||
section.addFormRow(row)
|
||||
|
||||
// Url
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewUrl, rowType: XLFormRowDescriptorTypeURL, title: "Url")
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
// Date
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewDate, rowType:XLFormRowDescriptorTypeDateInline, title:"Date Inline")
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor()
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewTextView, rowType:XLFormRowDescriptorTypeTextView)
|
||||
row.cellConfigAtConfigure["textView.placeholder"] = "TEXT VIEW EXAMPLE"
|
||||
section.addFormRow(row)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewCheck, rowType:XLFormRowDescriptorTypeBooleanCheck, title:"Check")
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor()
|
||||
form.addFormSection(section)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryViewNotes, rowType:XLFormRowDescriptorTypeTextView, title:"Notes")
|
||||
section.addFormRow(row)
|
||||
|
||||
self.form = form
|
||||
}
|
||||
|
||||
|
||||
override func inputAccessoryView(for rowDescriptor: XLFormRowDescriptor!) -> UIView! {
|
||||
if (form.formRow(withTag: Tags.AccessoryViewRowNavigationShowAccessoryView)!.value! as AnyObject).boolValue == false {
|
||||
return nil
|
||||
}
|
||||
return super.inputAccessoryView(for: rowDescriptor)
|
||||
}
|
||||
|
||||
|
||||
//MARK: XLFormDescriptorDelegate
|
||||
|
||||
override func formRowDescriptorValueHasChanged(_ formRow: XLFormRowDescriptor!, oldValue: Any!, newValue: Any!) {
|
||||
super.formRowDescriptorValueHasChanged(formRow, oldValue: oldValue, newValue: newValue)
|
||||
if formRow.tag == Tags.AccessoryViewRowNavigationStopDisableRow {
|
||||
if (formRow.value! as AnyObject).boolValue == true {
|
||||
form.rowNavigationOptions = form.rowNavigationOptions.union(.stopDisableRow)
|
||||
}
|
||||
else{
|
||||
form.rowNavigationOptions = form.rowNavigationOptions.subtracting(.stopDisableRow)
|
||||
}
|
||||
}
|
||||
else if formRow.tag == Tags.AccessoryViewRowNavigationStopInlineRow {
|
||||
if (formRow.value! as AnyObject).boolValue == true {
|
||||
form.rowNavigationOptions = form.rowNavigationOptions.union(.stopInlineRow)
|
||||
}
|
||||
else{
|
||||
var options = form.rowNavigationOptions
|
||||
options = options.subtracting(XLFormRowNavigationOptions.stopInlineRow)
|
||||
form.rowNavigationOptions = options
|
||||
}
|
||||
}
|
||||
else if formRow.tag == Tags.AccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow {
|
||||
if (formRow.value! as AnyObject).boolValue == true {
|
||||
form.rowNavigationOptions = form.rowNavigationOptions.union(.skipCanNotBecomeFirstResponderRow)
|
||||
}
|
||||
else{
|
||||
var options = form.rowNavigationOptions
|
||||
options = options.subtracting(.skipCanNotBecomeFirstResponderRow)
|
||||
form.rowNavigationOptions = options
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
// SwiftExample
|
||||
//
|
||||
// Created by Martin Barreto on 3/10/15.
|
||||
// Copyright (c) 2014-2015 Xmartlabs. All rights reserved.
|
||||
// Copyright (c) 2015 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
@@ -14,47 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
|
||||
// Declare custom rows
|
||||
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeRate] = "XLFormRatingCell"
|
||||
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeFloatLabeledTextField] = FloatLabeledTextFieldCell.self
|
||||
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeWeekDays] = "XLFormWeekDaysCell"
|
||||
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeSegmentedInline] = InlineSegmentedCell.self
|
||||
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeSegmentedControl] = InlineSegmentedControl.self
|
||||
XLFormViewController.inlineRowDescriptorTypesForRowDescriptorTypes()[XLFormRowDescriptorTypeSegmentedInline] = XLFormRowDescriptorTypeSegmentedControl
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
self.window = UIWindow.init(frame: UIScreen.main.bounds)
|
||||
// Override point for customization after application launch.
|
||||
self.window!.backgroundColor = .white
|
||||
|
||||
// load the initial form form Storybiard
|
||||
let storyboard = UIStoryboard.init(name:"iPhoneStoryboard", bundle:nil)
|
||||
self.window!.rootViewController = storyboard.instantiateInitialViewController()
|
||||
self.window!.makeKeyAndVisible()
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
func applicationWillResignActive(application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
func applicationDidEnterBackground(application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state here you can undo many of the changes made on entering the background.
|
||||
func applicationWillEnterForeground(application: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
func applicationWillTerminate(application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Xmartlabs. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
|
||||
<rect key="frame" x="20" y="439" width="441" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SwiftExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
|
||||
<rect key="frame" x="20" y="140" width="441" height="43"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
|
||||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
|
||||
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
|
||||
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
|
||||
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="548" y="455"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Qcv-79-vVI">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Dates-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="DatesFormViewController" customModule="SwiftExample" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="2sg-5P-kgQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="2sg-5P-kgQ" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="3Yn-bA-w0I"/>
|
||||
<constraint firstAttribute="trailing" secondItem="2sg-5P-kgQ" secondAttribute="trailing" id="73f-7i-5tC"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="2sg-5P-kgQ" secondAttribute="bottom" id="j8D-ZK-VSm"/>
|
||||
<constraint firstItem="2sg-5P-kgQ" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="u4s-WS-f87"/>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
<mask key="subviews">
|
||||
<exclude reference="2sg-5P-kgQ"/>
|
||||
</mask>
|
||||
<mask key="constraints">
|
||||
<exclude reference="3Yn-bA-w0I"/>
|
||||
<exclude reference="73f-7i-5tC"/>
|
||||
<exclude reference="u4s-WS-f87"/>
|
||||
<exclude reference="j8D-ZK-VSm"/>
|
||||
</mask>
|
||||
</variation>
|
||||
<variation key="widthClass=compact">
|
||||
<mask key="subviews">
|
||||
<include reference="2sg-5P-kgQ"/>
|
||||
</mask>
|
||||
<mask key="constraints">
|
||||
<include reference="3Yn-bA-w0I"/>
|
||||
<include reference="73f-7i-5tC"/>
|
||||
<include reference="u4s-WS-f87"/>
|
||||
<include reference="j8D-ZK-VSm"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" title="Dates" id="9ob-1y-Xxj"/>
|
||||
<connections>
|
||||
<outlet property="tableView" destination="2sg-5P-kgQ" id="8ra-Jh-FFN"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1699.5" y="227"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="Rqn-ai-pbu">
|
||||
<objects>
|
||||
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="Qcv-79-vVI" sceneMemberID="viewController">
|
||||
<toolbarItems/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="DYY-3j-vkq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<nil name="viewControllers"/>
|
||||
<connections>
|
||||
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="PVw-tk-bDX"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="2NC-vw-Oo6" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="936" y="227"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,119 +0,0 @@
|
||||
// CustomRowsViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
class CustomRowsViewController : XLFormViewController {
|
||||
|
||||
fileprivate struct Tags {
|
||||
static let CustomRowFirstRatingTag = "CustomRowFirstRatingTag"
|
||||
static let CustomRowSecondRatingTag = "CustomRowSecondRatingTag"
|
||||
static let CustomRowFloatLabeledTextFieldTag = "CustomRowFloatLabeledTextFieldTag"
|
||||
static let CustomRowWeekdays = "CustomRowWeekdays"
|
||||
static let CustomRowText = "CustomText"
|
||||
static let CustomRowInline = "CustomRowInline"
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
self.initializeForm()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
self.initializeForm()
|
||||
}
|
||||
|
||||
func initializeForm() {
|
||||
|
||||
let form : XLFormDescriptor
|
||||
var section : XLFormSectionDescriptor
|
||||
var row : XLFormRowDescriptor
|
||||
|
||||
form = XLFormDescriptor(title: "Custom Rows")
|
||||
|
||||
section = XLFormSectionDescriptor()
|
||||
section.title = "Ratings"
|
||||
form.addFormSection(section)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowFirstRatingTag, rowType: XLFormRowDescriptorTypeRate, title: "First Rating")
|
||||
row.value = 3
|
||||
section.addFormRow(row)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowSecondRatingTag, rowType: XLFormRowDescriptorTypeRate, title: "First Rating")
|
||||
row.value = 1
|
||||
section.addFormRow(row)
|
||||
|
||||
// Section Float Labeled Text Field
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Float Labeled Text Field")
|
||||
form.addFormSection(section)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowFloatLabeledTextFieldTag, rowType: XLFormRowDescriptorTypeFloatLabeledTextField, title: "Title")
|
||||
section.addFormRow(row)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowFloatLabeledTextFieldTag, rowType: XLFormRowDescriptorTypeFloatLabeledTextField, title: "First Name")
|
||||
section.addFormRow(row)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowFloatLabeledTextFieldTag, rowType: XLFormRowDescriptorTypeFloatLabeledTextField, title: "Last Name")
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Weekdays")
|
||||
form.addFormSection(section)
|
||||
|
||||
// WeekDays
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowWeekdays, rowType: XLFormRowDescriptorTypeWeekDays)
|
||||
row.value = [
|
||||
XLFormWeekDaysCell.kWeekDay.sunday.description(): false,
|
||||
XLFormWeekDaysCell.kWeekDay.monday.description(): true,
|
||||
XLFormWeekDaysCell.kWeekDay.tuesday.description(): true,
|
||||
XLFormWeekDaysCell.kWeekDay.wednesday.description(): false,
|
||||
XLFormWeekDaysCell.kWeekDay.thursday.description(): false,
|
||||
XLFormWeekDaysCell.kWeekDay.friday.description(): false,
|
||||
XLFormWeekDaysCell.kWeekDay.saturday.description(): false
|
||||
]
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Custom inline row")
|
||||
form.addFormSection(section)
|
||||
|
||||
// Inline
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowInline, rowType: XLFormRowDescriptorTypeSegmentedInline)
|
||||
row.title = "You support..."
|
||||
row.selectorOptions = ["Uruguay", "Brazil", "Argentina", "Chile"]
|
||||
row.value = "Uruguay"
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor()
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.CustomRowText, rowType: XLFormRowDescriptorTypeCustom)
|
||||
// Must set custom cell or add custom cell to cellClassesForRowDescriptorTypes dictionary before XLFormViewController loaded
|
||||
row.cellClass = XLFormCustomCell.self
|
||||
section.addFormRow(row)
|
||||
|
||||
self.form = form
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
// FloatLabeledTextFieldCell.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
//
|
||||
|
||||
|
||||
let XLFormRowDescriptorTypeFloatLabeledTextField = "XLFormRowDescriptorTypeFloatLabeledTextField"
|
||||
|
||||
|
||||
class FloatLabeledTextFieldCell : XLFormBaseCell, UITextFieldDelegate {
|
||||
|
||||
static let kFontSize : CGFloat = 16.0
|
||||
|
||||
|
||||
lazy var floatLabeledTextField: JVFloatLabeledTextField = {
|
||||
let result = JVFloatLabeledTextField(frame: CGRect.zero)
|
||||
result.translatesAutoresizingMaskIntoConstraints = false
|
||||
result.font = UIFont.systemFont(ofSize: kFontSize)
|
||||
result.floatingLabel.font = .boldSystemFont(ofSize: kFontSize)
|
||||
result.clearButtonMode = .whileEditing
|
||||
return result
|
||||
}()
|
||||
|
||||
//Mark: - XLFormDescriptorCell
|
||||
|
||||
override func configure() {
|
||||
super.configure()
|
||||
selectionStyle = .none
|
||||
contentView.addSubview(self.floatLabeledTextField)
|
||||
floatLabeledTextField.delegate = self
|
||||
contentView.addConstraints(layoutConstraints())
|
||||
}
|
||||
|
||||
override func update() {
|
||||
super.update()
|
||||
if let rowDescriptor = rowDescriptor {
|
||||
floatLabeledTextField.attributedPlaceholder = NSAttributedString(string: rowDescriptor.title ?? "" , attributes: [NSForegroundColorAttributeName: UIColor.lightGray])
|
||||
if let value = rowDescriptor.value {
|
||||
floatLabeledTextField.text = (value as AnyObject).displayText()
|
||||
}
|
||||
else {
|
||||
floatLabeledTextField.text = rowDescriptor.noValueDisplayText
|
||||
}
|
||||
floatLabeledTextField.isEnabled = !rowDescriptor.isDisabled()
|
||||
floatLabeledTextField.floatingLabelTextColor = .lightGray
|
||||
floatLabeledTextField.alpha = rowDescriptor.isDisabled() ? 0.6 : 1.0
|
||||
}
|
||||
}
|
||||
|
||||
override func formDescriptorCellCanBecomeFirstResponder() -> Bool {
|
||||
return rowDescriptor?.isDisabled() == false
|
||||
}
|
||||
|
||||
|
||||
override func formDescriptorCellBecomeFirstResponder() -> Bool {
|
||||
return self.floatLabeledTextField.becomeFirstResponder()
|
||||
}
|
||||
|
||||
override static func formDescriptorCellHeight(for rowDescriptor: XLFormRowDescriptor!) -> CGFloat {
|
||||
return 55.0
|
||||
}
|
||||
|
||||
|
||||
//MARK: Helpers
|
||||
|
||||
func layoutConstraints() -> [NSLayoutConstraint]{
|
||||
let views = ["floatLabeledTextField" : floatLabeledTextField]
|
||||
let metrics = ["hMargin": 15.0, "vMargin": 8.0]
|
||||
var result = NSLayoutConstraint.constraints(withVisualFormat: "H:|-(hMargin)-[floatLabeledTextField]-(hMargin)-|", options:.alignAllCenterY, metrics:metrics, views:views)
|
||||
result += NSLayoutConstraint.constraints(withVisualFormat: "V:|-(vMargin)-[floatLabeledTextField]-(vMargin)-|", options:.alignAllCenterX, metrics:metrics, views:views)
|
||||
return result
|
||||
}
|
||||
|
||||
func textFieldDidChange(_ textField : UITextField) {
|
||||
if floatLabeledTextField == textField {
|
||||
if let rowDescriptor = rowDescriptor, let text = self.floatLabeledTextField.text {
|
||||
if text.isEmpty == false {
|
||||
rowDescriptor.value = self.floatLabeledTextField.text
|
||||
} else {
|
||||
rowDescriptor.value = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Mark: UITextFieldDelegate
|
||||
|
||||
func textFieldShouldClear(_ textField: UITextField) -> Bool {
|
||||
return self.formViewController().textFieldShouldClear(textField)
|
||||
}
|
||||
|
||||
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||
return self.formViewController().textFieldShouldReturn(textField)
|
||||
}
|
||||
|
||||
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
|
||||
return self.formViewController().textFieldShouldBeginEditing(textField)
|
||||
}
|
||||
|
||||
|
||||
func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
|
||||
return self.formViewController().textFieldShouldEndEditing(textField)
|
||||
}
|
||||
|
||||
|
||||
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||
return self.formViewController().textField(textField, shouldChangeCharactersIn: range, replacementString: string)
|
||||
}
|
||||
|
||||
func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||
self.formViewController().textFieldDidBeginEditing(textField)
|
||||
}
|
||||
|
||||
|
||||
func textFieldDidEndEditing(_ textField: UITextField) {
|
||||
self.textFieldDidChange(textField)
|
||||
self.formViewController().textFieldDidEndEditing(textField)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
//
|
||||
// InlineSegmentedCell.swift
|
||||
// SwiftExample
|
||||
//
|
||||
// Created by mathias Claassen on 16/12/15.
|
||||
// Copyright © 2015 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
let XLFormRowDescriptorTypeSegmentedInline = "XLFormRowDescriptorTypeSegmentedInline"
|
||||
let XLFormRowDescriptorTypeSegmentedControl = "XLFormRowDescriptorTypeSegmentedControl"
|
||||
|
||||
|
||||
class InlineSegmentedCell : XLFormBaseCell {
|
||||
|
||||
override var canBecomeFirstResponder : Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
override func becomeFirstResponder() -> Bool {
|
||||
if isFirstResponder {
|
||||
return super.becomeFirstResponder()
|
||||
}
|
||||
let result = super.becomeFirstResponder()
|
||||
if result {
|
||||
let inlineRowDescriptor : XLFormRowDescriptor = XLFormRowDescriptor(tag: nil, rowType: XLFormViewController.inlineRowDescriptorTypesForRowDescriptorTypes()![rowDescriptor!.rowType] as! String)
|
||||
let cell = inlineRowDescriptor.cell(forForm: formViewController())
|
||||
let inlineCell = cell as? XLFormInlineRowDescriptorCell
|
||||
inlineCell?.inlineRowDescriptor = rowDescriptor
|
||||
rowDescriptor?.sectionDescriptor.addFormRow(inlineRowDescriptor, afterRow: rowDescriptor!)
|
||||
formViewController().ensureRowIsVisible(inlineRowDescriptor)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
override func resignFirstResponder() -> Bool {
|
||||
if !isFirstResponder {
|
||||
return super.resignFirstResponder()
|
||||
}
|
||||
let selectedRowPath : IndexPath = formViewController().form.indexPath(ofFormRow: rowDescriptor!)!
|
||||
let nextRowPath = IndexPath(row: (selectedRowPath as NSIndexPath).row + 1, section: (selectedRowPath as NSIndexPath).section)
|
||||
let nextFormRow = formViewController().form.formRow(atIndex: nextRowPath)
|
||||
let section : XLFormSectionDescriptor = formViewController().form.formSection(at: UInt((nextRowPath as NSIndexPath).section))!
|
||||
let result = super.resignFirstResponder()
|
||||
if result {
|
||||
section.removeFormRow(nextFormRow!)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
//Mark: - XLFormDescriptorCell
|
||||
|
||||
override func formDescriptorCellCanBecomeFirstResponder() -> Bool {
|
||||
return rowDescriptor?.isDisabled() == false
|
||||
}
|
||||
|
||||
override func formDescriptorCellBecomeFirstResponder() -> Bool {
|
||||
if isFirstResponder {
|
||||
resignFirstResponder()
|
||||
return false
|
||||
}
|
||||
return becomeFirstResponder()
|
||||
}
|
||||
|
||||
override func update() {
|
||||
super.update()
|
||||
accessoryType = .none
|
||||
editingAccessoryType = .none
|
||||
selectionStyle = .none
|
||||
textLabel?.text = rowDescriptor?.title
|
||||
detailTextLabel?.text = valueDisplayText()
|
||||
}
|
||||
|
||||
override func formDescriptorCellDidSelected(withForm controller: XLFormViewController!) {
|
||||
controller.tableView.deselectRow(at: controller.form.indexPath(ofFormRow: rowDescriptor!)!, animated: true)
|
||||
}
|
||||
|
||||
func valueDisplayText() -> String? {
|
||||
if let value = rowDescriptor?.value {
|
||||
return (value as AnyObject).displayText()
|
||||
}
|
||||
return rowDescriptor?.noValueDisplayText
|
||||
}
|
||||
}
|
||||
|
||||
class InlineSegmentedControl : XLFormBaseCell, XLFormInlineRowDescriptorCell {
|
||||
|
||||
var inlineRowDescriptor : XLFormRowDescriptor?
|
||||
lazy var segmentedControl : UISegmentedControl = {
|
||||
return UISegmentedControl.autolayoutView() as! UISegmentedControl
|
||||
}()
|
||||
|
||||
override func configure() {
|
||||
super.configure()
|
||||
selectionStyle = .none
|
||||
contentView.addSubview(segmentedControl)
|
||||
contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-[segmentedControl]-|", options: .alignAllCenterY, metrics: nil, views: ["segmentedControl": segmentedControl]))
|
||||
segmentedControl.addTarget(self, action: #selector(InlineSegmentedControl.valueChanged), for: .valueChanged)
|
||||
}
|
||||
|
||||
override func update() {
|
||||
super.update()
|
||||
updateSegmentedControl()
|
||||
segmentedControl.selectedSegmentIndex = selectedIndex()
|
||||
segmentedControl.isEnabled = rowDescriptor?.isDisabled() == false
|
||||
}
|
||||
|
||||
//MARK: Actions
|
||||
|
||||
func valueChanged() {
|
||||
inlineRowDescriptor!.value = inlineRowDescriptor!.selectorOptions![segmentedControl.selectedSegmentIndex]
|
||||
formViewController().updateFormRow(inlineRowDescriptor)
|
||||
}
|
||||
|
||||
//MARK: Helpers
|
||||
|
||||
func getItems() -> NSMutableArray {
|
||||
let result = NSMutableArray()
|
||||
for option in inlineRowDescriptor!.selectorOptions! {
|
||||
result.add((option as AnyObject).displayText())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func updateSegmentedControl() {
|
||||
segmentedControl.removeAllSegments()
|
||||
getItems().enumerateObjects({ [weak self] (object, index, stop) in
|
||||
self?.segmentedControl.insertSegment(withTitle: (object as AnyObject).displayText(), at: index, animated: false)
|
||||
})
|
||||
}
|
||||
|
||||
func selectedIndex() -> Int {
|
||||
let formRow = inlineRowDescriptor ?? rowDescriptor
|
||||
if let value = formRow?.value as? NSObject {
|
||||
for option in (formRow?.selectorOptions)! {
|
||||
if ((option as! NSObject).valueData() as AnyObject) === (value.valueData() as AnyObject) {
|
||||
return formRow?.selectorOptions?.index(where: { ($0 as! NSObject) == (option as! NSObject) } ) ?? -1
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="OGo-4x-YLf" customClass="XLFormRatingCell" customModule="SwiftExample" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="OGo-4x-YLf" id="hV6-xt-6pq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yhI-dj-sRk" customClass="XLRatingView" customModule="SwiftExample" customModuleProvider="target">
|
||||
<rect key="frame" x="353" y="11" width="115" height="22"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="22" id="85e-Ov-qM7"/>
|
||||
<constraint firstAttribute="width" constant="115" id="kOb-W4-HPs"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rate" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vxp-gw-YTt">
|
||||
<rect key="frame" x="15" y="11" width="338" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="IK4-8e-SFs"/>
|
||||
<constraint firstAttribute="width" constant="150" id="hNG-F9-1wj"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="hNG-F9-1wj"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="Vxp-gw-YTt" secondAttribute="bottom" constant="11" id="0Qz-iR-Tzb"/>
|
||||
<constraint firstAttribute="centerY" secondItem="Vxp-gw-YTt" secondAttribute="centerY" id="4Vh-2e-m2p"/>
|
||||
<constraint firstAttribute="trailing" secondItem="yhI-dj-sRk" secondAttribute="trailing" constant="10" id="NPC-r7-JFl"/>
|
||||
<constraint firstAttribute="centerY" secondItem="yhI-dj-sRk" secondAttribute="centerY" id="Vw4-h8-wId"/>
|
||||
<constraint firstItem="Vxp-gw-YTt" firstAttribute="leading" secondItem="hV6-xt-6pq" secondAttribute="leading" constant="15" id="Xgq-Cy-zLQ"/>
|
||||
<constraint firstItem="Vxp-gw-YTt" firstAttribute="top" secondItem="hV6-xt-6pq" secondAttribute="top" constant="11" id="bgO-t8-Rjz"/>
|
||||
<constraint firstItem="yhI-dj-sRk" firstAttribute="leading" secondItem="Vxp-gw-YTt" secondAttribute="trailing" id="n0B-tg-Pik"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="rateTitle" destination="Vxp-gw-YTt" id="0Qh-NC-yq5"/>
|
||||
<outlet property="ratingView" destination="yhI-dj-sRk" id="BKM-pX-m9F"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="301" y="260"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -1,177 +0,0 @@
|
||||
// XLFormWeekDaysCell.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
|
||||
let XLFormRowDescriptorTypeWeekDays = "XLFormRowDescriptorTypeWeekDays"
|
||||
|
||||
|
||||
class XLFormWeekDaysCell : XLFormBaseCell {
|
||||
|
||||
enum kWeekDay: Int {
|
||||
case
|
||||
sunday = 1,
|
||||
monday,
|
||||
tuesday,
|
||||
wednesday,
|
||||
thursday,
|
||||
friday,
|
||||
saturday
|
||||
|
||||
func description() -> String {
|
||||
switch self {
|
||||
case .sunday:
|
||||
return "Sunday"
|
||||
case .monday:
|
||||
return "Monday"
|
||||
case .tuesday:
|
||||
return "Tuesday"
|
||||
case .wednesday:
|
||||
return "Wednesday"
|
||||
case .thursday:
|
||||
return "Thursday"
|
||||
case .friday:
|
||||
return "Friday"
|
||||
case .saturday:
|
||||
return "Saturday"
|
||||
}
|
||||
}
|
||||
|
||||
//Add Custom Functions
|
||||
|
||||
//Allows for iteration as needed (for in ...)
|
||||
static let allValues = [sunday,
|
||||
monday,
|
||||
tuesday,
|
||||
wednesday,
|
||||
thursday,
|
||||
friday,
|
||||
saturday]
|
||||
}
|
||||
|
||||
@IBOutlet weak var sundayButton: UIButton!
|
||||
@IBOutlet weak var mondayButton: UIButton!
|
||||
@IBOutlet weak var tuesdayButton: UIButton!
|
||||
@IBOutlet weak var wednesdayButton: UIButton!
|
||||
@IBOutlet weak var thursdayButton: UIButton!
|
||||
@IBOutlet weak var fridayButton: UIButton!
|
||||
@IBOutlet weak var saturdayButton: UIButton!
|
||||
|
||||
//MARK: - XLFormDescriptorCell
|
||||
|
||||
override func configure() {
|
||||
super.configure()
|
||||
selectionStyle = .none
|
||||
configureButtons()
|
||||
}
|
||||
|
||||
|
||||
override func update() {
|
||||
super.update()
|
||||
updateButtons()
|
||||
}
|
||||
|
||||
override static func formDescriptorCellHeight(for rowDescriptor: XLFormRowDescriptor!) -> CGFloat {
|
||||
return 60
|
||||
}
|
||||
|
||||
//MARK: - Action
|
||||
|
||||
@IBAction func dayTapped(_ sender: UIButton) {
|
||||
let day = getDayFormButton(sender)
|
||||
sender.isSelected = !sender.isSelected
|
||||
var newValue = rowDescriptor!.value as! Dictionary<String, Bool>
|
||||
newValue[day] = sender.isSelected
|
||||
rowDescriptor!.value = newValue
|
||||
}
|
||||
|
||||
//MARK: - Helpers
|
||||
|
||||
func configureButtons() {
|
||||
for subview in contentView.subviews {
|
||||
if let button = subview as? UIButton {
|
||||
button.setImage(UIImage(named: "uncheckedDay"), for: UIControlState())
|
||||
button.setImage(UIImage(named: "checkedDay"), for: .selected)
|
||||
button.adjustsImageWhenHighlighted = false
|
||||
imageTopTitleBottom(button)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func updateButtons() {
|
||||
var value = rowDescriptor!.value as! Dictionary<String, Bool>
|
||||
|
||||
sundayButton.isSelected = value[kWeekDay.sunday.description()]!
|
||||
mondayButton.isSelected = value[kWeekDay.monday.description()]!
|
||||
tuesdayButton.isSelected = value[kWeekDay.tuesday.description()]!
|
||||
wednesdayButton.isSelected = value[kWeekDay.wednesday.description()]!
|
||||
thursdayButton.isSelected = value[kWeekDay.thursday.description()]!
|
||||
fridayButton.isSelected = value[kWeekDay.friday.description()]!
|
||||
saturdayButton.isSelected = value[kWeekDay.saturday.description()]!
|
||||
|
||||
sundayButton.alpha = rowDescriptor!.isDisabled() ? 0.6 : 1
|
||||
mondayButton.alpha = mondayButton.alpha
|
||||
tuesdayButton.alpha = mondayButton.alpha
|
||||
wednesdayButton.alpha = mondayButton.alpha
|
||||
thursdayButton.alpha = mondayButton.alpha
|
||||
fridayButton.alpha = mondayButton.alpha
|
||||
saturdayButton.alpha = mondayButton.alpha
|
||||
}
|
||||
|
||||
func imageTopTitleBottom(_ button: UIButton) {
|
||||
// the space between the image and text
|
||||
let spacing : CGFloat = 3.0
|
||||
|
||||
// lower the text and push it left so it appears centered
|
||||
// below the image
|
||||
let imageSize : CGSize = button.imageView!.image!.size
|
||||
button.titleEdgeInsets = UIEdgeInsets(top: 0.0, left: -imageSize.width, bottom: -(imageSize.height + spacing), right: 0.0)
|
||||
|
||||
// raise the image and push it right so it appears centered
|
||||
// above the text
|
||||
let titleSize : CGSize = (button.titleLabel!.text! as NSString).size(attributes: [NSFontAttributeName: button.titleLabel!.font])
|
||||
button.imageEdgeInsets = UIEdgeInsetsMake(-(titleSize.height + spacing), 0.0, 0.0, -titleSize.width)
|
||||
}
|
||||
|
||||
func getDayFormButton(_ button: UIButton) -> String {
|
||||
switch button {
|
||||
case sundayButton:
|
||||
return kWeekDay.sunday.description()
|
||||
case mondayButton:
|
||||
return kWeekDay.monday.description()
|
||||
case tuesdayButton:
|
||||
return kWeekDay.tuesday.description()
|
||||
case wednesdayButton:
|
||||
return kWeekDay.wednesday.description()
|
||||
case thursdayButton:
|
||||
return kWeekDay.thursday.description()
|
||||
case fridayButton:
|
||||
return kWeekDay.friday.description()
|
||||
default:
|
||||
return kWeekDay.saturday.description()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="60" id="piA-L5-eiN" customClass="XLFormWeekDaysCell" customModule="SwiftExample" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="382" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="piA-L5-eiN" id="Yr6-3E-keb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="382" height="49"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZAg-Me-yKR">
|
||||
<rect key="frame" x="5" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="S">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="selected">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="dayTapped:" destination="piA-L5-eiN" eventType="touchUpInside" id="K4V-Xd-Bak"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UjQ-Cw-7wH" userLabel="separator 1">
|
||||
<rect key="frame" x="58" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="K3N-3h-MZr"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="N3w-qP-kRZ">
|
||||
<rect key="frame" x="58" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="M">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="dayTapped:" destination="piA-L5-eiN" eventType="touchUpInside" id="FaQ-oB-Nkl"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kwc-0w-V51" userLabel="separator 2">
|
||||
<rect key="frame" x="111" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="3mE-sT-ql1"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cPl-47-rS8">
|
||||
<rect key="frame" x="111" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="T">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="dayTapped:" destination="piA-L5-eiN" eventType="touchUpInside" id="4vk-5n-jge"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EiN-2p-Oig" userLabel="separator 3">
|
||||
<rect key="frame" x="164" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="JyW-GC-0A7"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6iC-Cl-RyI">
|
||||
<rect key="frame" x="164" y="0.0" width="54" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="W">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="dayTapped:" destination="piA-L5-eiN" eventType="touchUpInside" id="oO1-zj-XRv"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bRc-5e-QAH" userLabel="separator 4">
|
||||
<rect key="frame" x="218" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="W9F-iR-Leh"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eTo-Ip-reh">
|
||||
<rect key="frame" x="218" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="T">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="dayTapped:" destination="piA-L5-eiN" eventType="touchUpInside" id="SkQ-0a-9Fy"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dHj-rj-mjh" userLabel="separator 5">
|
||||
<rect key="frame" x="271" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="h5U-x0-9nJ"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Wjb-tu-QEo">
|
||||
<rect key="frame" x="271" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="F">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="dayTapped:" destination="piA-L5-eiN" eventType="touchUpInside" id="9A8-9a-SGG"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L7g-lu-boa" userLabel="separator 6">
|
||||
<rect key="frame" x="324" y="10" width="1" height="29"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="1" id="81t-Xh-wZT"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LNf-b4-GYP">
|
||||
<rect key="frame" x="324" y="0.0" width="53" height="49"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<state key="normal" title="S">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="dayTapped:" destination="piA-L5-eiN" eventType="touchUpInside" id="I4k-Ho-KxE"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ZAg-Me-yKR" firstAttribute="leading" secondItem="Yr6-3E-keb" secondAttribute="leading" constant="5" id="0EB-cP-ogn"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="width" secondItem="cPl-47-rS8" secondAttribute="width" id="1ZI-HN-9ew"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="1pQ-h0-SEG"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="6iC-Cl-RyI" secondAttribute="trailing" constant="1" id="2UA-Ao-KZF"/>
|
||||
<constraint firstItem="dHj-rj-mjh" firstAttribute="height" secondItem="L7g-lu-boa" secondAttribute="height" id="4dj-Xx-ksP"/>
|
||||
<constraint firstAttribute="bottom" secondItem="EiN-2p-Oig" secondAttribute="bottom" constant="10" id="5eK-Bu-wpU"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="67F-sV-r6W"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="dHj-rj-mjh" secondAttribute="trailing" id="6ZX-Ub-2vw"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="height" secondItem="bRc-5e-QAH" secondAttribute="height" id="7Um-cV-f7p"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="7YT-x4-m88"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="trailing" secondItem="bRc-5e-QAH" secondAttribute="leading" id="ABd-MQ-9sp"/>
|
||||
<constraint firstAttribute="bottom" secondItem="UjQ-Cw-7wH" secondAttribute="bottom" constant="10" id="ASC-xR-Yxa"/>
|
||||
<constraint firstAttribute="bottom" secondItem="dHj-rj-mjh" secondAttribute="bottom" constant="10" id="ASP-um-b8o"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="Aac-10-vTs"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="6iC-Cl-RyI" secondAttribute="trailing" id="BL5-PL-pac"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ZAg-Me-yKR" secondAttribute="bottom" id="BeZ-ar-qMN"/>
|
||||
<constraint firstItem="dHj-rj-mjh" firstAttribute="height" secondItem="bRc-5e-QAH" secondAttribute="height" id="DYn-Cd-g5H"/>
|
||||
<constraint firstAttribute="bottom" secondItem="kwc-0w-V51" secondAttribute="bottom" constant="10" id="EXu-BP-ftM"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LNf-b4-GYP" secondAttribute="bottom" id="EYe-ne-rqO"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="Fo8-Tp-bkn"/>
|
||||
<constraint firstItem="dHj-rj-mjh" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="GYq-pf-vR0"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="UjQ-Cw-7wH" secondAttribute="trailing" constant="72" id="HQ2-jA-X9g"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="eTo-Ip-reh" secondAttribute="trailing" id="I0s-Ze-pwV"/>
|
||||
<constraint firstAttribute="bottom" secondItem="bRc-5e-QAH" secondAttribute="bottom" constant="10" id="InL-Hk-twg"/>
|
||||
<constraint firstItem="UjQ-Cw-7wH" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="Jj4-jg-rdr"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="KQe-Ei-8jY"/>
|
||||
<constraint firstItem="cPl-47-rS8" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="Kw5-3R-qXs"/>
|
||||
<constraint firstItem="bRc-5e-QAH" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="MXG-vB-U8F"/>
|
||||
<constraint firstItem="ZAg-Me-yKR" firstAttribute="width" secondItem="N3w-qP-kRZ" secondAttribute="width" id="Mem-UJ-5Js"/>
|
||||
<constraint firstItem="L7g-lu-boa" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="OVT-GJ-zq8"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" constant="25" id="OYQ-8o-3j8"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="width" secondItem="cPl-47-rS8" secondAttribute="width" id="Pl6-Xd-Krq"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="width" secondItem="LNf-b4-GYP" secondAttribute="width" id="Pro-fg-wBA"/>
|
||||
<constraint firstAttribute="bottom" secondItem="6iC-Cl-RyI" secondAttribute="bottom" id="Q5M-8N-hIh"/>
|
||||
<constraint firstItem="UjQ-Cw-7wH" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="RGn-ja-FRD"/>
|
||||
<constraint firstAttribute="trailing" secondItem="LNf-b4-GYP" secondAttribute="trailing" constant="5" id="RlS-d5-rIx"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="trailing" secondItem="cPl-47-rS8" secondAttribute="leading" id="Rs4-Pl-R8X"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="bRc-5e-QAH" secondAttribute="trailing" id="SO9-U6-cVO"/>
|
||||
<constraint firstAttribute="bottom" secondItem="N3w-qP-kRZ" secondAttribute="bottom" id="STf-aE-Y2E"/>
|
||||
<constraint firstAttribute="bottom" secondItem="kwc-0w-V51" secondAttribute="bottom" constant="10" id="SWG-oy-aZJ"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="TAb-IV-m7A"/>
|
||||
<constraint firstAttribute="bottom" secondItem="cPl-47-rS8" secondAttribute="bottom" id="Tmp-md-564"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="height" secondItem="UjQ-Cw-7wH" secondAttribute="height" id="Uli-Qb-6Om"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="VcV-kz-XBb"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="width" secondItem="6iC-Cl-RyI" secondAttribute="width" id="X0k-jG-o63"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="eTo-Ip-reh" secondAttribute="trailing" id="cOc-P1-ZhU"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="Wjb-tu-QEo" secondAttribute="trailing" id="dSr-cr-ebR"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="fgT-6k-CaP"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="Wjb-tu-QEo" secondAttribute="trailing" id="gNl-wJ-ujY"/>
|
||||
<constraint firstItem="ZAg-Me-yKR" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="glN-lT-q1z"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="width" secondItem="Wjb-tu-QEo" secondAttribute="width" id="hEH-9C-pGZ"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="height" secondItem="kwc-0w-V51" secondAttribute="height" id="hOI-fd-H7m"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="i5C-wG-rRN"/>
|
||||
<constraint firstItem="eTo-Ip-reh" firstAttribute="trailing" secondItem="dHj-rj-mjh" secondAttribute="leading" id="jsw-H6-2gQ"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="lQE-r9-9JT"/>
|
||||
<constraint firstAttribute="bottom" secondItem="L7g-lu-boa" secondAttribute="bottom" constant="10" id="lv1-xB-0zR"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="oQe-Qf-9ZO"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="pn7-s8-fDj"/>
|
||||
<constraint firstItem="EiN-2p-Oig" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="qIf-aB-2ZY"/>
|
||||
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="EiN-2p-Oig" secondAttribute="trailing" id="sAE-Nl-Puc"/>
|
||||
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="L7g-lu-boa" secondAttribute="trailing" id="t1q-Nc-vbg"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="tVL-uj-6Ma"/>
|
||||
<constraint firstItem="Wjb-tu-QEo" firstAttribute="trailing" secondItem="L7g-lu-boa" secondAttribute="leading" id="u3Q-pF-E3A"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Wjb-tu-QEo" secondAttribute="bottom" id="uh4-LM-Ieo"/>
|
||||
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" constant="25" id="vrx-0B-GOB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="eTo-Ip-reh" secondAttribute="bottom" id="xIu-Vy-Nff"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="UjQ-Cw-7wH" secondAttribute="trailing" id="xWy-Uf-QEm"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="xsx-BM-yQ5"/>
|
||||
<constraint firstItem="N3w-qP-kRZ" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="yEX-Wv-CZQ"/>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="67F-sV-r6W"/>
|
||||
<exclude reference="xWy-Uf-QEm"/>
|
||||
<exclude reference="1pQ-h0-SEG"/>
|
||||
<exclude reference="HQ2-jA-X9g"/>
|
||||
<exclude reference="OYQ-8o-3j8"/>
|
||||
<exclude reference="Rs4-Pl-R8X"/>
|
||||
<exclude reference="SWG-oy-aZJ"/>
|
||||
<exclude reference="TAb-IV-m7A"/>
|
||||
<exclude reference="Uli-Qb-6Om"/>
|
||||
<exclude reference="lQE-r9-9JT"/>
|
||||
<exclude reference="vrx-0B-GOB"/>
|
||||
<exclude reference="KQe-Ei-8jY"/>
|
||||
<exclude reference="sAE-Nl-Puc"/>
|
||||
<exclude reference="7Um-cV-f7p"/>
|
||||
<exclude reference="hOI-fd-H7m"/>
|
||||
<exclude reference="2UA-Ao-KZF"/>
|
||||
<exclude reference="SO9-U6-cVO"/>
|
||||
<exclude reference="6ZX-Ub-2vw"/>
|
||||
<exclude reference="cOc-P1-ZhU"/>
|
||||
<exclude reference="4dj-Xx-ksP"/>
|
||||
<exclude reference="DYn-Cd-g5H"/>
|
||||
<exclude reference="dSr-cr-ebR"/>
|
||||
<exclude reference="t1q-Nc-vbg"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="fridayButton" destination="Wjb-tu-QEo" id="AcP-Qg-i9P"/>
|
||||
<outlet property="mondayButton" destination="N3w-qP-kRZ" id="u3A-mt-EKd"/>
|
||||
<outlet property="saturdayButton" destination="LNf-b4-GYP" id="TeM-3b-B1Z"/>
|
||||
<outlet property="sundayButton" destination="ZAg-Me-yKR" id="GUI-ry-Hm1"/>
|
||||
<outlet property="thursdayButton" destination="eTo-Ip-reh" id="Dxi-hi-oBK"/>
|
||||
<outlet property="tuesdayButton" destination="cPl-47-rS8" id="wIn-mO-cUx"/>
|
||||
<outlet property="wednesdayButton" destination="6iC-Cl-RyI" id="GQe-Oy-pcd"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="296" y="222"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -1,75 +0,0 @@
|
||||
//
|
||||
// CustomSelectorsFormViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
import MapKit
|
||||
|
||||
|
||||
class CustomSelectorsFormViewController : XLFormViewController {
|
||||
|
||||
fileprivate struct Tags {
|
||||
static let SelectorMap = "selectorMap"
|
||||
static let SelectorMapPopover = "selectorMapPopover"
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
func initializeForm() {
|
||||
|
||||
let form : XLFormDescriptor
|
||||
var section : XLFormSectionDescriptor
|
||||
var row : XLFormRowDescriptor
|
||||
|
||||
form = XLFormDescriptor(title: "Custom Selectors")
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "TextField Types")
|
||||
section.footerTitle = "CustomSelectorsFormViewController.swift"
|
||||
form.addFormSection(section)
|
||||
|
||||
// Selector Push
|
||||
row = XLFormRowDescriptor(tag: Tags.SelectorMap, rowType: XLFormRowDescriptorTypeSelectorPush, title: "Coordinate")
|
||||
row.action.viewControllerClass = MapViewController.self
|
||||
row.valueTransformer = CLLocationValueTrasformer.self
|
||||
row.value = CLLocation(latitude: -33, longitude: -56)
|
||||
section.addFormRow(row)
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
// Selector PopOver
|
||||
row = XLFormRowDescriptor(tag: Tags.SelectorMapPopover, rowType: XLFormRowDescriptorTypeSelectorPopover, title: "Coordinate PopOver")
|
||||
row.action.viewControllerClass = MapViewController.self
|
||||
row.valueTransformer = CLLocationValueTrasformer.self
|
||||
row.value = CLLocation(latitude: -33, longitude: -56)
|
||||
section.addFormRow(row)
|
||||
}
|
||||
self.form = form
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
//
|
||||
// MapViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
import UIKit
|
||||
import MapKit
|
||||
|
||||
class MapAnnotation : NSObject, MKAnnotation {
|
||||
|
||||
@objc var coordinate : CLLocationCoordinate2D
|
||||
|
||||
override init() {
|
||||
coordinate = CLLocationCoordinate2D(latitude: -33.0, longitude: -56.0)
|
||||
super.init()
|
||||
}
|
||||
}
|
||||
|
||||
@objc(MapViewController)
|
||||
class MapViewController : UIViewController, XLFormRowDescriptorViewController, MKMapViewDelegate {
|
||||
|
||||
var rowDescriptor: XLFormRowDescriptor?
|
||||
lazy var mapView : MKMapView = { [unowned self] in
|
||||
let mapView = MKMapView(frame: self.view.frame)
|
||||
mapView.autoresizingMask = [UIViewAutoresizing.flexibleHeight, UIViewAutoresizing.flexibleWidth]
|
||||
return mapView
|
||||
}()
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view.
|
||||
view.addSubview(mapView)
|
||||
mapView.delegate = self
|
||||
if let value = rowDescriptor?.value as? CLLocation {
|
||||
mapView.setCenter(value.coordinate, animated: false)
|
||||
title = String(format: "%0.4f, %0.4f", mapView.centerCoordinate.latitude, mapView.centerCoordinate.longitude)
|
||||
let annotation = MapAnnotation()
|
||||
annotation.coordinate = value.coordinate
|
||||
self.mapView.addAnnotation(annotation)
|
||||
}
|
||||
}
|
||||
|
||||
//MARK - - MKMapViewDelegate
|
||||
|
||||
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
|
||||
|
||||
let pinAnnotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "annotation")
|
||||
pinAnnotationView.pinColor = MKPinAnnotationColor.red
|
||||
pinAnnotationView.isDraggable = true
|
||||
pinAnnotationView.animatesDrop = true
|
||||
return pinAnnotationView
|
||||
}
|
||||
|
||||
|
||||
func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationViewDragState, fromOldState oldState: MKAnnotationViewDragState) {
|
||||
if (newState == .ending){
|
||||
if let rowDescriptor = rowDescriptor, let annotation = view.annotation {
|
||||
rowDescriptor.value = CLLocation(latitude:annotation.coordinate.latitude, longitude:annotation.coordinate.longitude)
|
||||
self.title = String(format: "%0.4f, %0.4f", annotation.coordinate.latitude, annotation.coordinate.longitude)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="15A279b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MapViewController" customModule="SwiftExample" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="view" destination="iN0-l3-epB" id="O5R-PM-tsI"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -1,68 +0,0 @@
|
||||
//
|
||||
// DateAndTimeValueTransformer.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
class DateValueTrasformer : ValueTransformer {
|
||||
|
||||
override class func transformedValueClass() -> AnyClass {
|
||||
return NSString.self
|
||||
}
|
||||
|
||||
|
||||
override class func allowsReverseTransformation() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
override func transformedValue(_ value: Any?) -> Any? {
|
||||
if let date = value as? Date {
|
||||
let dateFormatter = DateFormatter()
|
||||
dateFormatter.dateStyle = .full
|
||||
dateFormatter.timeStyle = .none
|
||||
return dateFormatter.string(from: date)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
class DateTimeValueTrasformer: ValueTransformer {
|
||||
|
||||
override class func transformedValueClass() -> AnyClass {
|
||||
return NSString.self
|
||||
}
|
||||
|
||||
|
||||
override class func allowsReverseTransformation() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
override func transformedValue(_ value: Any?) -> Any? {
|
||||
if let date = value as? Date {
|
||||
let dateFormatter = DateFormatter()
|
||||
dateFormatter.dateStyle = .medium
|
||||
dateFormatter.timeStyle = .short
|
||||
return dateFormatter.string(from: date)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
//
|
||||
// DatesFormViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
|
||||
class DatesFormViewController: XLFormViewController {
|
||||
|
||||
fileprivate struct Tags {
|
||||
static let DateInline = "dateInline"
|
||||
static let TimeInline = "timeInline"
|
||||
static let DateTimeInline = "dateTimeInline"
|
||||
static let CountDownTimerInline = "countDownTimerInline"
|
||||
static let DatePicker = "datePicker"
|
||||
static let Date = "date"
|
||||
static let Time = "time"
|
||||
static let DateTime = "dateTime"
|
||||
static let CountDownTimer = "countDownTimer"
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
let barButton = UIBarButtonItem(title: "Disable", style: .plain, target: self, action: #selector(DatesFormViewController.disableEnable(_:)))
|
||||
barButton.possibleTitles = Set(["Disable", "Enable"])
|
||||
navigationItem.rightBarButtonItem = barButton
|
||||
}
|
||||
|
||||
|
||||
func disableEnable(_ button : UIBarButtonItem){
|
||||
form.isDisabled = !form.isDisabled
|
||||
button.title = form.isDisabled ? "Enable" : "Disable"
|
||||
tableView.endEditing(true)
|
||||
tableView.reloadData()
|
||||
}
|
||||
|
||||
func initializeForm() {
|
||||
let form : XLFormDescriptor
|
||||
var section : XLFormSectionDescriptor
|
||||
var row : XLFormRowDescriptor
|
||||
|
||||
form = XLFormDescriptor(title: "Date & Time")
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Inline Dates")
|
||||
form.addFormSection(section)
|
||||
|
||||
// Date
|
||||
row = XLFormRowDescriptor(tag: Tags.DateInline, rowType: XLFormRowDescriptorTypeDateInline, title:"Date")
|
||||
row.value = Date()
|
||||
row.cellConfigAtConfigure["locale"] = Locale(identifier: "FR_fr")
|
||||
section.addFormRow(row)
|
||||
|
||||
// Time
|
||||
row = XLFormRowDescriptor(tag: Tags.TimeInline, rowType: XLFormRowDescriptorTypeTimeInline, title: "Time")
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
// DateTime
|
||||
row = XLFormRowDescriptor(tag: Tags.DateTimeInline, rowType: XLFormRowDescriptorTypeDateTimeInline, title: "Date Time")
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
// CountDownTimer
|
||||
row = XLFormRowDescriptor(tag: Tags.CountDownTimerInline, rowType:XLFormRowDescriptorTypeCountDownTimerInline, title:"Countdown Timer")
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Dates") //
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
// Date
|
||||
row = XLFormRowDescriptor(tag: Tags.Date, rowType:XLFormRowDescriptorTypeDate, title:"Date")
|
||||
row.value = Date()
|
||||
row.cellConfigAtConfigure["minimumDate"] = Date()
|
||||
row.cellConfigAtConfigure["maximumDate"] = Date(timeIntervalSinceNow: 60*60*24*3)
|
||||
section.addFormRow(row)
|
||||
|
||||
// Time
|
||||
row = XLFormRowDescriptor(tag: Tags.Time, rowType: XLFormRowDescriptorTypeTime, title: "Time")
|
||||
row.cellConfigAtConfigure["minuteInterval"] = 10
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
// DateTime
|
||||
row = XLFormRowDescriptor(tag: Tags.DateTime, rowType: XLFormRowDescriptorTypeDateTime, title: "Date Time")
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
// CountDownTimer
|
||||
row = XLFormRowDescriptor(tag: Tags.CountDownTimer, rowType: XLFormRowDescriptorTypeCountDownTimer, title: "Countdown Timer")
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Disabled Dates")
|
||||
section.footerTitle = "DatesFormViewController.swift"
|
||||
form.addFormSection(section)
|
||||
|
||||
// Date
|
||||
row = XLFormRowDescriptor(tag: nil, rowType: XLFormRowDescriptorTypeDate, title: "Date")
|
||||
row.disabled = NSNumber(value: true as Bool)
|
||||
row.isRequired = true
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "DatePicker")
|
||||
form.addFormSection(section)
|
||||
|
||||
// DatePicker
|
||||
row = XLFormRowDescriptor(tag: Tags.DatePicker, rowType:XLFormRowDescriptorTypeDatePicker)
|
||||
row.cellConfigAtConfigure["datePicker.datePickerMode"] = UIDatePickerMode.date.rawValue
|
||||
row.value = Date()
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
self.form = form
|
||||
}
|
||||
|
||||
|
||||
// MARK: - XLFormDescriptorDelegate
|
||||
override func formRowDescriptorValueHasChanged(_ formRow: XLFormRowDescriptor!, oldValue: Any!, newValue: Any!) {
|
||||
super.formRowDescriptorValueHasChanged(formRow, oldValue: oldValue, newValue: newValue)
|
||||
if formRow.tag == Tags.DatePicker {
|
||||
let alertView = UIAlertView(title: "DatePicker", message: "Value Has changed!", delegate: self, cancelButtonTitle: "OK")
|
||||
alertView.show()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
//
|
||||
// UsersTableViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
|
||||
class UserCell : UITableViewCell {
|
||||
|
||||
lazy var userImage : UIImageView = {
|
||||
let tempUserImage = UIImageView()
|
||||
tempUserImage.translatesAutoresizingMaskIntoConstraints = false
|
||||
tempUserImage.layer.masksToBounds = true
|
||||
tempUserImage.layer.cornerRadius = 10.0
|
||||
return tempUserImage
|
||||
}()
|
||||
|
||||
|
||||
lazy var userName : UILabel = {
|
||||
let tempUserName = UILabel()
|
||||
tempUserName.translatesAutoresizingMaskIntoConstraints = false
|
||||
tempUserName.font = UIFont.systemFont(ofSize: 15.0)
|
||||
return tempUserName
|
||||
}()
|
||||
|
||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
// Initialization code
|
||||
|
||||
contentView.addSubview(userImage)
|
||||
contentView.addSubview(userName)
|
||||
contentView.addConstraints(layoutConstraints())
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Layout Constraints
|
||||
|
||||
func layoutConstraints() -> [NSLayoutConstraint]{
|
||||
let views = ["image": self.userImage, "name": self.userName ] as [String : Any]
|
||||
let metrics = [ "imgSize": 50.0, "margin": 12.0]
|
||||
|
||||
var result = NSLayoutConstraint.constraints(withVisualFormat: "H:|-(margin)-[image(imgSize)]-[name]", options:.alignAllTop, metrics: metrics, views: views)
|
||||
result += NSLayoutConstraint.constraints(withVisualFormat: "V:|-(margin)-[image(imgSize)]", options:NSLayoutFormatOptions(), metrics:metrics, views: views)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private let _UsersJSONSerializationSharedInstance = UsersJSONSerialization()
|
||||
|
||||
class UsersJSONSerialization {
|
||||
|
||||
lazy var userData : Array<AnyObject>? = {
|
||||
let dataString =
|
||||
"[" +
|
||||
"{\"id\":1,\"name\":\"Apu Nahasapeemapetilon\",\"imageName\":\"Apu_Nahasapeemapetilon.png\"}," +
|
||||
"{\"id\":7,\"name\":\"Bart Simpsons\",\"imageName\":\"Bart_Simpsons.png\"}," +
|
||||
"{\"id\":8,\"name\":\"Homer Simpsons\",\"imageName\":\"Homer_Simpsons.png\"}," +
|
||||
"{\"id\":9,\"name\":\"Lisa Simpsons\",\"imageName\":\"Lisa_Simpsons.png\"}," +
|
||||
"{\"id\":2,\"name\":\"Maggie Simpsons\",\"imageName\":\"Maggie_Simpsons.png\"}," +
|
||||
"{\"id\":3,\"name\":\"Marge Simpsons\",\"imageName\":\"Marge_Simpsons.png\"}," +
|
||||
"{\"id\":4,\"name\":\"Montgomery Burns\",\"imageName\":\"Montgomery_Burns.png\"}," +
|
||||
"{\"id\":5,\"name\":\"Ned Flanders\",\"imageName\":\"Ned_Flanders.png\"}," +
|
||||
"{\"id\":6,\"name\":\"Otto Mann\",\"imageName\":\"Otto_Mann.png\"}]"
|
||||
let jsonData = dataString.data(using: String.Encoding.utf8, allowLossyConversion: true)
|
||||
do {
|
||||
let result = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions()) as! Array<AnyObject>
|
||||
return result
|
||||
}
|
||||
catch let error as NSError {
|
||||
print("\(error)")
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
class var sharedInstance: UsersJSONSerialization {
|
||||
return _UsersJSONSerializationSharedInstance
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class User: NSObject, XLFormOptionObject {
|
||||
|
||||
let userId: Int
|
||||
let userName : String
|
||||
let userImage: String
|
||||
|
||||
init(userId: Int, userName: String, userImage: String){
|
||||
self.userId = userId
|
||||
self.userImage = userImage
|
||||
self.userName = userName
|
||||
}
|
||||
|
||||
func formDisplayText() -> String {
|
||||
return self.userName
|
||||
}
|
||||
|
||||
func formValue() -> Any {
|
||||
return self.userId as Any
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class UsersTableViewController : UITableViewController, XLFormRowDescriptorViewController, XLFormRowDescriptorPopoverViewController {
|
||||
|
||||
|
||||
var rowDescriptor : XLFormRowDescriptor?
|
||||
var popoverController : UIPopoverController?
|
||||
|
||||
var userCell : UserCell?
|
||||
|
||||
fileprivate let kUserCellIdentifier = "UserCell"
|
||||
|
||||
|
||||
override init(style: UITableViewStyle) {
|
||||
super.init(style: style);
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: Bundle!) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
tableView.register(UserCell.self, forCellReuseIdentifier: kUserCellIdentifier)
|
||||
tableView.tableFooterView = UIView(frame: CGRect.zero)
|
||||
}
|
||||
|
||||
// MARK: UITableViewDataSource
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return UsersJSONSerialization.sharedInstance.userData!.count
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell: UserCell = tableView.dequeueReusableCell(withIdentifier: self.kUserCellIdentifier, for: indexPath) as! UserCell
|
||||
let usersData = UsersJSONSerialization.sharedInstance.userData! as! Array<Dictionary<String, AnyObject>>
|
||||
let userData = usersData[(indexPath as NSIndexPath).row] as Dictionary<String, AnyObject>
|
||||
let userId = userData["id"] as! Int
|
||||
cell.userName.text = userData["name"] as? String
|
||||
cell.userImage.image = UIImage(named: (userData["imageName"] as? String)!)
|
||||
if let value = rowDescriptor?.value {
|
||||
cell.accessoryType = ((value as? XLFormOptionObject)?.formValue() as? Int) == userId ? .checkmark : .none
|
||||
}
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
return 73.0
|
||||
}
|
||||
|
||||
|
||||
//MARK: UITableViewDelegate
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
|
||||
let usersData = UsersJSONSerialization.sharedInstance.userData! as! Array<Dictionary<String, AnyObject>>
|
||||
let userData = usersData[(indexPath as NSIndexPath).row] as Dictionary<String, AnyObject>
|
||||
let user = User(userId: (userData["id"] as! Int), userName: userData["name"] as! String, userImage: userData["imageName"] as! String)
|
||||
self.rowDescriptor!.value = user;
|
||||
if let porpOver = self.popoverController {
|
||||
porpOver.dismiss(animated: true)
|
||||
porpOver.delegate?.popoverControllerDidDismissPopover!(porpOver)
|
||||
}
|
||||
else if parent is UINavigationController {
|
||||
navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
//
|
||||
// ExamplesFormViewController.swift
|
||||
// XLForm ( https://github.com/xmartlabs/XLForm )
|
||||
//
|
||||
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.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.
|
||||
|
||||
|
||||
|
||||
|
||||
class ExamplesFormViewController : XLFormViewController {
|
||||
|
||||
fileprivate struct Tags {
|
||||
static let RealExample = "RealExamples"
|
||||
static let TextFieldAndTextView = "TextFieldAndTextView"
|
||||
static let Selectors = "Selectors"
|
||||
static let Othes = "Others"
|
||||
static let Dates = "Dates"
|
||||
static let Predicates = "BasicPredicates"
|
||||
static let BlogExample = "BlogPredicates"
|
||||
static let Multivalued = "Multivalued"
|
||||
static let MultivaluedOnlyReorder = "MultivaluedOnlyReorder"
|
||||
static let MultivaluedOnlyInsert = "MultivaluedOnlyInsert"
|
||||
static let MultivaluedOnlyDelete = "MultivaluedOnlyDelete"
|
||||
static let Validations = "Validations"
|
||||
static let UICusomization = "Customization"
|
||||
static let Custom = "Custom"
|
||||
static let AccessoryView = "Accessory View"
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
initializeForm()
|
||||
}
|
||||
|
||||
|
||||
// MARK: Helpers
|
||||
|
||||
func initializeForm() {
|
||||
let form : XLFormDescriptor
|
||||
var section : XLFormSectionDescriptor
|
||||
var row: XLFormRowDescriptor
|
||||
|
||||
form = XLFormDescriptor()
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Real examples")
|
||||
form.addFormSection(section)
|
||||
|
||||
// NativeEventFormViewController
|
||||
row = XLFormRowDescriptor(tag: Tags.RealExample, rowType: XLFormRowDescriptorTypeButton, title: "iOS Calendar Event Form")
|
||||
row.action.formSegueIdentifier = "NativeEventNavigationViewControllerSegue"
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "This form is actually an example")
|
||||
section.footerTitle = "ExamplesFormViewController.swift, Select an option to view another example"
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
// TextFieldAndTextView
|
||||
row = XLFormRowDescriptor(tag: Tags.TextFieldAndTextView, rowType: XLFormRowDescriptorTypeButton, title: "Text Fields")
|
||||
row.action.viewControllerClass = InputsFormViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
// Selectors
|
||||
row = XLFormRowDescriptor(tag: Tags.Selectors, rowType: XLFormRowDescriptorTypeButton, title: "Selectors")
|
||||
row.action.formSegueIdentifier = "SelectorsFormViewControllerSegue"
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
// Dates
|
||||
row = XLFormRowDescriptor(tag: Tags.Dates, rowType: XLFormRowDescriptorTypeButton, title: "Date & Time")
|
||||
row.action.viewControllerClass = DatesFormViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
// Others
|
||||
row = XLFormRowDescriptor(tag: Tags.Othes, rowType: XLFormRowDescriptorTypeButton, title: "Other Rows")
|
||||
row.action.formSegueIdentifier = "OthersFormViewControllerSegue"
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Multivalued example")
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.Multivalued, rowType: XLFormRowDescriptorTypeButton, title: "Multivalued Sections")
|
||||
row.action.viewControllerClass = MultivaluedFormViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.MultivaluedOnlyReorder, rowType: XLFormRowDescriptorTypeButton, title: "Multivalued Only Reorder")
|
||||
row.action.viewControllerClass = MultivaluedOnlyReorderViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.MultivaluedOnlyInsert, rowType: XLFormRowDescriptorTypeButton, title: "Multivalued Only Insert")
|
||||
row.action.viewControllerClass = MultivaluedOnlyInserViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.MultivaluedOnlyDelete, rowType: XLFormRowDescriptorTypeButton, title: "Multivalued Only Delete")
|
||||
row.action.viewControllerClass = MultivaluedOnlyDeleteViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "UI Customization")
|
||||
form.addFormSection(section)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.UICusomization, rowType: XLFormRowDescriptorTypeButton, title:"UI Customization")
|
||||
row.action.viewControllerClass = UICustomizationFormViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Custom Rows")
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.Custom, rowType: XLFormRowDescriptorTypeButton, title:"Custom Rows")
|
||||
row.action.viewControllerClass = CustomRowsViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Accessory View")
|
||||
form.addFormSection(section)
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.AccessoryView, rowType: XLFormRowDescriptorTypeButton, title:"Accessory Views")
|
||||
row.action.viewControllerClass = AccessoryViewFormViewController.self
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Validation Examples")
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.Validations, rowType: XLFormRowDescriptorTypeButton, title: "Validation Examples")
|
||||
row.action.formSegueIdentifier = "ValidationExamplesFormViewControllerSegue"
|
||||
section.addFormRow(row)
|
||||
|
||||
section = XLFormSectionDescriptor.formSection(withTitle: "Using Predicates")
|
||||
form.addFormSection(section)
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.Predicates, rowType: XLFormRowDescriptorTypeButton, title: "Very basic predicates")
|
||||
row.action.formSegueIdentifier = "BasicPredicateViewControllerSegue"
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.Predicates, rowType: XLFormRowDescriptorTypeButton, title: "Blog Example Hide predicates")
|
||||
row.action.formSegueIdentifier = "BlogExampleViewSegue"
|
||||
section.addFormRow(row)
|
||||
|
||||
|
||||
row = XLFormRowDescriptor(tag: Tags.Predicates, rowType: XLFormRowDescriptorTypeButton, title: "Another example")
|
||||
row.action.formSegueIdentifier = "PredicateFormViewControllerSegue"
|
||||
section.addFormRow(row)
|
||||
|
||||
self.form = form
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,28 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "xl_appicon_58.png",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "xl_appicon_87.png",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "xl_appicon_80-1.png",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "xl_appicon_120-1.png",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "xl_appicon_120.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
@@ -56,20 +51,13 @@
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "xl_appicon_76.png",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "xl_appicon_152.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 808 B |
|
Before Width: | Height: | Size: 883 B |
|
Before Width: | Height: | Size: 931 B |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,52 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "retina4",
|
||||
"filename" : "xl_splash@2x.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"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Apu_Nahasapeemapetilon.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.1 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Bart_Simpsons.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Homer_Simpsons.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Lisa_Simpsons.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Maggie_Simpsons.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Marge_Simpsons.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Montgomery_Burns.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 10 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Ned_Flanders.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 12 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "Otto_Mann.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "default-avatar@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.5 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "vweekday.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||