Post

Replies

Boosts

Views

Activity

WidgetBundle with ControlWidget does not work on iOS 17
I'm trying to add a ControlWidget to my WidgetBundle like this: struct MyWidgets: WidgetBundle { var body: some Widget { if #available(iOSApplicationExtension 18.0, *) { LauncherControl() } MyLiveActivityWidget() HomeScreenWidget() LockScreenWidget() } This works exactly as expected on iOS 18. However on iOS 17 my app seems to have no widgets at all. The workaround described here (https://www.avanderlee.com/swiftui/variable-widgetbundle-configuration/) does not work either since WidgetBundleBuilder.buildBlock does not accept ControlWidget as an argument. What is the correct way to include a Control widget conditionally on iOS 18?
5
1
2k
Jul ’24
SwiftData ModelConfiguration with GroupContainer shows Data Access alert on every launch
I'm building an app which has both iOS and macOS versions along with extensions on both platforms. I want the main app to be able to share data the extension using the group container and I want the app on both platforms sync data over CloudKit. CloudKit synchronization works like a dream. The data sharing between the app and extension on iOS works also exactly as intended. However on macOS every time the app is launched I get “MyApp” would like to access data from other apps. alert dialog. I tried initializing the ModelConfiguration both with an explicit and automatic app group container identifiers. Same results.
1
0
393
Jul ’24
LockedCameraCaptureExtension how to debug?
I am building a LockedCameraCaptureExtension for my app. The example code works as expected. I am now in the process of porting my existing camera UI to the LockedCameraCaptureExtension. Currently, my custom UI is shown for a split second when I tap the control to open the LockedCameraCaptureExtension but it quickly exits back into Lock Screen. I assume my ported UI is doing something wrong. What is the recommended way to debug a LockedCameraCaptureExtension? I can't get my break points to break and os_log does not seem to log anything to Console.
4
0
441
Jul ’24
AccessoryCorner widgets with similar layout as the system calendar complication
When the system calendar complication is shown in the corner, it has the title of the upcoming event as the widget label and the time of the event as the main widget view. However the time of the event is not small and clipped to a circle like WidgetKit renders the complication but larger and curved together with the label. Is there a way to achieve the system corner complication layout with the WidgetKit complications?
1
1
966
Sep ’22
parallelizeBuildables flag can result in failed builds
My app SolarWatch has two framework targets, SolarKit for iOS and SolarKitWatch for watchOS. For the iOS app both the app and widget extension depend on SolarKit. For the watchOS app only the watch app extension used to depend of SolarKitWatch. Everything used to build fine. Today I added a widget extension for watchOS which depends on SolarKitWatch. This resulted in builds starting to fail because watch widget extension was unable to find SolarKitWatch-Swift.h during SwiftEmitModule step, using Xcode 14 beta 6 (14A5294g) According to the build timeline this failure is happening after the Planning target SolarKitWatch steps for both arm64 and arm64_32 architectures. But it seems like the SolarKitWatch-Swift.h has not been created at that step yet. One workaround is to manually build the SolarKitWatch target before building the whole app but this only works for debug builds and not archive builds. I spent half a day trying to figure this out but nothing worked except turning off parallelizeBuildables and buildImplicitDependencies. Is there a setting which I can use to enforce a build order besides turning off all parallelization?
1
0
1.3k
Aug ’22
Xcode Cloud cannot build app with multiple targets and CocoaPods
I'm trying to build my app SolarWatch on Xcode Cloud. The setup was amazing. Everything setup and ready to go within 5 minutes. But my builds fail consistently where Xcode Cloud errors out when running the following build step and results in the attached error log screenshot. Tried both with release and beta environments. Any help appreciated. Run command: 'source /Volumes/Task/ci_build.env && source /Volumes/Task/ci_plan.env && xcodebuild archive -workspace /Volumes/workspace/repository/SolarWatch.xcworkspace -scheme SolarWatch -destination generic/platform=iOS -archivePath /Volumes/workspace/build.xcarchive -derivedDataPath /Volumes/workspace/DerivedData -resultBundleVersion 3 -resultBundlePath /Volumes/workspace/resultbundle.xcresult -resultStreamPath /tmp/resultBundleStream3a2d7024-571e-4e16-969d-5b570b91d2a8.json -IDEPostProgressNotifications=YES CODE_SIGN_IDENTITY=- AD_HOC_CODE_SIGNING_ALLOWED=YES COMPILER_INDEX_STORE_ENABLE=NO -hideShellScriptEnvironment'
2
0
3.7k
Jun ’21
Showing a Catalyst UINSSceneViewController inside an NSPopover
I have an app where I grab a Catalyst UINSSceneViewController and put it as the contentViewController in an NSPopover instance. Then I show it with   @objc private func statusItemClicked(_ sender: NSStatusBarButton) {     DispatchQueue.main.async {       self.popover.show(relativeTo: sender.bounds, of: sender, preferredEdge: .minY)     }   } This works fine under Big Sur but crashes on Catalina with -[_NSPopoverWindow sceneIdentifier]: unrecognized selector sent to instance Did anybody manage to show a Catalyst view in an NSPopover in Catalina? Am I doing something wrong?
0
1
770
Nov ’20
kAFAssistantErrorDomain error codes
Are these error codes documented anywhere? Error codes 203 and 1110 seems to happen regularly. I think they mean the following: 203: some limit reached (happens very regularly when using server-side speech recognition, less often when using on-device recognition) 1110: no speech detected I have gotten a new one now: 1107 No idea what that means.
1
1
2.9k
Oct ’20
Localizable Strings from a framework not shown in Widget
I have a in-house framework that I share between the main app and the widget. The framework contains some localized strings. These strings show up in correct language in the main app but on the widget they only show up in English. I'm guessing the localized strings from the framework are not getting bundled in the widget extension. Anybody with the same problem?
2
0
3.5k
Sep ’20
Memory Footprint of SwiftUI custom Font in WidgetKit
I am building a widget for my app. Everything works as expected when using system fonts. When I try to use the custom font for my app in the Text instances in my widget, the system shots down my WidgetKit extension because it runs against the 30MB memory limit for Widgets. I have about 20 Text instances on my Widget. I initialize my font as a fileprivate global: let dinFont = Font.custom("AlteDIN1451Mittelschrift", size: 18) Then I use Text("blah blah").font(dinFont) when I setup my labels. When I only style a few text labels the widget renders fine. But when I try to use the font on all of them the widget extension is killed because of 30MB memory limit. This sounds like, .font(dinFont) is creating a copy of the font instance. Is this the expected behavior?
5
0
2k
Jul ’20