Post

Replies

Boosts

Views

Activity

What happens to secrets stored by apps when iCloud Keychain is turned off?
I this FAQ it says: What happens when I turn off iCloud Keychain on a device? When you turn off iCloud Keychain for a device, you're asked to keep or delete the passwords and credit card information that you saved. If you choose to keep the information, it isn't deleted or updated when you make changes on other devices. If you don't choose to keep the information on at least one device, your Keychain data will be deleted from your device and the iCloud servers.  So understand data stored by the user such as passwords is removed. What about data stored by an app installed on an iOS device? Is it removed as well? Can we assume that data stored in the keychain will not be removed by other means external to the app, or should we plan our app to handle such situation?
0
0
953
Feb ’22
How to fit AVPlayer inside a container and align it to the top
I have a following simple code to present a video on the screen. This or similar can be found on any tutorial there is about using AVplayer from UISwift. struct PlayerView: UIViewRepresentable { func updateUIView(_ uiView: UIView, context: UIViewRepresentableContext<PlayerView>) { } func makeUIView(context: Context) -> UIView { return PlayerUIView(frame: .zero) } } class PlayerUIView: UIView { private let playerLayer = AVPlayerLayer() override init(frame: CGRect) { super.init(frame: frame) let url = Bundle.main.url(forResource: "my_video", withExtension: "mp4")! let player = AVPlayer(url: url) player.play() playerLayer.player = player layer.addSublayer(playerLayer) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func layoutSubviews() { super.layoutSubviews() playerLayer.frame = bounds } } If I put PlayerView inside an VStack the view will take as much vertical space as possible based on the sizes of the other views in the stack and then will put the video inside filling it horizontally. So if it is the only view, it will always put the video in the center of the screen and leave margins below and above it. Even if I put spacer after it. Even if I put it inside GeometryReader. What I want the view to "hug" the presented video as much as possible, and then bahve as any other SwiftUI view. But I do not understand how SwiftUI does the layout in this case when AVPlayer inside UIViewRepresentable is involved.
0
0
1.1k
Apr ’23
Phased release of a version while the previous phased release is not finished
I was not able to find info regarding this situation in the official docs. What will happen if a version was not yet released to all, and a new version is phased released? For example if I am phased releasing version 2.0. On day 3, when only 5% of the users have this version, I discovered that this version has a bug. I paused the release of 2.0 and created a hotfix version 2.1. What will happen all the users who did not receive 2.0 when I start phased release of 2.1? Will they get an immediate update to 2.0 or will they skip this version?
0
1
791
May ’23
Text with standard font style appears smaller on iPadOS than on iOS
I used standard font styles in an iOS app. For example .font(.headline). I hoped that developing this way would allow the adoption of the app to other platforms, relatively easy. However, when trying to run for iPadOS, the text did not increase in size to occupy the more abundant space offered by larger screen, but it actually shrank. Overall, the app does not look great "automatically". Why does it happen? What is the best practice for cross platform development with SwiftUI (with regards to font sizes). I want to make as little as possible human interface design decisions on my own and just let SwiftUI take care of everything. (But I also want the results to look as Apple would consider great looking)
0
0
513
Oct ’24
How to connect a @Parameter of a Tip to my app's state?
I have an observable object which is a model a view. I also have a Tip (from TipKit) with @Parameter and a rule. The source of truth for the state is in the observable object, however the Tip needs to be updated when state changes. So how do I bind between the two? The way I was thinking was to sink updates from objectWillChange and check if Tips parameter needs to be updated or add didSet if it a @Published property. But I am not sure this is the best practice. Schematic example: class MyModel: ObservableObject { struct TapSubmitTip: Tip { @Parameter static var isSubmitButtonEnabled: Bool = false var title: Text { Text("Tap \"Submit\" to confirm your selection.") } var rules: [Rule] { #Rule(Self.$isSubmitButtonEnabled) { $0 == true } } } let tapSubmitTip = TapSubmitTip() var objectWillChangeCancallable: AnyCancellable! // Used by the view to enable or disable the button var isSubmitButtonEnabled: Bool { // Some logic to determine if button should be enabled. } init() { objectWillChangeCancallable = objectWillChange.sink { [weak self] void in guard let self else { return } if isSubmitButtonEnabled { TapSubmitTip.isSubmitButtonEnabled = true } } } ... // Call objectWillChange or update published properties as needed. ... }
0
0
412
Dec ’24