Post

Replies

Boosts

Views

Activity

Reply to Cannot import EventKitUI. Error Could not build Objective-C module
OK. I found out that EventKitUI can not be used with widget. Took me a while to learn about this. More detail. In one of my file in my main app, I use EventKitUI. And I also check the widget target in the Target Membership of this file. When I remove the checkmark everything works fine. So, in my situation I have to create another swift file in the main app and move the EventKitUI part out of my main file and put it in the newly created file. Everything is working now. Thank you.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’21
Reply to getTimeline called twice on load
Not sure if I answer your question but I found out that getTimeline gets called for each widget size. If I have only small widget (one or two or more) getTimeline called once. If I have small widget and medium widget, getTimeline called twice. If I have small, medium, large widgets, getTimeline called three times. Took me couple of days to know this. It might be helpful to you.
Topic: App & System Services SubTopic: General Tags:
Jul ’21
Reply to Running Background Tasks
If I may, I have similar situations that would like to ask. I want to be able to execute some codes from background task whenever there are changes in Eventstore (calendar/reminder). I need to update data in my app (and my widget) when this change happen. How can I do this? I can't figure out how to listen to notification from Eventstore in the background. Thank you very much, Boon
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to small business program benefit
After the approval, does 15% applies to sales happened prior to approval? I published my app without enrollment in this program. In my first few sales I see 15% cut so I thought I'm automatically enrolled. But after few weeks I see a cut more that 15%. Approx 20-30%. Then I realize maybe I should enroll in the program myself. So then I enrolled few days ago. Thank you
Dec ’21
Reply to SwiftUI Mac Catalyst how to programmatically close / minimize window
Ok. I figured it out. This might be helpful to others. Step 1 Add this to AppDelegate class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {             let configuration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)             if connectingSceneSession.role == .windowApplication {                 configuration.delegateClass = SceneDelegate.self             }             return configuration         } } Step 2 Create SceneDelegate class SceneDelegate: NSObject, ObservableObject, UIWindowSceneDelegate {     var window: UIWindow?     func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {         guard let windowScene = scene as? UIWindowScene else { return }         self.window = windowScene.keyWindow     } } Step 3. Then call it like this.... @EnvironmentObject var sceneDelegate: SceneDelegate . . . .                     if let myWindow = sceneDelegate.window {                         print(myWindow.description)                         guard let scene = myWindow.windowScene else { return }                         let options = UIWindowSceneDestructionRequestOptions()                         options.windowDismissalAnimation = .commit                         UIApplication.shared.requestSceneSessionDestruction(scene.session, options: options, errorHandler: { error in                             // TODO: - Handle error                             print("Error")                         })                     }
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’22
Reply to SwiftUI sheet dismiss warning
Forgot to add this.... I ran the exact same code on macOS and no warning at all. On Mac there is no swipe down. So the only option is clicking dismiss button on a sheet. And after clicking the dismiss, no warning. Seems to be there is a bug in iOS.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to iOS16 Widget Lock Screen show sensitive information even if .privacySensitive() is set
Hello, Sorry for such a late reply... Attached image is Apple's calendar widget when iPhone is still in Lock state. (Swipe right) It shows everything. Every widgets (calendar, reminder, email) on my iphone show information even when the phone is still locked. This includes my app as well. So I guess the problem is not with my app. However, since you said your iphone works correctly maybe it is a problem with my phone then. Thank you.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’22
Reply to iOS16 Widget Lock Screen show sensitive information even if .privacySensitive() is set
Well... I figured it out. In Settings>Face ID & Passcode. There is a toggle for "Lock Screen Widgets". This has to be turned off in order for widgets on lock screen and widgets in Today View to be redacted in Lock state. And once this toggle is turned off, .privacySensitive logic is working correctly. I have no idea when this was turned off. I don't think I turned it off but maybe I did. Curious what is the default option for this toggle...
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’22
Reply to MediaLibrary inaccessible on iOS 16.1 for Widget Extensions
This might not be related to your post but I would like reply here for reference as well. I think iOS16.1 also blocks access to calendar database as well. My widget app displays info from calendar and it stops working correctly since iOS16.1. It happens when the widget try to refresh the timeline (thus need to access calendar database). If I refresh the widget from within my app, the widget can access calendar database correctly. I have also found a post on Reddit regarding this issue - https://www.reddit.com/r/iOSBeta/comments/xgship/ios_161_b1_3rd_party_calendar_widgets_not_working/ Hope Apple will fix this soon.
Topic: Media Technologies SubTopic: General Tags:
Nov ’22
Reply to Push notification in Background works fine when App runs by Xcode, but does not work when App runs by itself.
Not sure if this relates. but I found out that when you run from Xcode (connected to Mac), it prevents app to go to Suspend. But without Xcode, the app can go to Suspend.
Replies
Boosts
Views
Activity
Jun ’21
Reply to Reload Widget when Photo Library changes
Have you found a solution to this? In my case I want to reload a widget every time a calendar changed. I have looked at background task, but it seems strange to set a specific interval time to run widget reload. Since I only need to reload when there is a notification for calendar changed.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Cannot import EventKitUI. Error Could not build Objective-C module
OK. I found out that EventKitUI can not be used with widget. Took me a while to learn about this. More detail. In one of my file in my main app, I use EventKitUI. And I also check the widget target in the Target Membership of this file. When I remove the checkmark everything works fine. So, in my situation I have to create another swift file in the main app and move the EventKitUI part out of my main file and put it in the newly created file. Everything is working now. Thank you.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to getTimeline called twice on load
Not sure if I answer your question but I found out that getTimeline gets called for each widget size. If I have only small widget (one or two or more) getTimeline called once. If I have small widget and medium widget, getTimeline called twice. If I have small, medium, large widgets, getTimeline called three times. Took me couple of days to know this. It might be helpful to you.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Running Background Tasks
If I may, I have similar situations that would like to ask. I want to be able to execute some codes from background task whenever there are changes in Eventstore (calendar/reminder). I need to update data in my app (and my widget) when this change happen. How can I do this? I can't figure out how to listen to notification from Eventstore in the background. Thank you very much, Boon
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to small business program benefit
After the approval, does 15% applies to sales happened prior to approval? I published my app without enrollment in this program. In my first few sales I see 15% cut so I thought I'm automatically enrolled. But after few weeks I see a cut more that 15%. Approx 20-30%. Then I realize maybe I should enroll in the program myself. So then I enrolled few days ago. Thank you
Replies
Boosts
Views
Activity
Dec ’21
Reply to Widgets Mac 2020
Hello, have you found a way to fix this? I have a similar situation. My widgets failed to load every time I turn on MacBook. I have to wait about 30 seconds for the widget to load.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to SwiftUI Mac Catalyst how to programmatically close / minimize window
Ok. I figured it out. This might be helpful to others. Step 1 Add this to AppDelegate class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {             let configuration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)             if connectingSceneSession.role == .windowApplication {                 configuration.delegateClass = SceneDelegate.self             }             return configuration         } } Step 2 Create SceneDelegate class SceneDelegate: NSObject, ObservableObject, UIWindowSceneDelegate {     var window: UIWindow?     func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {         guard let windowScene = scene as? UIWindowScene else { return }         self.window = windowScene.keyWindow     } } Step 3. Then call it like this.... @EnvironmentObject var sceneDelegate: SceneDelegate . . . .                     if let myWindow = sceneDelegate.window {                         print(myWindow.description)                         guard let scene = myWindow.windowScene else { return }                         let options = UIWindowSceneDestructionRequestOptions()                         options.windowDismissalAnimation = .commit                         UIApplication.shared.requestSceneSessionDestruction(scene.session, options: options, errorHandler: { error in                             // TODO: - Handle error                             print("Error")                         })                     }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to SwiftUI sheet dismiss warning
Same. I encountered the same problem. Swiping down on sheets work fine, click on a button give purple warning.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to SwiftUI sheet dismiss warning
Forgot to add this.... I ran the exact same code on macOS and no warning at all. On Mac there is no swipe down. So the only option is clicking dismiss button on a sheet. And after clicking the dismiss, no warning. Seems to be there is a bug in iOS.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Privacy redaction not working in iOS16 beta widget
I have the same problem. I believe this is iOS16 bug as Apple calendar app still not get redacted...
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to iOS16 Widget Lock Screen show sensitive information even if .privacySensitive() is set
Hello, Sorry for such a late reply... Attached image is Apple's calendar widget when iPhone is still in Lock state. (Swipe right) It shows everything. Every widgets (calendar, reminder, email) on my iphone show information even when the phone is still locked. This includes my app as well. So I guess the problem is not with my app. However, since you said your iphone works correctly maybe it is a problem with my phone then. Thank you.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to iOS16 Widget Lock Screen show sensitive information even if .privacySensitive() is set
Well... I figured it out. In Settings>Face ID & Passcode. There is a toggle for "Lock Screen Widgets". This has to be turned off in order for widgets on lock screen and widgets in Today View to be redacted in Lock state. And once this toggle is turned off, .privacySensitive logic is working correctly. I have no idea when this was turned off. I don't think I turned it off but maybe I did. Curious what is the default option for this toggle...
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to MediaLibrary inaccessible on iOS 16.1 for Widget Extensions
This might not be related to your post but I would like reply here for reference as well. I think iOS16.1 also blocks access to calendar database as well. My widget app displays info from calendar and it stops working correctly since iOS16.1. It happens when the widget try to refresh the timeline (thus need to access calendar database). If I refresh the widget from within my app, the widget can access calendar database correctly. I have also found a post on Reddit regarding this issue - https://www.reddit.com/r/iOSBeta/comments/xgship/ios_161_b1_3rd_party_calendar_widgets_not_working/ Hope Apple will fix this soon.
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Strange problem for widgets on iOS 16.1 - Cannot debug widget extension in Xcode 14.1
Any updates on this? Using Xcode 14.2 but problem is still the same. No print out from widget extension on iOS 16.1+ Need to use iOS16.0 for debugging.
Replies
Boosts
Views
Activity
Dec ’22