Sha256: 7c88b66a0032990f30348c576aee34f0d935c359694f7d7c5190990439789033

Contents?: true

Size: 1.6 KB

Versions: 3

Compression:

Stored size: 1.6 KB

Contents

class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)

    form = Formotion::Form.new({
      sections: [{
        title: "Register",
        rows: [{
          title: "Email",
          key: :email,
          placeholder: "me@mail.com",
          type: :email,
          auto_correction: :no,
          auto_capitalization: :none
        }, {
          title: "Password",
          key: :password,
          placeholder: "required",
          type: :string,
          secure: true
        }, {
          title: "Password",
          subtitle: "Confirmation",
          key: :confirm,
          placeholder: "required",
          type: :string,
          secure: true
        }, {
          title: "Switch",
          key: :switch,
          type: :switch,
        }]
      }, {
        title: "Account Type",
        key: :account_type,
        select_one: true,
        rows: [{
          title: "Free",
          key: :free,
          type: :check,
        }, {
          title: "Basic",
          value: true,
          key: :basic,
          type: :check,
        }, {
          title: "Pro",
          key: :pro,
          type: :check,
        }]
      }, {
        rows: [{
          title: "Sign Up",
          type: :submit,
        }]
      }]
    })

    @view_controller = Formotion::FormController.alloc.initWithForm(form)
    @view_controller.form.on_submit do |form|
        p @view_controller.form.render
      end

    @window.rootViewController = @view_controller
    @window.makeKeyAndVisible
    true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formotion-0.0.3 app/app_delegate.rb
formotion-0.0.2 app/app_delegate.rb
formotion-0.0.1 app/app_delegate.rb