turbo-native-initializer 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46eebca0f11beac2c27299db10976cf4b04357f916ebf9c37937b3e507e71bf3
4
- data.tar.gz: 44102e1778c14329bb09a79049896af94ef1004f42ec8c4a9b226a65d713f790
3
+ metadata.gz: 6833f8bad7eb840005b6b4112a54ba0fc0356eff5fef5549b20e80f207beabd1
4
+ data.tar.gz: 120c51e582c425132d8be00d420b3fb73127adff18ec73e428909d6ebc6e42f4
5
5
  SHA512:
6
- metadata.gz: 6f3989992aa8b01214daf9843df3a850af00b534e38e499acd01492ecbb5af7dabdba75e683af38e4cfddcd911696f96677879b887290110d1b57e9acca56cef
7
- data.tar.gz: 4c0323cb1d7b990fdcbe3ca6baf9230363f9310b11c0a652fc482b9eef32e2699c1a9f80591cc3db3c512284c551a45d7e70f8f7b592843c883f7d8e00efff62
6
+ metadata.gz: 12c27f3b351fb8785ed41661f4e69a1499d3a34e4d8b0acbc501319e317104f19adb359c15de56c680340698f9a4e83070e41699b3bb2cf308f365a534d8de10
7
+ data.tar.gz: ad5de54e453e5c61ff58ba4498017592ed18d1665c97aa972d2345db22d539d1233b026d9e4b6b2df79c25a569567f59cb0a159eeeb8515aea0b44fa0bbd338f
data/README.md CHANGED
@@ -8,7 +8,7 @@ A turbo native project generator for iOS and Android.
8
8
  - Added SwiftUI numbers example screen. (iOS)
9
9
  - Added Jetpack Compose numbers example screen. (Android)
10
10
  - Added UIAlertController to handle `data-turbo-confirm`. (iOS)
11
- - Added presentations `pop`, `refresh`, `none`, `replace`, `clear-all`, and `replace-all`. (iOS)
11
+ - Added presentations `back`, `refresh`, `none`, `replace`, `clear-all`, and `replace-all`. (iOS)
12
12
  - Added `visitable` property in order to avoid visits. (iOS)
13
13
  - Added support for tab navigation. (iOS/Android)
14
14
  - Added support for flash messages. (iOS/Android)
@@ -9,7 +9,7 @@ class TurboNavigationController : UINavigationController {
9
9
 
10
10
  func push(url: URL) {
11
11
  let properties = session.pathConfiguration?.properties(for: url) ?? [:]
12
- route(url: url, options: VisitOptions(action: .advance), properties: properties)
12
+ route(url: url, options: .init(action: .advance), properties: properties)
13
13
  }
14
14
 
15
15
  func route(url: URL, options: VisitOptions, properties: PathProperties) {
@@ -123,9 +123,9 @@ extension TurboNavigationController {
123
123
  } else if isReplaceAll(properties) {
124
124
  setViewControllers([viewController], animated: false)
125
125
  } else if isReplace(properties) {
126
- setViewControllers(Array(viewControllers.dropLast()) + [viewController], animated: false)
126
+ setViewControllers(viewControllers.dropLast() + [viewController], animated: false)
127
127
  } else if action == .replace {
128
- setViewControllers(Array(viewControllers.dropLast()) + [viewController], animated: false)
128
+ setViewControllers(viewControllers.dropLast() + [viewController], animated: false)
129
129
  } else {
130
130
  pushViewController(viewController, animated: true)
131
131
  }
@@ -13,10 +13,12 @@ final class SceneDelegate: UIResponder {
13
13
  // MARK: - Setup
14
14
 
15
15
  private func configureRootViewController() {
16
- navigationController = window!.rootViewController as? TurboNavigationController
17
- navigationController.navigationBar.scrollEdgeAppearance = .init()
16
+ UINavigationBar.appearance().scrollEdgeAppearance = .init()
17
+
18
+ navigationController = TurboNavigationController()
18
19
  navigationController.session = session
19
20
  navigationController.modalSession = modalSession
21
+ window!.rootViewController = navigationController
20
22
  }
21
23
 
22
24
  // MARK: - Authentication
@@ -98,8 +100,8 @@ extension SceneDelegate: SessionDelegate {
98
100
  extension SceneDelegate: WKUIDelegate {
99
101
  func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void) {
100
102
  let confirm = UIAlertController(title: nil, message: message, preferredStyle: .alert)
101
- confirm.addAction(UIAlertAction(title: "Cancel", style: .cancel) { _ in completionHandler(false) })
102
- confirm.addAction(UIAlertAction(title: "OK", style: .default) { _ in completionHandler(true) })
103
+ confirm.addAction(.init(title: "Cancel", style: .cancel) { _ in completionHandler(false) })
104
+ confirm.addAction(.init(title: "OK", style: .default) { _ in completionHandler(true) })
103
105
  navigationController.present(confirm, animated: true)
104
106
  }
105
107
  }
@@ -5,10 +5,10 @@
5
5
  <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
6
6
  </dependencies>
7
7
  <scenes>
8
- <!--Turbo Navigation Controller-->
8
+ <!--View Controller-->
9
9
  <scene sceneID="s0d-6b-0kx">
10
10
  <objects>
11
- <viewController id="Y6W-OH-hqX" customClass="TurboNavigationController" customModuleProvider="target" sceneMemberID="viewController"/>
11
+ <viewController id="Y6W-OH-hqX" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController"/>
12
12
  <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
13
13
  </objects>
14
14
  <point key="canvasLocation" x="130" y="-2"/>
@@ -9,7 +9,7 @@ class TurboNavigationController : UINavigationController {
9
9
 
10
10
  func push(url: URL) {
11
11
  let properties = session.pathConfiguration?.properties(for: url) ?? [:]
12
- route(url: url, options: VisitOptions(action: .advance), properties: properties)
12
+ route(url: url, options: .init(action: .advance), properties: properties)
13
13
  }
14
14
 
15
15
  func route(url: URL, options: VisitOptions, properties: PathProperties) {
@@ -123,9 +123,9 @@ extension TurboNavigationController {
123
123
  } else if isReplaceAll(properties) {
124
124
  setViewControllers([viewController], animated: false)
125
125
  } else if isReplace(properties) {
126
- setViewControllers(Array(viewControllers.dropLast()) + [viewController], animated: false)
126
+ setViewControllers(viewControllers.dropLast() + [viewController], animated: false)
127
127
  } else if action == .replace {
128
- setViewControllers(Array(viewControllers.dropLast()) + [viewController], animated: false)
128
+ setViewControllers(viewControllers.dropLast() + [viewController], animated: false)
129
129
  } else {
130
130
  pushViewController(viewController, animated: true)
131
131
  }
@@ -22,18 +22,24 @@ final class SceneDelegate: UIResponder {
22
22
  // MARK: - Setup
23
23
 
24
24
  private func configureRootViewController() {
25
- tabBarController = window!.rootViewController as? UITabBarController
26
- tabBarController.tabBar.scrollEdgeAppearance = .init()
25
+ UINavigationBar.appearance().scrollEdgeAppearance = .init()
27
26
 
28
- navigationController1 = tabBarController.viewControllers![0] as? TurboNavigationController
29
- navigationController1.navigationBar.scrollEdgeAppearance = .init()
27
+ navigationController1 = TurboNavigationController()
28
+ navigationController1.tabBarItem = .init(title: nil, image: .init(systemName: "house"), tag: 0)
30
29
  navigationController1.session = session1
31
30
  navigationController1.modalSession = modalSession
32
31
 
33
- navigationController2 = tabBarController.viewControllers![1] as? TurboNavigationController
34
- navigationController2.navigationBar.scrollEdgeAppearance = .init()
32
+ navigationController2 = TurboNavigationController()
33
+ navigationController2.tabBarItem = .init(title: nil, image: .init(systemName: "house"), tag: 1)
35
34
  navigationController2.session = session2
36
35
  navigationController2.modalSession = modalSession
36
+
37
+ UITabBar.appearance().scrollEdgeAppearance = .init()
38
+
39
+ tabBarController = UITabBarController()
40
+ tabBarController.viewControllers = [navigationController1, navigationController2]
41
+
42
+ window!.rootViewController = tabBarController
37
43
  }
38
44
 
39
45
  // MARK: - Sessions
@@ -113,8 +119,8 @@ extension SceneDelegate: SessionDelegate {
113
119
  extension SceneDelegate: WKUIDelegate {
114
120
  func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void) {
115
121
  let confirm = UIAlertController(title: nil, message: message, preferredStyle: .alert)
116
- confirm.addAction(UIAlertAction(title: "Cancel", style: .cancel) { _ in completionHandler(false) })
117
- confirm.addAction(UIAlertAction(title: "OK", style: .default) { _ in completionHandler(true) })
122
+ confirm.addAction(.init(title: "Cancel", style: .cancel) { _ in completionHandler(false) })
123
+ confirm.addAction(.init(title: "OK", style: .default) { _ in completionHandler(true) })
118
124
  navigationController().present(confirm, animated: true)
119
125
  }
120
126
  }
@@ -1,52 +1,17 @@
1
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="33v-ad-2dz">
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
3
  <device id="retina6_12" orientation="portrait" appearance="light"/>
4
4
  <dependencies>
5
5
  <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
6
- <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7
6
  </dependencies>
8
7
  <scenes>
9
- <!--Turbo Navigation Controller-->
10
- <scene sceneID="GwE-Ch-DRP">
8
+ <!--View Controller-->
9
+ <scene sceneID="s0d-6b-0kx">
11
10
  <objects>
12
- <viewController id="cXb-wA-NUs" customClass="TurboNavigationController" customModuleProvider="target" sceneMemberID="viewController">
13
- <tabBarItem key="tabBarItem" title="" image="gear" catalog="system" id="rhZ-zi-yeq"/>
14
- </viewController>
15
- <placeholder placeholderIdentifier="IBFirstResponder" id="ife-PY-okT" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
11
+ <viewController id="Y6W-OH-hqX" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController"/>
12
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
16
13
  </objects>
17
- <point key="canvasLocation" x="1271" y="-647"/>
18
- </scene>
19
- <!--Turbo Navigation Controller-->
20
- <scene sceneID="pAD-IL-Hdw">
21
- <objects>
22
- <viewController id="0en-nE-vJA" customClass="TurboNavigationController" customModuleProvider="target" sceneMemberID="viewController">
23
- <tabBarItem key="tabBarItem" title="" image="house" catalog="system" id="ZWo-HO-m4a"/>
24
- </viewController>
25
- <placeholder placeholderIdentifier="IBFirstResponder" id="GRr-XE-fAM" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
26
- </objects>
27
- <point key="canvasLocation" x="1270" y="-1254"/>
28
- </scene>
29
- <!--Tab Bar Controller-->
30
- <scene sceneID="So3-hc-mhH">
31
- <objects>
32
- <tabBarController id="33v-ad-2dz" sceneMemberID="viewController">
33
- <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="fR1-GM-qEi">
34
- <rect key="frame" x="0.0" y="0.0" width="393" height="49"/>
35
- <autoresizingMask key="autoresizingMask"/>
36
- <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
37
- </tabBar>
38
- <connections>
39
- <segue destination="0en-nE-vJA" kind="relationship" relationship="viewControllers" id="z0u-hS-Voh"/>
40
- <segue destination="cXb-wA-NUs" kind="relationship" relationship="viewControllers" id="eJZ-00-JTF"/>
41
- </connections>
42
- </tabBarController>
43
- <placeholder placeholderIdentifier="IBFirstResponder" id="KRh-ez-iFz" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
44
- </objects>
45
- <point key="canvasLocation" x="364" y="-951"/>
14
+ <point key="canvasLocation" x="130" y="-2"/>
46
15
  </scene>
47
16
  </scenes>
48
- <resources>
49
- <image name="gear" catalog="system" width="128" height="122"/>
50
- <image name="house" catalog="system" width="128" height="104"/>
51
- </resources>
52
17
  </document>
@@ -1,3 +1,3 @@
1
1
  module TurboNativeInitializer
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-native-initializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-15 00:00:00.000000000 Z
11
+ date: 2023-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor