Posts

Post not yet marked as solved
5 Replies
2.1k Views
When marking the ViewController and the function with @MainActor, the assertion to check that the UI is updated on main thread fails. How do I guarantee that a function is run on Main Thread when using @MainActor? Example code: import UIKit @MainActor class ViewController: UIViewController {     let updateObject = UpdateObject()     override func viewDidLoad() {         super.viewDidLoad()                  updateObject.fetchSomeData { [weak self] _ in             self?.updateSomeUI()         }     }     @MainActor     func updateSomeUI() {         assert(Thread.isMainThread) // Assertion failed!     } } class UpdateObject {     func fetchSomeData(completion: @escaping (_ success: Bool) -> Void) {         DispatchQueue.global().async {             completion(true)         }     } } Even changing DispatchQueue.global().async to Task.detached does not work. Tested with Xcode 13.2.1 and Xcode 13.3 RC
Posted
by BAR115.
Last updated
.
Post not yet marked as solved
0 Replies
515 Views
We would like to tell a user that we have an Apple Watch app in our iOS app but we don't want to uses that have an Apple Watch paired that is not supported. We can look at WCSession.default.isPaired to know that some kind of watch is paired, and we can use WCSession.default.isWatchAppInstalled to know that our app is not installed on the watch. Although we want to know if the watch is even supported. Example: A user has an Apple Watch Series 3 paired, but our app only supports watchOS 9. How do we avoid telling that user about an our app that they are not even able to install on that watch?
Posted
by BAR115.
Last updated
.
Post marked as solved
1 Replies
1.2k Views
We are trying to symbolicate crashes that happen in our included static libraries but it appears that the symbols are removed. Does anyone know hoe to include the the bitcode symbols from a static library? I have tried many of the Build Settings and none seem to keep the symbols. Example from a bcsymbolmap with Kingfisher as the static library: _$s10Kingfisher0A17ParsedOptionsInfoV11targetCacheAA05ImageF0CSgvpMV __hidden#4023_ __hidden#4024_ __hidden#4025_ __hidden#4026_ __hidden#4027_ __hidden#4028_ _$s10Kingfisher16ImageProgressiveVMn __hidden#4029_ __hidden#4030_ __hidden#4031_ All the rest of the symbols for the rest of the codebase are present.
Posted
by BAR115.
Last updated
.
Post not yet marked as solved
0 Replies
771 Views
Attempting to play a video using WKInterfaceInlineMovie will cause the audio route to change on the iPhone, causing music and other audio to pause. This happens when using AirPods with an iPhone when an Apple Watch is connected. Does anyone know how to fix this? I have also tried setting the AVAudioSession category on the watch, but the output still gets taken from the iOS device. There is no audio on the video nor am I interested in playing any audio from the watch.
Posted
by BAR115.
Last updated
.
Post not yet marked as solved
4 Replies
947 Views
This works fine when the local network permissions are allowed but not when the permission is denied. Simply trying to print or set the newConnectionHandler to nil on the listener will result in a crash. Does anyone know why this happens? Crash: Exception Type:	EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001e6cd3234 Termination Signal: Trace/BPT trap: 5 Termination Reason: Namespace SIGNAL, Code 0x5 Terminating Process: exc handler [50016] Triggered by Thread:	0 Thread 0 name: Thread 0 Crashed: 0	 libsystem_platform.dylib			 0x00000001e6cd3234 _os_unfair_lock_corruption_abort + 36 (lock.c:524) 1	 libsystem_platform.dylib			 0x00000001e6cd1164 _os_unfair_lock_lock_slow + 320 (lock.c:575) 2	 libnetwork.dylib							 0x00000001a070e02c nw_listener_set_new_connection_handler + 92 (listener.m:128) 3	 (setting newConnectionHandler to nil) Note that we have already added NSLocalNetworkUsageDescription and a NSBonjourServices tcp We see that we are unable to check the status of the Local Network permissions but maybe there is another way to mitigate getting the crash when trying to clear out our listener.
Posted
by BAR115.
Last updated
.
Post not yet marked as solved
1 Replies
668 Views
I created a NWBrowser and when listening to the stateUpdateHandler callback, it always returns error "-65563: ServiceNotRunning". It indicates that the "Background daemon not running". Is there something else that needs to be set up in order for this to work, or is NWBrowser not actually available on watchOS? NSBrowser is listed as available on watchOS 6+, why would this not be able to used? https://developer.apple.com/documentation/network/nwbrowser
Posted
by BAR115.
Last updated
.
Post marked as solved
1 Replies
800 Views
CoreML fails to link and compile the build when trying to use any of its methods in a watchOS app. Error: Undefined symbols for architecture i386:   "_OBJC_CLASS_$_MLPredictionOptions", referenced from:       objc-class-ref in ExtensionDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) Steps to reproduce: Create a new watchOS app Add import CoreML to ExtensionDelegate Add let _ = MLPredictionOptions() to ExtensionDelegate Attempt to compile the project Any assistance would be helpful!
Posted
by BAR115.
Last updated
.
Post not yet marked as solved
2 Replies
848 Views
Our app uses multiple AVPlayers at once, some with video, and some with just audio. When trying to airplay it appears that only one of the AVPlayers can play at a time. Is there a setting for the Apple TV to just work as an external audio output rather than it attempting to play a particular AVPlayerItem. We would like all the audios to mix together. Screen Mirroring works ok, but we cant expect all our users to go through the process to enable that and some will select audio airplay.
Posted
by BAR115.
Last updated
.