{"id":2184,"date":"2014-07-30T15:14:29","date_gmt":"2014-07-30T11:14:29","guid":{"rendered":"https:\/\/blog.alwawee.ru\/?p=2184"},"modified":"2014-07-30T17:01:57","modified_gmt":"2014-07-30T13:01:57","slug":"best-way-to-create-forms-in-ios","status":"publish","type":"post","link":"https:\/\/blog.alwawee.ru\/?p=2184","title":{"rendered":"The best way to create Forms in iOS"},"content":{"rendered":"<p>I think the best way to create forms in iOS is by using <strong>FXForms<\/strong> open-source project. It can be found in <a href=\"https:\/\/github.com\/nicklockwood\/FXForms\" title=\"https:\/\/github.com\/nicklockwood\/FXForms\" target=\"_blank\">Github<\/a>. There are some alternatives, but only FXForms support iOS 6. However, FXForms is still not flexible enough. So, if you want to create something completely custom by design, probably, it will not be a suitable solution.<\/p>\n<p>The main advantage of this approach is that your forms become very compact. Also you will save tons of time and your nerves creating many similar and boring forms after you understand how to use FXForms. But not so easy. The main difficulty is to learn how to declare fields.<\/p>\n<p>There are many examples in the project repository. This is not a tutorial, but rather an introduction. Basically what you do is you inherit from FXFormViewController to create a form view controller. <\/p>\n<pre>\r\n#import \"RRBaseTableViewController.h\"\r\n#import \"FXForms.h\"\r\n\r\n@interface RRBaseAddResumeViewController : FXFormViewController  \r\n<\/pre>\n<p>And you create a form object inheriting NSObject, that conforms to FXForm protocol. <\/p>\n<p><strong>Header file:<\/strong><\/p>\n<pre>\r\n#import <Foundation\/Foundation.h>\r\n#import <FXForms.h>\r\n\r\ntypedef NS_ENUM(NSInteger, Gender)\r\n{\r\n  GenderMale = 0,\r\n  GenderFemale\r\n};\r\n\r\n\r\n@interface RRCreateResumeForm : NSObject <FXForm>\r\n\r\n@property (nonatomic, copy) NSString *surname;\r\n@property (nonatomic, copy) NSString *name;\r\n@property (nonatomic, copy) NSDate *birthday;\r\n@property (nonatomic, assign) Gender gender;\r\n\r\n@end\r\n<\/pre>\n<p><strong>Implementation file:<\/strong><\/p>\n<pre>\r\n#import \"RRCreateResumeForm.h\"\r\n\r\n@implementation RRCreateResumeForm\r\n\r\n\r\n- (NSArray *)fields\r\n{\r\n  return @[\r\n           @{FXFormFieldKey: @\"surname\", FXFormFieldTitle: @\"\u0424\u0430\u043c\u0438\u043b\u0438\u044f\"},\r\n           @{FXFormFieldKey: @\"name\", FXFormFieldTitle: @\"\u0418\u043c\u044f\"},\r\n           @{FXFormFieldKey: @\"birthday\", FXFormFieldTitle: @\"\u0414\u0430\u0442\u0430 \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f\"},\r\n           @{FXFormFieldKey: @\"gender\", FXFormFieldOptions: @[@\"\u041c\u0443\u0436\u0441\u043a\u043e\u0439\", @\"\u0416\u0435\u043d\u0441\u043a\u0438\u0439\"], FXFormFieldTitle: @\"\u041f\u043e\u043b\"}\r\n           ];\r\n}\r\n\r\n@end\r\n<\/pre>\n<p>And this is how you <strong>stick FormViewController with it&#8217;s Form<\/strong>: <\/p>\n<pre>\r\n- (void)createResumeClicked:(id)sender\r\n{\r\n  RRCreateResumeViewController *createResumeViewController = [[RRCreateResumeViewController alloc] init];\r\n  RRCreateResumeForm *form = [[RRCreateResumeForm alloc] init];\r\n  createResumeViewController.formController.form = form;\r\n  \r\n  [self.navigationController pushViewController:createResumeViewController animated:YES];\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I think the best way to create forms in iOS is by using FXForms open-source project. It can be found in Github. There are some alternatives, but only FXForms support iOS 6. However, FXForms is still not flexible enough. So, if you want to create something completely custom by design, probably, it will not be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[86,187],"class_list":["post-2184","post","type-post","status-publish","format-standard","hentry","category-ios","tag-fxforms","tag-ios"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The best way to create Forms in iOS<\/title>\n<meta name=\"description\" content=\"I think the best way to create forms in iOS is by using FXForms open-source project.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.alwawee.ru\/?p=2184\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The best way to create Forms in iOS\" \/>\n<meta property=\"og:description\" content=\"I think the best way to create forms in iOS is by using FXForms open-source project.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.alwawee.ru\/?p=2184\" \/>\n<meta property=\"og:site_name\" content=\"Denis Kutlubaev\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/alwaweemobile\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-30T11:14:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-07-30T13:01:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.alwawee.ru\/wp-content\/uploads\/2014\/05\/FreeGreatPicture.com-18429-hd-color-background-wallpaper2.jpg\" \/>\n<meta name=\"author\" content=\"Denis Kutlubaev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Denis Kutlubaev\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184\"},\"author\":{\"name\":\"Denis Kutlubaev\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"headline\":\"The best way to create Forms in iOS\",\"datePublished\":\"2014-07-30T11:14:29+00:00\",\"dateModified\":\"2014-07-30T13:01:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184\"},\"wordCount\":175,\"commentCount\":0,\"keywords\":[\"FXForms\",\"iOS\"],\"articleSection\":[\"iOS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184\",\"name\":\"The best way to create Forms in iOS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\"},\"datePublished\":\"2014-07-30T11:14:29+00:00\",\"dateModified\":\"2014-07-30T13:01:57+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"description\":\"I think the best way to create forms in iOS is by using FXForms open-source project.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2184#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.alwawee.ru\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The best way to create Forms in iOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/\",\"name\":\"Denis Kutlubaev\",\"description\":\"iOS Development\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.alwawee.ru\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\",\"name\":\"Denis Kutlubaev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"caption\":\"Denis Kutlubaev\"},\"description\":\"iOS Developer, creator of Tornado Browser and many other popular apps\",\"sameAs\":[\"http:\\\/\\\/dennis.alwawee.com\"],\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The best way to create Forms in iOS","description":"I think the best way to create forms in iOS is by using FXForms open-source project.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.alwawee.ru\/?p=2184","og_locale":"en_US","og_type":"article","og_title":"The best way to create Forms in iOS","og_description":"I think the best way to create forms in iOS is by using FXForms open-source project.","og_url":"https:\/\/blog.alwawee.ru\/?p=2184","og_site_name":"Denis Kutlubaev","article_publisher":"https:\/\/www.facebook.com\/alwaweemobile","article_published_time":"2014-07-30T11:14:29+00:00","article_modified_time":"2014-07-30T13:01:57+00:00","og_image":[{"url":"https:\/\/blog.alwawee.ru\/wp-content\/uploads\/2014\/05\/FreeGreatPicture.com-18429-hd-color-background-wallpaper2.jpg","type":"","width":"","height":""}],"author":"Denis Kutlubaev","twitter_misc":{"Written by":"Denis Kutlubaev","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.alwawee.ru\/?p=2184#article","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/?p=2184"},"author":{"name":"Denis Kutlubaev","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"headline":"The best way to create Forms in iOS","datePublished":"2014-07-30T11:14:29+00:00","dateModified":"2014-07-30T13:01:57+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.alwawee.ru\/?p=2184"},"wordCount":175,"commentCount":0,"keywords":["FXForms","iOS"],"articleSection":["iOS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.alwawee.ru\/?p=2184#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.alwawee.ru\/?p=2184","url":"https:\/\/blog.alwawee.ru\/?p=2184","name":"The best way to create Forms in iOS","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/#website"},"datePublished":"2014-07-30T11:14:29+00:00","dateModified":"2014-07-30T13:01:57+00:00","author":{"@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"description":"I think the best way to create forms in iOS is by using FXForms open-source project.","breadcrumb":{"@id":"https:\/\/blog.alwawee.ru\/?p=2184#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.alwawee.ru\/?p=2184"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.alwawee.ru\/?p=2184#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.alwawee.ru\/"},{"@type":"ListItem","position":2,"name":"The best way to create Forms in iOS"}]},{"@type":"WebSite","@id":"https:\/\/blog.alwawee.ru\/#website","url":"https:\/\/blog.alwawee.ru\/","name":"Denis Kutlubaev","description":"iOS Development","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.alwawee.ru\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7","name":"Denis Kutlubaev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","caption":"Denis Kutlubaev"},"description":"iOS Developer, creator of Tornado Browser and many other popular apps","sameAs":["http:\/\/dennis.alwawee.com"],"url":"https:\/\/blog.alwawee.ru\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/2184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2184"}],"version-history":[{"count":0,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/2184\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}