The Settings app crashes on launch for me on the iOS 15 iPhone 15 Pro simulator.
Version 15.0 (1015.2)
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My problem is similar to this post but switching to an iOS 17 simulator does not fix the issue.
As far as I know there should be no OS_ACTIVITY_DT_MODE set anywhere in my project but I'm not sure exactly where to check.
I've tried in Beta 6 and 7 so far and I've set all of my minimums to iOS 17.
Given the following code, if line 17 isn't present there'll be a crash upon presenting the sheet.
Since content shouldn't be nil at the time of presentation, why does this crash?
import SwiftUI
struct ContentView: View {
@State private var isPresented = false
@State private var content: String?
@State private var startTask = false
var body: some View {
Text("Tap me")
.onTapGesture {
startTask = true
}
.task(id: startTask) {
guard startTask else { return }
startTask = false // <===== Crashes if removed
content = "Some message"
isPresented = true
}
.sheet(isPresented: $isPresented) {
Text(content!)
}
}
}
iOS 16.4, Xcode 14.3.1
When passing an empty closure to a LibraryItem's snippet parameter, unexpected extra text is added to the file when the item is dragged in from the Xcode library.
Expected:
.setAction {
}
Actual:
.setAction /*@START_MENU_TOKEN@*/{
}/*@END_MENU_TOKEN@*/
Full code:
import SwiftUI
struct ContentView: View {
var body: some View {
MyView()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
struct MyView: View {
var action: (() -> Void)?
var body: some View {
Text("MyView")
.onTapGesture {
action?()
}
}
func setAction(_ action: @escaping () -> Void) -> MyView {
var copy = self
copy.action = action
return copy
}
}
struct LibraryContent: LibraryContentProvider {
func modifiers(base: MyView) -> [LibraryItem] {
[
LibraryItem(
base.setAction {
},
title: "MyView - Set action"
)
]
}
}
FB11936092
macOS 13.0.1 (22A400)
Xcode 14.1 (14B47b)