I have a third party framework 'serviceCommon' built using Xcode 12.5.1 (12E507). When I try to build my app which links to this framework, Xcode 13 beta 4(13A5201i) fails with the following error (FYI. Xcode 12.5.1 is able to build this app fine).
Failed to build module 'serviceCommon'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.27.6 clang-1300.0.27.2)'). Please select a toolchain which matches the SDK.
Post
Replies
Boosts
Views
Activity
I have following SwiftUI code, which makes a connection (to the server) when the user navigates to this page (this is a part of navigation stack), and disconnects when the user navigate away (up).
struct ServiceView: View {
@ObservedObject var state:ServiceState
var body: some View {
ScrollView(.vertical) {
VStack {
...
NavigationLink(
destination: ChildPage(state: state),
label: {
Text("Child Page")
})
}
}
.onAppear() {
state.connection.connect()
}
.onDisappear() {
state.connection.disconnect()
}
}
}
This works fine as long as the user stays on this page, but breaks when the user clicks the "Child Page" link, because .onDisappear() event will be triggered when the user navigates down as well.
Is there any way to distinguish two different scenarios (navigate up and down)?
I recently joined a development team (team B) as a "Developer" using the same Apple ID I am using to manage my own team (team A, as "Account Holder"). I see this new team (B) when I access the Apple's Developer site, and switch between A and B from the Account menu.
When I open the Xcode project from the new team, Xcode indicates that the team is unknown, displaying "Unknown Name (KV7...)" in red (under Signing & Capabilities tab).
When I click the "View Accounts...", I see my Apple ID on left, and only my own team (A) on right, not the new team (B) I have just joined.
When I removed my Apple ID from it, and re-added it, Xcode detects only my own team (A), but not the new team (B). I restarted Xcode, but still don't see the new team (B) in the list.
Do you have any idea why Xcode does not recognize another team? Is there any additional step to let Xcode recognize the new team?
Following code updates the values in the "numbers" array properly when I touch the "increment" button (I see the updated value when I go back), but the display on the leaf page (Text inside NavigationLink) does not update immediately for some reason (if I go back and navigate back to the leaf page again, it displays the updated value).
I'd appreciate if somebody could tell me why it does not update correctly.
import SwiftUI
struct NumberHolder: Identifiable {
		let id = UUID()
		let value:Int
}
struct Playground: View {
		@State var numbers:[NumberHolder] = [
				NumberHolder(value:1),
				NumberHolder(value:2),
				NumberHolder(value:3),
				NumberHolder(value:4),
		]
		var body: some View {
				NavigationView {
						List(numbers.indices) { index in
								let number = numbers[index]
								NavigationLink(destination: VStack {
										Text("Number \(number.value)")
										Button("Increment") {
												numbers[index] = NumberHolder(value: number.value + 1)
										}
								} ) {
										Text("Number \(number.value)")
								}
						}
				}
		}
}
struct Playground_Previews: PreviewProvider {
		static var previews: some View {
				Playground()
		}
}
I have noticed that the memory usage of my MacOS app increases about 84MB when I use VNDetectHumanHandPoseRequest, and this extra memory usage remains even after I release all associated objects.
I was able to create a small sample code, which reproduces this behavior.
https://github.com/snakajima/HandPose/tree/main
@IBAction func toggleGesture(_ sender:NSMenuItem) {
gestureEnabled = !gestureEnabled
sender.state = gestureEnabled ? .on : .off
if gestureEnabled {
handPoseRequest = VNDetectHumanHandPoseRequest()
} else {
handPoseRequest = nil
}
}
public func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
guard let request = handPoseRequest else {
return
}
let handler = VNImageRequestHandler(cmSampleBuffer: sampleBuffer, orientation: .up, options: [:])
do {
try handler.perform([request])
let results = request.results
if let count = results?.count, count > 0 {
print("results.count", count)
}
} catch {
print("Vision Error", error.localizedDescription)
}
}
I am following the instruction on "Restoring Developer Transition Kit" to restore it (because my Xcode installation is broken). When I select the "Restore" on Apple Configurator in the step 4, it fails with the following error.
The operation couldn’t be completed. (AMRestoreErrorDomain error 10 - Failed to handle message type StatusMsg) [AMRestoreErrorDomain – 0xA (10)]