Posts

Post marked as solved
1 Replies
1.3k Views
I have an application whose base deployment is currently iOS 11. I'd like to create a new widget with WidgetKit that supports all of the cool new features in iOS 14. That requires WidgetKit and iOS 14. Is it possible to have my app target iOS 11 AND have my widget target iOS 14? IOW, have different deployment targets in the same app?
Posted
by hmlong.
Last updated
.
Post not yet marked as solved
8 Replies
4.5k Views
So you can put a NavigationButton in a NavigationView and use the button destination to push a new View on the stack. Cool.You can click the "back" button in the nav bar to go back. Also cool.But how in the world do you "pop" the view programatically, say, like when a user hits a submit button and you've validated his entry?
Posted
by hmlong.
Last updated
.
Post not yet marked as solved
1 Replies
2.3k Views
If you use the following test code and call CombineTest.test(), you'll get a notification that the d2 value captured in subscribe is released.If you comment out t.cancellable?.cancel() , you will not get the release notification, even when CombineTest() goes out of scope.According to demo, Cancellable should automatically cancel on deinit.```class Deinit { let n: Int init(_ n: Int) { self.n = n } deinit { print("deinit - \(n)") }}class CombineTest { let d1 = Deinit(1) let subject = CurrentValueSubject<Int, Never>(0) var cancellable: Cancellable? func subscribe() { let d2 = Deinit(2) cancellable = subject .sink { value in print("\(value) \(d2.n)") } } static func test() { let t = CombineTest() t.subscribe() t.subject.send(1) t.subject.send(2) t.cancellable?.cancel() }}```
Posted
by hmlong.
Last updated
.