Post

Replies

Boosts

Views

Activity

UIVisualEffectView and UIBlurEffect under iOS 26
When tapping a UIButton I present a view controller like this: let vc = ViewController() present(vc, animated: true, completion: nil) Inside, I set a clear background with a visual effect view with a blur effect, like this: view.backgroundColor = .clear blurEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular)) //autolayout constraints for the blurEffectView view.addSubview(blurEffectView) But the background remains full white in iOS 26. How can I bring the blur+transparency back like in iOS 18? What am I doing wrong?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
197
Sep ’25
Deinitializer won't get called
I'm presenting a view controller inside a UIAction handler from the new UIButton init configuration API. But when I do it, its deinit won't get called. I'm thinking there's some sort of retain cycle? I've tried capturing [weak self] inside the closure with no success. Using the addTarget method instead, the deinit gets called as expected. What am I doing wrong? let testVC = TestViewController() lazy var testButton: UIButton = { var configuration = UIButton.Configuration.filled() //button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside) let button = UIButton(configuration: configuration, primaryAction: UIAction(handler: { action in self.present(testVC, animated: true, completion: nil) })) return button }()
1
0
604
Jun ’24
Refresh/Reload Views on watchOS with SwiftUI
I have an iOS app with a companion watchOS app. On the main app I set up an auto renewing subscription. By purchasing it you unlock the Apple Watch app. If you are not subscribed, a paywall view is shown in the watch app. If you are, you get to see the whole app. The thing is when a user completes the purchase on the main app, the watchOS view won't update. The Watch Connectivity framework is set up just fine and I get to communicate successfully to/from both devices. But to reflect the new state change, from the purchase made on the phone, I need to close the watch app and open it again. In doing so, the home page opens up and the users will finally get to navigate the app. Is there a way so that upon receiving the message from the Connectivity framework, I get to refresh/reload the view so that the user doesn't have to close the app and open it again? The pseudocode would be: I receive the object from the main app I check that the user has successfully purchased the subscription I reload the app/reload the view so that the user after tapping the app on the watch gets to see the home page with no extra steps. Thank you!
0
2
947
Jul ’23
NSSpellChecker returning an out of bounds range
I was experimenting with NSSpellChecker on a macOS app with Swift and I noticed that when there are no spelling mistakes it returns an out of bounds range, specifically one with a lowerBound equals to the max value of a 64-bit signed integer. Am I doing something wrong or is it a bug on Apple's part? let sentence = "What a beautiful world." let range = NSSpellChecker.shared.checkSpelling(of: sentence, startingAt: 0) // "What a beautiful world." range: {9223372036854775807, 0} // "What a beautiful worldk." range: {17, 6}
2
0
989
Jun ’22
UIVisualEffectView and UIBlurEffect under iOS 26
When tapping a UIButton I present a view controller like this: let vc = ViewController() present(vc, animated: true, completion: nil) Inside, I set a clear background with a visual effect view with a blur effect, like this: view.backgroundColor = .clear blurEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular)) //autolayout constraints for the blurEffectView view.addSubview(blurEffectView) But the background remains full white in iOS 26. How can I bring the blur+transparency back like in iOS 18? What am I doing wrong?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
1
Boosts
0
Views
197
Activity
Sep ’25
Deinitializer won't get called
I'm presenting a view controller inside a UIAction handler from the new UIButton init configuration API. But when I do it, its deinit won't get called. I'm thinking there's some sort of retain cycle? I've tried capturing [weak self] inside the closure with no success. Using the addTarget method instead, the deinit gets called as expected. What am I doing wrong? let testVC = TestViewController() lazy var testButton: UIButton = { var configuration = UIButton.Configuration.filled() //button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside) let button = UIButton(configuration: configuration, primaryAction: UIAction(handler: { action in self.present(testVC, animated: true, completion: nil) })) return button }()
Replies
1
Boosts
0
Views
604
Activity
Jun ’24
Refresh/Reload Views on watchOS with SwiftUI
I have an iOS app with a companion watchOS app. On the main app I set up an auto renewing subscription. By purchasing it you unlock the Apple Watch app. If you are not subscribed, a paywall view is shown in the watch app. If you are, you get to see the whole app. The thing is when a user completes the purchase on the main app, the watchOS view won't update. The Watch Connectivity framework is set up just fine and I get to communicate successfully to/from both devices. But to reflect the new state change, from the purchase made on the phone, I need to close the watch app and open it again. In doing so, the home page opens up and the users will finally get to navigate the app. Is there a way so that upon receiving the message from the Connectivity framework, I get to refresh/reload the view so that the user doesn't have to close the app and open it again? The pseudocode would be: I receive the object from the main app I check that the user has successfully purchased the subscription I reload the app/reload the view so that the user after tapping the app on the watch gets to see the home page with no extra steps. Thank you!
Replies
0
Boosts
2
Views
947
Activity
Jul ’23
NSSpellChecker returning an out of bounds range
I was experimenting with NSSpellChecker on a macOS app with Swift and I noticed that when there are no spelling mistakes it returns an out of bounds range, specifically one with a lowerBound equals to the max value of a 64-bit signed integer. Am I doing something wrong or is it a bug on Apple's part? let sentence = "What a beautiful world." let range = NSSpellChecker.shared.checkSpelling(of: sentence, startingAt: 0) // "What a beautiful world." range: {9223372036854775807, 0} // "What a beautiful worldk." range: {17, 6}
Replies
2
Boosts
0
Views
989
Activity
Jun ’22