Skip to content

Latest commit

 

History

History
86 lines (64 loc) · 2.82 KB

README.md

File metadata and controls

86 lines (64 loc) · 2.82 KB

Prototyper

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

To use the Prototyper framework you need an account for the Prototyper online service. Create a new prototype and download the container file for the prototype you want to inlude in your app.

Installation

  1. Integrate Prototyper Cocoapod

    pod 'Prototyper'

    To guarantee that you can configure prototypes directly in Interface Builder add the following lines at the end of your Podfile:

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.new_shell_script_build_phase.shell_script = "mkdir -p $PODS_CONFIGURATION_BUILD_DIR/#{target.name}"
            target.build_configurations.each do |config|
                config.build_settings['CONFIGURATION_BUILD_DIR'] = '$PODS_CONFIGURATION_BUILD_DIR'
            end
        end
    end
  2. Add App transport security exception for localhost:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>localhost</key>
            <dict>
                <key>NSTemporaryExceptionAllowsInsecureHTTPSLoads</key>
                <false/>           
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>1.0</string>
                <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
        </dict>
    </dict>
  3. Add container zip file to project

  4. Create ViewController for every prototype page you want to show and make it a subclass of PrototypeViewController (Don’t forget to import Prototyper module)

    import Prototyper
  5. Load prototype in view controller. In viewDidLoad for example:

    self.loadPrototypePage("PAGE_ID")
  6. Optional: Preload prototype (e.g. in AppDelegate)

    PrototypeController.sharedInstance.preloadPrototypes(nil)

Author

Stefan Kofler, [email protected]

License

Prototyper is available under the MIT license. See the LICENSE file for more info.