For others encountering this issue, the more generic way to solve this problem is to choose the format that satisfies your desired conditions.
For example, if you wanted to choose a format in 720p and compatible with 60 fps, you could do the following:
let frameDuration = CMTimeMake(value: 1, timescale: 60)
// Get format that is 720p resolution and is compatible with 60 fps.
let format = device.formats.first {
let dimensions = $0.formatDescription.dimensions
let hasCompatibleFrameRateRange = $0.videoSupportedFrameRateRanges.contains {
$0.minFrameRate <= 60 && 60 <= $0.maxFrameRate
}
return dimensions.width == 1280 && dimensions.height == 720 && hasCompatibleFrameRateRange
}
if let format = format {
device.activeFormat = format
device.activeVideoMinFrameDuration = frameDuration
device.activeVideoMaxFrameDuration = frameDuration
}
Post
Replies
Boosts
Views
Activity
Unfortunately while Apple does let you make a fake in-app purchase with a regular Apple ID in a TestFlight app, you'll then have no way of managing your subscription.
To be able to have a full Sandbox experience where you can manage your subscription, you'll need to log out of your regular Apple ID on your device, and then log in with your Sandbox Apple ID. Then purchase the subscription in your app, and it should now use your Sandbox Apple ID, and after the purchase you'll now be able to manage your subscription.
Yeah sadly you can't use an Optional value with a Picker in the same simple way you can normally do for Enum types. Instead, you need must tag each item casted as an Optional value. Here's an example from this SO answer to the question: Picker for optional data type in SwiftUI?:
struct FruitView: View {
@State private var fruit: Fruit?
var body: some View {
Picker(selection: $fruit, label: Text("Fruit")) {
Text("No fruit").tag(nil as Fruit?)
ForEach(Fruit.allCases) { fruit in
Text(fruit.rawValue).tag(fruit as Fruit?)
}
}
}
}
For me, after the build disappeared, I just had to wait 10 minutes or so and then the build reappeared and was processing again, and eventually succeeded.
Me too! It's been happening for me with Xcode 13.2.1 and 13.3.1, and I think even with some versions of Xcode 12.
For me this happened because I moved my Xcode project into a file path that included a folder with an apostrophe in the name. Renaming the folder to remove the apostrophe fixed it so that the warnings now appear in the Xcode toolbar.