Connect with Apple engineers to discuss the latest Apple technologies announced at WWDC21.

Posts under WWDC21 tag

27 Posts

Post

Replies

Boosts

Views

Activity

I'm unable to use the withTaskCancellaionHandler without a static analysis error
Hi, We have an API that I'm trying to prototype some async await extensions for. Most of our asynchronous methods are cancelable by returning an object that implements our AGSCancelable protocol that includes a cancel() method. Here's the code I have to try to extend a geocoding method on our AGSLocatorTask class: extension AGSLocatorTask { func geocode(withSearchText text: String) async throws -> [AGSGeocodeResult] { typealias GeocodeContinuation = CheckedContinuation<[AGSGeocodeResult], Error> var cancelable: AGSCancelable? return try await withTaskCancellationHandler(handler: { cancelable?.cancel() }, operation: { return try await withCheckedThrowingContinuation({ (continuation: GeocodeContinuation) in cancelable = self.geocode(withSearchText: text) { results, error in if let error = error { continuation.resume(throwing: error) } else { continuation.resume(returning: results!) } } }) }) } } This works great, but I have to comment out the cancelable?.cancel() call or else I get a Reference to captured var 'cancelable' in concurrently-executing code static analysis error (see attached screenshot). Could someone explain how to fix this, or is this a bug in the Xcode beta? Many thanks, and thanks for a great WWDC!!
4
0
1.8k
Dec ’21
Live Text capability
We have a question with respect to the Live Text feature shown in the Keynote. Is there an API or Framework available for this? Also, if there is a Framework/API available can we leverage it on macOS?
1
0
3.4k
Dec ’21
Manually set Safari 15 tab color-theme to my website
Hello. I was wondering if there is any way to manually set the Safari 15 tab color-theme color to my website. It seems like Safari automatically choose the color but I find out that this selection occurs during the first seconds of website load and, because of that, the color being choosen is not the right one for my website. Is there any CSS I could add or a metatag that tells safari which color it should pick? I know this is kinda a wierd request, but I want to provide my visitors the richest experience they could get. Thank you.
2
0
17k
Dec ’21
iOS 15, accelerate module, armv7, Xcode 13
Hi Team, Attempting to build our app with Xcode 13 / iOS 15, and getting a fail during archive, appearing to come from within the accelerate module. The two errors are: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/swift/Accelerate.swiftmodule/armv7-apple-ios.swiftinterface:591:6: error: enum cases with associated values cannot be marked potentially unavailable with '@available'   @available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)    ^ in a number of places, and the following one, once: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/swift/Accelerate.swiftmodule/armv7-apple-ios.swiftinterface:1:1: error: failed to build module 'Accelerate'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5 (swiftlang-1300.0.17.216 clang-1300.0.18.1)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.19.104 clang-1300.0.18.4)'). Please select a toolchain which matches the SDK. // swift-interface-format-version: 1.0 ^ This is Version 13.0 beta (13A5154h), doing a release build archive (dev build/run succeeds if that helps). Any insights into whats going on would be great? Cheers.
18
0
14k
Dec ’21
I'm unable to use the withTaskCancellaionHandler without a static analysis error
Hi, We have an API that I'm trying to prototype some async await extensions for. Most of our asynchronous methods are cancelable by returning an object that implements our AGSCancelable protocol that includes a cancel() method. Here's the code I have to try to extend a geocoding method on our AGSLocatorTask class: extension AGSLocatorTask { func geocode(withSearchText text: String) async throws -> [AGSGeocodeResult] { typealias GeocodeContinuation = CheckedContinuation<[AGSGeocodeResult], Error> var cancelable: AGSCancelable? return try await withTaskCancellationHandler(handler: { cancelable?.cancel() }, operation: { return try await withCheckedThrowingContinuation({ (continuation: GeocodeContinuation) in cancelable = self.geocode(withSearchText: text) { results, error in if let error = error { continuation.resume(throwing: error) } else { continuation.resume(returning: results!) } } }) }) } } This works great, but I have to comment out the cancelable?.cancel() call or else I get a Reference to captured var 'cancelable' in concurrently-executing code static analysis error (see attached screenshot). Could someone explain how to fix this, or is this a bug in the Xcode beta? Many thanks, and thanks for a great WWDC!!
Replies
4
Boosts
0
Views
1.8k
Activity
Dec ’21
Live Text capability
We have a question with respect to the Live Text feature shown in the Keynote. Is there an API or Framework available for this? Also, if there is a Framework/API available can we leverage it on macOS?
Replies
1
Boosts
0
Views
3.4k
Activity
Dec ’21
Manually set Safari 15 tab color-theme to my website
Hello. I was wondering if there is any way to manually set the Safari 15 tab color-theme color to my website. It seems like Safari automatically choose the color but I find out that this selection occurs during the first seconds of website load and, because of that, the color being choosen is not the right one for my website. Is there any CSS I could add or a metatag that tells safari which color it should pick? I know this is kinda a wierd request, but I want to provide my visitors the richest experience they could get. Thank you.
Replies
2
Boosts
0
Views
17k
Activity
Dec ’21
iOS 15, accelerate module, armv7, Xcode 13
Hi Team, Attempting to build our app with Xcode 13 / iOS 15, and getting a fail during archive, appearing to come from within the accelerate module. The two errors are: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/swift/Accelerate.swiftmodule/armv7-apple-ios.swiftinterface:591:6: error: enum cases with associated values cannot be marked potentially unavailable with '@available'   @available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)    ^ in a number of places, and the following one, once: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/swift/Accelerate.swiftmodule/armv7-apple-ios.swiftinterface:1:1: error: failed to build module 'Accelerate'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5 (swiftlang-1300.0.17.216 clang-1300.0.18.1)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.19.104 clang-1300.0.18.4)'). Please select a toolchain which matches the SDK. // swift-interface-format-version: 1.0 ^ This is Version 13.0 beta (13A5154h), doing a release build archive (dev build/run succeeds if that helps). Any insights into whats going on would be great? Cheers.
Replies
18
Boosts
0
Views
14k
Activity
Dec ’21