turbo-native-initializer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/CODE_OF_CONDUCT.md +84 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +53 -0
  6. data/Rakefile +2 -0
  7. data/exe/turbo-native-initializer +3 -0
  8. data/lib/turbo-native-initializer.rb +1 -0
  9. data/lib/turbo_native_initializer/generator.rb +79 -0
  10. data/lib/turbo_native_initializer/templates/android_stack/app/.gitignore +1 -0
  11. data/lib/turbo_native_initializer/templates/android_stack/app/build.gradle.kts.tt +44 -0
  12. data/lib/turbo_native_initializer/templates/android_stack/app/proguard-rules.pro +21 -0
  13. data/lib/turbo_native_initializer/templates/android_stack/app/src/debug/AndroidManifest.xml.tt +4 -0
  14. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/AndroidManifest.xml.tt +29 -0
  15. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/assets/json/configuration.json +11 -0
  16. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/base/NavDestination.kt.tt +69 -0
  17. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebFragment.kt.tt +37 -0
  18. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebHomeFragment.kt.tt +15 -0
  19. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebModalFragment.kt.tt +17 -0
  20. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainActivity.kt.tt +18 -0
  21. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainSessionNavHostFragment.kt.tt +37 -0
  22. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Constants.kt.tt +8 -0
  23. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/anim/nav_slide_enter.xml +10 -0
  24. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/anim/nav_slide_exit.xml +7 -0
  25. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/anim/nav_slide_pop_enter.xml +15 -0
  26. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/anim/nav_slide_pop_exit.xml +15 -0
  27. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/anim/overshoot_interpolator.xml +4 -0
  28. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/drawable/ic_close.xml +5 -0
  29. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/drawable/ic_launcher_foreground.xml +17 -0
  30. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/layout/activity_main.xml.tt +17 -0
  31. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/layout/fragment_web_home.xml +36 -0
  32. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/layout/toolbar_progress.xml +13 -0
  33. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/menu/web.xml +14 -0
  34. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  35. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  36. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  37. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  38. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  39. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  40. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  41. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  42. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/values/colors.xml +5 -0
  43. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/res/values/themes.xml.tt +5 -0
  44. data/lib/turbo_native_initializer/templates/android_stack/build.gradle.kts +5 -0
  45. data/lib/turbo_native_initializer/templates/android_stack/gradle/wrapper/gradle-wrapper.jar +0 -0
  46. data/lib/turbo_native_initializer/templates/android_stack/gradle/wrapper/gradle-wrapper.properties +6 -0
  47. data/lib/turbo_native_initializer/templates/android_stack/gradle.properties +23 -0
  48. data/lib/turbo_native_initializer/templates/android_stack/gradlew +185 -0
  49. data/lib/turbo_native_initializer/templates/android_stack/gradlew.bat +89 -0
  50. data/lib/turbo_native_initializer/templates/android_stack/local.properties +10 -0
  51. data/lib/turbo_native_initializer/templates/android_stack/settings.gradle.kts.tt +17 -0
  52. data/lib/turbo_native_initializer/templates/android_tabs/app/.gitignore +1 -0
  53. data/lib/turbo_native_initializer/templates/android_tabs/app/build.gradle.kts.tt +44 -0
  54. data/lib/turbo_native_initializer/templates/android_tabs/app/proguard-rules.pro +21 -0
  55. data/lib/turbo_native_initializer/templates/android_tabs/app/src/debug/AndroidManifest.xml.tt +4 -0
  56. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/AndroidManifest.xml.tt +29 -0
  57. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/assets/json/configuration.json +11 -0
  58. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/base/NavDestination.kt.tt +69 -0
  59. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebFragment.kt.tt +29 -0
  60. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebHomeFragment.kt.tt +15 -0
  61. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebModalFragment.kt.tt +17 -0
  62. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainActivity.kt.tt +47 -0
  63. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/TabOneSessionNavHostFragment.kt.tt +37 -0
  64. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/TabTwoSessionNavHostFragment.kt.tt +37 -0
  65. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Constants.kt.tt +8 -0
  66. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/anim/nav_slide_enter.xml +10 -0
  67. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/anim/nav_slide_exit.xml +7 -0
  68. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/anim/nav_slide_pop_enter.xml +15 -0
  69. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/anim/nav_slide_pop_exit.xml +15 -0
  70. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/anim/overshoot_interpolator.xml +4 -0
  71. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/drawable/ic_close.xml +5 -0
  72. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/drawable/ic_home.xml +5 -0
  73. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/drawable/ic_launcher_foreground.xml +17 -0
  74. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/drawable/ic_settings.xml +5 -0
  75. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/layout/activity_main.xml.tt +34 -0
  76. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/layout/fragment_web_home.xml +36 -0
  77. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/layout/toolbar_progress.xml +13 -0
  78. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/menu/bottom_navigation_menu.xml +12 -0
  79. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/menu/web.xml +14 -0
  80. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  81. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  82. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  83. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  84. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  85. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  86. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  87. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  88. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/values/colors.xml +5 -0
  89. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/res/values/themes.xml.tt +5 -0
  90. data/lib/turbo_native_initializer/templates/android_tabs/build.gradle.kts +5 -0
  91. data/lib/turbo_native_initializer/templates/android_tabs/gradle/wrapper/gradle-wrapper.jar +0 -0
  92. data/lib/turbo_native_initializer/templates/android_tabs/gradle/wrapper/gradle-wrapper.properties +6 -0
  93. data/lib/turbo_native_initializer/templates/android_tabs/gradle.properties +23 -0
  94. data/lib/turbo_native_initializer/templates/android_tabs/gradlew +185 -0
  95. data/lib/turbo_native_initializer/templates/android_tabs/gradlew.bat +89 -0
  96. data/lib/turbo_native_initializer/templates/android_tabs/local.properties +10 -0
  97. data/lib/turbo_native_initializer/templates/android_tabs/settings.gradle.kts.tt +17 -0
  98. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Configuration/Info.plist +29 -0
  99. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Configuration/path-configuration.json +10 -0
  100. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/ErrorPresenter.swift +74 -0
  101. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/TurboNavigationController.swift +123 -0
  102. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/ViewController.swift +20 -0
  103. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Delegates/AppDelegate.swift +8 -0
  104. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Delegates/SceneDelegate.swift.tt +139 -0
  105. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  106. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  107. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/AppIcon.appiconset/turbo.png +0 -0
  108. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/Contents.json +6 -0
  109. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/SplashIcon.imageset/Contents.json +21 -0
  110. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/SplashIcon.imageset/turbo.png +0 -0
  111. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Base.lproj/LaunchScreen.storyboard +39 -0
  112. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Base.lproj/Main.storyboard.tt +32 -0
  113. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/TurboNativeProject.swift.tt +10 -0
  114. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject.xcodeproj/project.pbxproj.tt +436 -0
  115. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  116. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  117. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +14 -0
  118. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Configuration/Info.plist +29 -0
  119. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Configuration/path-configuration.json +10 -0
  120. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/ErrorPresenter.swift +74 -0
  121. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/TurboNavigationController.swift +123 -0
  122. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/ViewController.swift +20 -0
  123. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Delegates/AppDelegate.swift +8 -0
  124. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Delegates/SceneDelegate.swift.tt +156 -0
  125. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  126. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  127. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/AppIcon.appiconset/turbo.png +0 -0
  128. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/Contents.json +6 -0
  129. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/SplashIcon.imageset/Contents.json +21 -0
  130. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/SplashIcon.imageset/turbo.png +0 -0
  131. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Base.lproj/LaunchScreen.storyboard +39 -0
  132. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Base.lproj/Main.storyboard +69 -0
  133. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/TurboNativeProject.swift.tt +10 -0
  134. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.pbxproj.tt +436 -0
  135. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  136. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  137. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +14 -0
  138. data/lib/turbo_native_initializer/version.rb +3 -0
  139. data/lib/turbo_native_initializer.rb +5 -0
  140. metadata +199 -0
@@ -0,0 +1,139 @@
1
+ import UIKit
2
+ import WebKit
3
+ import SafariServices
4
+ import Turbo
5
+
6
+ final class SceneDelegate: UIResponder {
7
+ private static var sharedProcessPool = WKProcessPool()
8
+
9
+ var window: UIWindow?
10
+ private let rootURL = <%= name %>.homeURL
11
+ private var navigationController: TurboNavigationController!
12
+
13
+ // MARK: - Setup
14
+
15
+ private func configureRootViewController() {
16
+ guard let window = window else { fatalError() }
17
+
18
+ window.tintColor = UIColor(named: "Tint")
19
+
20
+ navigationController = (window.rootViewController as! TurboNavigationController)
21
+ navigationController.session = session
22
+ navigationController.modalSession = modalSession
23
+ }
24
+
25
+ // MARK: - Authentication
26
+
27
+ private func promptForAuthentication() {
28
+ let authURL = <%= name %>.signInURL
29
+ let properties = pathConfiguration.properties(for: authURL)
30
+ navigationController.route(url: authURL, options: VisitOptions(), properties: properties)
31
+ }
32
+
33
+ // MARK: - Sessions
34
+
35
+ private lazy var session = makeSession()
36
+ private lazy var modalSession = makeSession()
37
+
38
+ private func makeSession() -> Session {
39
+ let configuration = WKWebViewConfiguration()
40
+ configuration.applicationNameForUserAgent = "Turbo Native iOS"
41
+ configuration.processPool = Self.sharedProcessPool
42
+
43
+ let webView = WKWebView(frame: .zero, configuration: configuration)
44
+ webView.uiDelegate = self
45
+
46
+ let session = Session(webView: webView)
47
+ session.delegate = self
48
+ session.pathConfiguration = pathConfiguration
49
+ return session
50
+ }
51
+
52
+ // MARK: - Path Configuration
53
+
54
+ private lazy var pathConfiguration = PathConfiguration(sources: [
55
+ .file(Bundle.main.url(forResource: "path-configuration", withExtension: "json")!),
56
+ ])
57
+ }
58
+
59
+ extension SceneDelegate: UIWindowSceneDelegate {
60
+ func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
61
+ guard let _ = scene as? UIWindowScene else { return }
62
+
63
+ configureRootViewController()
64
+ navigationController.route(url: rootURL, options: VisitOptions(action: .replace), properties: [:])
65
+ }
66
+ }
67
+
68
+ extension SceneDelegate: SessionDelegate {
69
+ func session(_ session: Session, didProposeVisit proposal: VisitProposal) {
70
+ navigationController.route(url: proposal.url, options: proposal.options, properties: proposal.properties)
71
+ }
72
+
73
+ func session(_ session: Session, didFailRequestForVisitable visitable: Visitable, error: Error) {
74
+ if let turboError = error as? TurboError, case let .http(statusCode) = turboError, statusCode == 401 {
75
+ promptForAuthentication()
76
+ } else if let errorPresenter = visitable as? ErrorPresenter {
77
+ errorPresenter.presentError(error) { [weak self] in
78
+ self?.session.reload()
79
+ }
80
+ } else {
81
+ assertionFailure("Visit failed!")
82
+ }
83
+ }
84
+
85
+ // When a form submission completes in the modal session, we need to
86
+ // manually clear the snapshot cache in the default session, since we
87
+ // don't want potentially stale cached snapshots to be used
88
+ func sessionDidFinishFormSubmission(_ session: Session) {
89
+ if (session == modalSession) {
90
+ self.session.clearSnapshotCache()
91
+ }
92
+ }
93
+
94
+ func sessionDidLoadWebView(_ session: Session) {
95
+ session.webView.navigationDelegate = self
96
+ }
97
+
98
+ func sessionWebViewProcessDidTerminate(_ session: Session) {
99
+ session.reload()
100
+ }
101
+ }
102
+
103
+ extension SceneDelegate: WKNavigationDelegate {
104
+ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
105
+ if navigationAction.navigationType == .linkActivated {
106
+ // Any link that's not on the same domain as the Turbo root url will go through here
107
+ // Other links on the domain, but that have an extension that is non-html will also go here
108
+ // You can decide how to handle those, by default if you're not the navigationDelegate
109
+ // the Session will open them in the default browser
110
+
111
+ let url = navigationAction.request.url!
112
+
113
+ // For this demo, we'll load files from our domain in a SafariViewController so you
114
+ // don't need to leave the app. You might expand this in your app
115
+ // to open all audio/video/images in a native media viewer
116
+ if url.host == rootURL.host, !url.pathExtension.isEmpty {
117
+ let safariViewController = SFSafariViewController(url: url)
118
+ navigationController.present(safariViewController, animated: true)
119
+ } else {
120
+ UIApplication.shared.open(url)
121
+ }
122
+
123
+ decisionHandler(.cancel)
124
+ } else {
125
+ decisionHandler(.allow)
126
+ }
127
+ }
128
+ }
129
+
130
+ extension SceneDelegate: WKUIDelegate {
131
+ func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void) {
132
+ let confirm = UIAlertController(title: nil, message: message, preferredStyle: .alert)
133
+ confirm.addAction(UIAlertAction(title: "Cancel", style: .cancel) { _ in completionHandler(false) })
134
+ confirm.addAction(UIAlertAction(title: "OK", style: .default) { _ in completionHandler(true) })
135
+
136
+ // JavaScript alerts in Turbo Native
137
+ navigationController.present(confirm, animated: true)
138
+ }
139
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "idiom" : "universal"
5
+ }
6
+ ],
7
+ "info" : {
8
+ "author" : "xcode",
9
+ "version" : 1
10
+ }
11
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "filename" : "turbo.png",
5
+ "idiom" : "universal",
6
+ "platform" : "ios",
7
+ "size" : "1024x1024"
8
+ }
9
+ ],
10
+ "info" : {
11
+ "author" : "xcode",
12
+ "version" : 1
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "author" : "xcode",
4
+ "version" : 1
5
+ }
6
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "filename" : "turbo.png",
5
+ "idiom" : "universal",
6
+ "scale" : "1x"
7
+ },
8
+ {
9
+ "idiom" : "universal",
10
+ "scale" : "2x"
11
+ },
12
+ {
13
+ "idiom" : "universal",
14
+ "scale" : "3x"
15
+ }
16
+ ],
17
+ "info" : {
18
+ "author" : "xcode",
19
+ "version" : 1
20
+ }
21
+ }
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3
+ <device id="retina5_9" orientation="portrait" appearance="light"/>
4
+ <dependencies>
5
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
6
+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
7
+ <capability name="System colors in document resources" minToolsVersion="11.0"/>
8
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
+ </dependencies>
10
+ <scenes>
11
+ <!--View Controller-->
12
+ <scene sceneID="EHf-IW-A2E">
13
+ <objects>
14
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
15
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16
+ <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
17
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18
+ <subviews>
19
+ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" fixedFrame="YES" image="SplashIcon" translatesAutoresizingMaskIntoConstraints="NO" id="eXr-0W-qZz">
20
+ <rect key="frame" x="137" y="356" width="100" height="100"/>
21
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
22
+ </imageView>
23
+ </subviews>
24
+ <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
25
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
26
+ </view>
27
+ </viewController>
28
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
29
+ </objects>
30
+ <point key="canvasLocation" x="50.399999999999999" y="373.89162561576359"/>
31
+ </scene>
32
+ </scenes>
33
+ <resources>
34
+ <image name="SplashIcon" width="1024" height="1024"/>
35
+ <systemColor name="systemBackgroundColor">
36
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
37
+ </systemColor>
38
+ </resources>
39
+ </document>
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
3
+ <device id="retina6_12" orientation="portrait" appearance="light"/>
4
+ <dependencies>
5
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
6
+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
7
+ <capability name="System colors in document resources" minToolsVersion="11.0"/>
8
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
+ </dependencies>
10
+ <scenes>
11
+ <!--Turbo Navigation Controller-->
12
+ <scene sceneID="s0d-6b-0kx">
13
+ <objects>
14
+ <viewController id="Y6W-OH-hqX" customClass="TurboNavigationController" customModule="<%= name %>" customModuleProvider="target" sceneMemberID="viewController">
15
+ <view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
16
+ <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
17
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18
+ <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
19
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
20
+ </view>
21
+ </viewController>
22
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
23
+ </objects>
24
+ <point key="canvasLocation" x="130" y="-2"/>
25
+ </scene>
26
+ </scenes>
27
+ <resources>
28
+ <systemColor name="systemBackgroundColor">
29
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
30
+ </systemColor>
31
+ </resources>
32
+ </document>
@@ -0,0 +1,10 @@
1
+ import Foundation
2
+
3
+ struct <%= name %> {
4
+ private static let developmentURL = URL(string: "http://localhost:3000")!
5
+ private static let productionURL = URL(string: "https://turbo-native-demo.glitch.me")!
6
+
7
+ static var baseURL: URL { productionURL }
8
+ static var homeURL: URL { baseURL.appendingPathComponent("/") }
9
+ static var signInURL: URL { baseURL.appendingPathComponent("/signin") }
10
+ }