Post

Replies

Boosts

Views

Activity

CLLocationManager didUpdateLocations called in an infinite loop on macOS Sequoia, despite no startUpdatingLocation called
In my app, I need a one-time location update, which I do with CLLocationManager’s requestLocation(). On iOS, it works fine, but on macOS Sequoia, the CLLocationManagerDelegate’s didUpdateLocations function is called indefinitely in the loop, until I call stopUpdatingLocation() on a manager. This should not be necessary unless I was calling startUpdatingLocation (which I am not), and seems like a newly introduced bug in Sequoia (or Xcode 16). So, just a heads-up to everyone, it's necessary to call stopUpdatingLocation() after obtaining the location (or on error).
1
0
328
Sep ’24
NetworkMonitor.isConnected is always false on the watchOS
I tried building some app logic around NetworkMonitor.isConnected in my watch app (I want to trigger an update when the user opens the app and isConnected == true, otherwise observe NetworkMonitor.isConnected until it changes to true), and I found out that on a real device, NetworkMonitor.isConnected is always false. This does not seem to be documented anywhere. Am I right in assuming NetworkMonitor is not to be trusted on the watch? watchOS version is 18. I found an old post where eskimo argues that NWPathMonitor is not useful on the watch (which is also not documented), is it the same for NetworkMonitor? https://forums.developer.apple.com/forums/thread/127080
1
0
270
Sep ’24
WidgetKit Refresh Policy: onOverrideList == 1
I have an iOS app with widgetkit extension, and the widgets stopped updating. I attached the console, and saw these lines for widgets of my app: com.apple.widget.myApp::myWidgetKind::-6207022974507159915:417E34:[ {name: Widget Refresh Policy, policyWeight: 0.010, response: {Decision: Must Not Proceed, Score: 0.00, Rationale: [{onOverrideList == 1 AND IndividualBalance == -1}]}} ], FinalDecision: Must Not Proceed} The IndividualBalance == -1 apparently means that the app was updating widgets too often, but what about onOverrideList == 1? There seems to be no info online about this flag, and LLMs seem to suggest that the app got onto some kind of Apple's blacklist for updating too often, is that right?
0
0
505
Mar ’24
"unknown option: -make_mergeable" when building a dynamic library as mergeable in Xcode 15
I have extracted a part of my app into a framework, which I have been building as a static library (mach-o type=static library). This has been inflating the app size, as the framework has been statically linked into both app & widget targets. I have switched the framework to dynamic library, set to build it as a mergeable library, set the app targets to 'create merged library: automatic'. Unfortunately, my release builds now fail with "unknown option: -make_mergeable" in Xcode 15 beta 8. This happens in "Link " step during a framework build. Debug builds work OK. How can I fix this?
3
0
1.2k
Sep ’23
Are old (CLKComplicationDataSource-based) complications still supported in new extensionless Watch targets?
Hello, I am migrating a watch app from older dual watch-app/watch-extension targets to a new extensionless target, but my complications seem to have lost the ability to update. I have set the CLKComplicationPrincipalClass key in Info.plist to my ComplicationController class (class ComplicationController: NSObject, CLKComplicationDataSource), but while the previews inside the complication picker show up correctly, the complications themselves stopped working on the watchface. Namely, they don't redraw anymore, when I refresh them like this: let complicationServer = CLKComplicationServer.sharedInstance() if let activeComplications = complicationServer.activeComplications { for complication in activeComplications { complicationServer.reloadTimeline(for: complication) } } Is there something I am missing? Some way of registering the CLKComplicationDataSource instance in SwiftUI watch app definition? Or is this not supported, and the only way forward is to rewrite all ClockKit complications to WidgetKit ones?
4
0
2.2k
Nov ’22
How to custom draw the icon for .accessoryInline lock screen widget?
Hello, I am trying to custom draw the .accessoryInline lock screen widget. When I return a Label() from a widget View, like this Label("Snow", systemImage: "snow"), the icon draws just fine, but once I try to draw my own icon, the icon doesn't show. My drawing code (simplified): public struct IconTestView: View { private func makePath(size: CGSize) -> UIBezierPath { let path = UIBezierPath() path.move(to: CGPoint(x: size.width * 0.5, y: 0)) path.addLine(to: CGPoint(x: size.width, y: size.height * 0.5)) path.addLine(to: CGPoint(x: size.width * 0.5, y: size.height)) path.addLine(to: CGPoint(x: 0, y: size.height * 0.5)) path.addLine(to: CGPoint(x: size.width * 0.5, y: 0)) path.close() return path } public var body: some View { GeometryReader { geo in Path( makePath(size: geo.size).cgPath ) .stroke( .white, style: StrokeStyle(lineWidth: 2.0, lineCap: .round, lineJoin: .round) ) .frame(width: geo.size.width, height: geo.size.height) } /// geo .frame(idealWidth: .infinity, maxWidth: .infinity, idealHeight: .infinity, maxHeight: .infinity) } } My widget then looks like this: var body: some View { Label { Text("Hello world") } icon: { IconTestView() } } The IconTestView() draws a diamond shape inside .accessoryCircular just fine, but nothing is drawn in .accessoryInline when I return the above label. Is this scenario just not supported (= I can only pick the icon out of SF symbols), or is there a way to do this?
0
1
938
Sep ’22
Xcode Cloud: All builds get stuck in Archive action - all tasks are green, but the action stays running for 10+ hours or until killed
All of my builds get stuck on Archive action - it keeps running forever (10+ hours where it took 30 minutes before for a clean build), and never finishes despite having all subtasks finished (green check). This started to happen on a workflow that has worked reliably for months, right after WWDC22 start - is there a problem with a new version of Xcode Cloud?
4
1
2.6k
Jun ’22
Crash on "Library not loaded: /usr/lib/swift/libswiftCloudKit.dylib" in WatchOS 9 and iOS 16 simulators when using CloudKit
I found out that for some reason, /Library/Developer/CoreSimulator/Volumes/watchOS_20R5287q/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 9.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCloudKit.dylib is not a file, but a symlink to /System/Library/Frameworks/CloudKit.framework/CloudKit - which is a folder, not a file, and as a result, any app that uses CloudKit crashes instantly after start on my WatchOS 9 and iOS 16 simulators. On WatchOS 8.5 and iOS 15.5 sim everything works. Can you confirm if this is a known bug? I tried redownloading the simulators, but the result is same.
3
1
2.2k
Jun ’22