Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
osx_image: xcode8.2
language: objective-c
script: xcodebuild -project Formulary.xcodeproj/ -scheme Formulary -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.2' test
script:
- xcodebuild -project Formulary.xcodeproj/ -scheme Formulary -sdk iphonesimulator -destination 'platform=iOS Simulator,id=DB794781-65A7-4884-8D00-AAC3CBD39A44,OS=10.2' test
7 changes: 5 additions & 2 deletions ExemplaryUITests/TestFullSuite.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ - (void)testFullExampleForm
XCUIElementQuery *tablesQuery = app.tables;
[tablesQuery.textFields[@"Name"] tap];
[tablesQuery.textFields[@"Name"] typeText:@"Testy"];
XCTAssertTrue(tablesQuery.textFields[@"Name, Testy"].exists);

[[[XCUIApplication alloc] init].keyboards.otherElements[@"Typing Predictions"].otherElements[@"\u201cTesty\u201d"] tap];

XCTAssertTrue(tablesQuery.textFields[@"Name, Testy "].exists);

[tablesQuery.textFields[@"Email"] tap];

Expand Down Expand Up @@ -65,7 +68,7 @@ - (void)testFullExampleForm
[[tablesQuery.cells containingType:XCUIElementTypeButton identifier:@"Show Values"].element tap];

XCUIElement *formValuesAlert = app.alerts[@"Form Values"];
XCUIElement *staticTextResult = formValuesAlert.staticTexts[@"{\"name\":\"Testy\",\"likesGoats\":true,\"email\":\"Test@example.com\",\"thoughts\":\"Some thoughts\",\"favoriteNumber\":\"12\",\"Food\":[\"Ice Cream\",\"Pizza\"],\"House\":\"Ravenclaw\",\"age\":\"28\"}"];
XCUIElement *staticTextResult = formValuesAlert.staticTexts[@"{\"name\":\"Testy \",\"likesGoats\":true,\"email\":\"Test@example.com\",\"thoughts\":\"Some thoughts\",\"favoriteNumber\":\"12\",\"Food\":[\"Ice Cream\",\"Pizza\"],\"House\":\"Ravenclaw\",\"age\":\"28\"}"];
XCTAssertTrue(staticTextResult.exists);

[formValuesAlert.buttons[@"Ok"] tap];
Expand Down
4 changes: 3 additions & 1 deletion ExemplaryUITests/TextInput.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ - (void)testRequiredStringValidation {

[textField typeText:@"Joe"];

[[[XCUIApplication alloc] init].keyboards.otherElements[@"Typing Predictions"].otherElements[@"\u201cJoe\u201d"] tap];

// Drag to lose focus
[[[self.tablesQuery childrenMatchingType:XCUIElementTypeCell] elementBoundByIndex:0] pressForDuration:0 thenDragToElement:[[self.tablesQuery childrenMatchingType:XCUIElementTypeCell] elementBoundByIndex:1]];

XCTAssertTrue(self.tablesQuery.textFields[@"Name, Joe"].exists);
XCTAssertTrue(self.tablesQuery.textFields[@"Name, Joe "].exists);
}

- (void)testMaxMinNumericValidations
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Formulary
# Formulary [![Build Status](https://travis-ci.org/fcanas/Formulary.svg?branch=master)](https://travis-ci.org/fcanas/Formulary)

Formulary is a Swift library for creating dynamic, declarative, table view forms for iOS.

Expand All @@ -25,7 +25,7 @@ presentViewController(formViewController, animated: true, completion: nil)
<!--![](/Screenshots/formulary_basic.gif)-->


#### NSFormatters in Text Entry
#### NSFormatters in Text Entry

`NSFormatter`s can be injected to format text entry or enforce valid text. In this example the number formatter will prevent the user from entering more than two decimal places, more than one decimal point, or any non-numeric characters.

Expand All @@ -38,9 +38,9 @@ TextEntryFormRow(name:"Age", textType: .Decimal, formatter: decimalFormatter)

#### Validations

Text entry rows can have validations. Validations are assertions about the value of a row.
Text entry rows can have validations. Validations are assertions about the value of a row.
Validations show users error messages. Validation results for individual rows are aggregated to validate the overall Form.
Some Validations are provided such as `MaximumNumber`, `MinimumNumber`, and `RequiredString`.
Some Validations are provided such as `MaximumNumber`, `MinimumNumber`, and `RequiredString`.

```swift
TextEntryFormRow(name:"Name", validation: RequiredString("Name"))
Expand Down