Sha256: baf75d296d016e7199a7fd6680786d0ad1fc5d4aa60d96371429a215b2de5f39

Contents?: true

Size: 674 Bytes

Versions: 3

Compression:

Stored size: 674 Bytes

Contents

module SugarCube
  module Modal
    module_function
    def present_modal(view_ctlr, &block)
      UIApplication.sharedApplication.keyWindow.rootViewController.presentViewController(view_ctlr, animated:true, completion:block)
    end

    def present_modal_in_nav(view_ctlr, &block)
      ctlr = UINavigationController.alloc.initWithRootViewController(view_ctlr)
      ctlr.modalTransitionStyle = UIModalTransitionStyleCoverVertical

      SugarCube::Modal.present_modal(ctlr, &block)
      ctlr
    end

    def dismiss_modal(&block)
      UIApplication.sharedApplication.keyWindow.rootViewController.dismissViewControllerAnimated(true, completion:block)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sugarcube-0.11.3 lib/sugarcube/modal.rb
sugarcube-0.11.2 lib/sugarcube/modal.rb
sugarcube-0.11.1 lib/sugarcube/modal.rb