To run the example project, clone the repo, and run pod install
from the Example directory first.
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.
-
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
-
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>
-
Add container zip file to project
-
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
-
Load prototype in view controller. In viewDidLoad for example:
self.loadPrototypePage("PAGE_ID")
-
Optional: Preload prototype (e.g. in AppDelegate)
PrototypeController.sharedInstance.preloadPrototypes(nil)
Stefan Kofler, grafele@gmail.com
Prototyper is available under the MIT license. See the LICENSE file for more info.