Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.
Merged
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
18 changes: 18 additions & 0 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
649DE2B414E765BA54759ECE /* Pods_CocoaPods_Payment.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AA0E4E14E48A69AC562E605 /* Pods_CocoaPods_Payment.framework */; };
72DEC9A3753978AEF3383E56 /* Pods_CocoaPods_iPhone_Storyboard.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8F9A5FF448CDE99A084DAF4 /* Pods_CocoaPods_iPhone_Storyboard.framework */; };
7878EFBDBA2F722E24CF62C4 /* Pods_CocoaPods_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADF7319532C286F8BEAEFF49 /* Pods_CocoaPods_Tests.framework */; };
7A41ADEF1DABE0EB0063DB62 /* FORMSegmentFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A41ADEE1DABE0EB0063DB62 /* FORMSegmentFieldCell.m */; };
7A41ADF11DAC2FCD0063DB62 /* segment-field.json in Resources */ = {isa = PBXBuildFile; fileRef = 7A41ADF01DAC2FCD0063DB62 /* segment-field.json */; };
7A4ABAF31D7DBE7200DAE893 /* FORMSpacerFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A4ABAF21D7DBE7200DAE893 /* FORMSpacerFieldCell.m */; };
825F6E98164CA04CDE12F270 /* Pods_CocoaPods_ModalForm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39C9B4BD521E20A90A708235 /* Pods_CocoaPods_ModalForm.framework */; };
82B59BA34A26252CFF5C11CB /* Pods_CocoaPods_Basic_ObjC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FF9D9A1384FFF4964BDEA19 /* Pods_CocoaPods_Basic_ObjC.framework */; };
Expand Down Expand Up @@ -386,6 +388,9 @@
50D77918C798DC1313D4D76D /* Pods-CocoaPods-iPhone-Storyboard.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-iPhone-Storyboard.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-iPhone-Storyboard/Pods-CocoaPods-iPhone-Storyboard.debug.xcconfig"; sourceTree = "<group>"; };
728B7C5A71C3BD93D42F469A /* Pods_CocoaPods_LoginDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaPods_LoginDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7313DABFEEF45FCCCD39281E /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7A41ADED1DABE0EB0063DB62 /* FORMSegmentFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FORMSegmentFieldCell.h; path = Switch/FORMSegmentFieldCell.h; sourceTree = "<group>"; };
7A41ADEE1DABE0EB0063DB62 /* FORMSegmentFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FORMSegmentFieldCell.m; path = Switch/FORMSegmentFieldCell.m; sourceTree = "<group>"; };
7A41ADF01DAC2FCD0063DB62 /* segment-field.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "segment-field.json"; sourceTree = "<group>"; };
7A4ABAF11D7DBE7200DAE893 /* FORMSpacerFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FORMSpacerFieldCell.h; sourceTree = "<group>"; };
7A4ABAF21D7DBE7200DAE893 /* FORMSpacerFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FORMSpacerFieldCell.m; sourceTree = "<group>"; };
7A979DD3111677D9FF793855 /* Pods_CocoaPods_Basic_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaPods_Basic_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -573,6 +578,7 @@
140803641BEA50AB0098C288 /* Cells */ = {
isa = PBXGroup;
children = (
7A41ADE91DABD2930063DB62 /* Segment */,
7AB346BD1D78C83100AAAD2E /* Spacer */,
140803651BEA50AB0098C288 /* Base */,
140803681BEA50AB0098C288 /* Button */,
Expand Down Expand Up @@ -762,6 +768,7 @@
140804271BEA50C00098C288 /* number-formula.json */,
140804281BEA50C00098C288 /* postal_codes.json */,
140804291BEA50C00098C288 /* section-field-position.json */,
7A41ADF01DAC2FCD0063DB62 /* segment-field.json */,
1408042A1BEA50C00098C288 /* simple-number-field.json */,
1408042B1BEA50C00098C288 /* simple-section.json */,
1408042C1BEA50C00098C288 /* simple-text-field.json */,
Expand Down Expand Up @@ -993,6 +1000,15 @@
name = Frameworks;
sourceTree = "<group>";
};
7A41ADE91DABD2930063DB62 /* Segment */ = {
isa = PBXGroup;
children = (
7A41ADED1DABE0EB0063DB62 /* FORMSegmentFieldCell.h */,
7A41ADEE1DABE0EB0063DB62 /* FORMSegmentFieldCell.m */,
);
name = Segment;
sourceTree = "<group>";
};
7AB346BD1D78C83100AAAD2E /* Spacer */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1336,6 +1352,7 @@
140804491BEA50C00098C288 /* number-formula.json in Resources */,
140804441BEA50C00098C288 /* dynamic.json in Resources */,
1408043F1BEA50C00098C288 /* collapsed-groups.json in Resources */,
7A41ADF11DAC2FCD0063DB62 /* segment-field.json in Resources */,
1408044E1BEA50C00098C288 /* simple-text-field.json in Resources */,
1408044A1BEA50C00098C288 /* postal_codes.json in Resources */,
1408044C1BEA50C00098C288 /* simple-number-field.json in Resources */,
Expand Down Expand Up @@ -1846,6 +1863,7 @@
140803E31BEA50AB0098C288 /* FORMFloatFormatter.m in Sources */,
1408042F1BEA50C00098C288 /* FORMDataTests.m in Sources */,
140803EB1BEA50AB0098C288 /* FORMGroupHeaderView.m in Sources */,
7A41ADEF1DABE0EB0063DB62 /* FORMSegmentFieldCell.m in Sources */,
140804061BEA50AB0098C288 /* FORMSocialSecurityNumberValidator.m in Sources */,
7A4ABAF31D7DBE7200DAE893 /* FORMSpacerFieldCell.m in Sources */,
140803D51BEA50AB0098C288 /* FORMBaseFieldCell.m in Sources */,
Expand Down
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Form came out from our need to have a form that could share logic between our iO
Form includes the following features:

- Multiple groups: For example, you can have a group for personal details and another one for shipping information
- [Field validations](https://github.com/hyperoslo/Form/blob/d426e7b090fee7a630d1208b87c63a85b6aaf5df/Demos/Basic-ObjC/Basic-ObjC/Assets/forms.json#L19): We support `required`, `max_length`, `min_length`, `min_value`, `max_value` and `format` (regex). We also support many field types, like `text`, `number`, `phone_number`, `email`, `date`, `name`, `count` and more
- [Field validations](https://github.com/hyperoslo/Form/blob/d426e7b090fee7a630d1208b87c63a85b6aaf5df/Demos/Basic-ObjC/Basic-ObjC/Assets/forms.json#L19): We support `required`, `max_length`, `min_length`, `min_value`, `max_value` and `format` (regex). We also support many field types, like `text`, `number`, `phone_number`, `email`, `date`, `name`, `count`, `segment` and more
- [Custom sizes](https://github.com/hyperoslo/Form/blob/d426e7b090fee7a630d1208b87c63a85b6aaf5df/Demos/Basic-ObjC/Basic-ObjC/Assets/forms.json#L15): Total `width` is handled as 100% while `height` is handled in chunks of [85 px](https://github.com/hyperoslo/Form/blob/b1a542d042a45a9a3056fb8969b5704e51fda1f4/Source/Cells/Base/FORMBaseFieldCell.h#L15)
- [Custom fields](https://github.com/hyperoslo/Form/blob/d426e7b090fee7a630d1208b87c63a85b6aaf5df/Demos/Basic-ObjC/Basic-ObjC/Assets/forms.json#L78): You can register your custom fields, and it's pretty simple (our basic example includes how to make an `image` field)
- [Formulas or computed values](https://github.com/hyperoslo/Form/blob/d426e7b090fee7a630d1208b87c63a85b6aaf5df/Demos/Basic-ObjC/Basic-ObjC/Assets/forms.json#L47): We support fields that contain generated values from other fields
Expand Down Expand Up @@ -198,6 +198,55 @@ To make quick and easy integer adjustments without popping up a keyboard, you ca
}
```

### Segment Fields

Segment fields can be used in place of text or select fields where the options are known and limited. Since segment fields do not require multiple taps or keyboard entry, data can be recorded quickly and easily with a single click. The `segment` field type allows for multiple values like the `select` field type and supports many of the same attributes.

#### Example JSON
```json
{
"groups":[
{
"id":"group1",
"title":"Segment Example",
"sections":[
{
"id":"section1",
"fields":[
{
"id":"location",
"title":"Work Location",
"type":"segment",
"styles":{
"font":"AvenirNext-DemiBold",
"font_size":"16.0",
"tint_color":"#CBEDBF"
},
"values":[
{
"id":"in_house",
"title":"In-house",
"info":"In-house employee",
"default":true,
},
{
"id":"remote",
"title":"Remote",
}
],
"size":{
"width":50,
"height":1
}
}
]
}
]
}
]
}
```

### Accessibility Labels

Accessibility labels are used by VoiceOver on iOS to provide feedback to users with visual impairments. According to Apple, the accessibility label attribute is "a short, localized word or phrase that succinctly describes the control or view, but does not identify the element's type. Examples are 'Add' or 'Play.'"
Expand Down
Loading