turbo-native-initializer 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 893bf3c34e0baf61bb3ee5b7ce006ce9946bddc156bb8d95ea9a255d01c93d7e
4
- data.tar.gz: 8d9677132ab1956eba6332539cddec223b6f66ffac6e5ed9b766553d104344bc
3
+ metadata.gz: e673a3e9e9ff4dcab50c3e68a188dc5b71e4660065f87b6dd45006c3e99a43b1
4
+ data.tar.gz: c8a1d14e548b6a3fcea40b78329dc5a6721081b56fd45337c669b2a5611ec6e7
5
5
  SHA512:
6
- metadata.gz: b25e7862afa00d50783f259dceb567a439b807832e2f73984033f80aef10de767e13fc3c6f75b764ba32651a5974d5ebed19cacf368d3c37283f7bb329649c23
7
- data.tar.gz: eeaccd07971c2472b78a2b4f1eaff2828f25f23fecad3043d2047de013d636a17ebfc2f7691d45c8acd45a3b7335966b9953530512f7e92010150f641aee40c0
6
+ metadata.gz: d06d7f520ae5c86136456042c46ef38b4c73961a47dee135b16c9d2232022545c8bb6b3a9fd197d98191a8d9745dcfda46d30a1eb076dc1c512f26d997fda0de
7
+ data.tar.gz: 3c63e69becdc8853f775cbd947714f0cb3822cbcbe35a7205afe7dfb00063665fb77791ad778215287aea5005b8e7308dee98f8ee83ff7ee1297cd45d2b0da4e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.7] - 2023-09-09
4
+
5
+ - Small refactor in the NumbersViewController (iOS)
6
+
3
7
  ## [0.0.6] - 2023-09-09
4
8
 
5
9
  - Fix android template imports
data/README.md CHANGED
@@ -8,8 +8,8 @@ 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 `clear-all`, `replace-all`, `replace`, `pop`, `refresh`, and `none`. (iOS)
12
- - Added visitable property in order to avoid visits. (iOS)
11
+ - Added presentations `pop`, `refresh`, `none`, `replace`, `clear-all`, and `replace-all`. (iOS)
12
+ - Added `visitable` property in order to avoid visits. (iOS)
13
13
  - Added support for tab navigation. (iOS/Android)
14
14
 
15
15
  ## Installation
@@ -1,16 +1,9 @@
1
1
  import SwiftUI
2
2
 
3
3
  class NumbersViewController: UIHostingController<NumbersView> {
4
- init() {
5
- super.init(rootView: NumbersView())
6
- }
7
-
8
- required init(coder aDecoder: NSCoder) {
9
- fatalError("init(coder:) has not been implemented")
10
- }
11
-
12
- override func viewDidLoad() {
13
- super.viewDidLoad(); title = "Numbers"
4
+ convenience init(title: String) {
5
+ self.init(rootView: NumbersView())
6
+ self.title = title
14
7
  }
15
8
  }
16
9
 
@@ -52,7 +52,7 @@ extension TurboNavigationController {
52
52
 
53
53
  private func isClearAll(_ properties: PathProperties) -> Bool {
54
54
  return properties["presentation"] as? String == "clear-all"
55
- }
55
+ }
56
56
 
57
57
  private func isReplaceAll(_ properties: PathProperties) -> Bool {
58
58
  return properties["presentation"] as? String == "replace-all"
@@ -75,13 +75,13 @@ extension TurboNavigationController {
75
75
  if let viewController = properties["view-controller"] as? String {
76
76
  switch viewController {
77
77
  case "numbers":
78
- return NumbersViewController()
78
+ return NumbersViewController(title: "Numbers")
79
79
  default:
80
- return ViewController(url: url)
80
+ assertionFailure("Invalid view controller, defaulting to WebView")
81
81
  }
82
- } else {
83
- return ViewController(url: url)
84
82
  }
83
+
84
+ return ViewController(url: url)
85
85
  }
86
86
 
87
87
  private func navigate(to viewController: UIViewController, action: VisitAction, properties: PathProperties = [:]) {
@@ -1,16 +1,9 @@
1
1
  import SwiftUI
2
2
 
3
3
  class NumbersViewController: UIHostingController<NumbersView> {
4
- init() {
5
- super.init(rootView: NumbersView())
6
- }
7
-
8
- required init(coder aDecoder: NSCoder) {
9
- fatalError("init(coder:) has not been implemented")
10
- }
11
-
12
- override func viewDidLoad() {
13
- super.viewDidLoad(); title = "Numbers"
4
+ convenience init(title: String) {
5
+ self.init(rootView: NumbersView())
6
+ self.title = title
14
7
  }
15
8
  }
16
9
 
@@ -52,7 +52,7 @@ extension TurboNavigationController {
52
52
 
53
53
  private func isClearAll(_ properties: PathProperties) -> Bool {
54
54
  return properties["presentation"] as? String == "clear-all"
55
- }
55
+ }
56
56
 
57
57
  private func isReplaceAll(_ properties: PathProperties) -> Bool {
58
58
  return properties["presentation"] as? String == "replace-all"
@@ -75,13 +75,13 @@ extension TurboNavigationController {
75
75
  if let viewController = properties["view-controller"] as? String {
76
76
  switch viewController {
77
77
  case "numbers":
78
- return NumbersViewController()
78
+ return NumbersViewController(title: "Numbers")
79
79
  default:
80
- return ViewController(url: url)
80
+ assertionFailure("Invalid view controller, defaulting to WebView")
81
81
  }
82
- } else {
83
- return ViewController(url: url)
84
82
  }
83
+
84
+ return ViewController(url: url)
85
85
  }
86
86
 
87
87
  private func navigate(to viewController: UIViewController, action: VisitAction, properties: PathProperties = [:]) {
@@ -1,3 +1,3 @@
1
1
  module TurboNativeInitializer
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-10 00:00:00.000000000 Z
11
+ date: 2023-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor