Post

Replies

Boosts

Views

Activity

Xcode 13.2.1: Crash about swift::Demangle/ResolveAsSymbolicReference when use SwiftUI if-available
I found a problem with the latest Xcode 13.2/13.2.1 when compiling SwiftUI if-#available structure. When building with Release mode, the app always crashes on an older system. import SwiftUI struct ContentView: View {   var body: some View {     List {       if #available(iOS 15.0, *) {         Text("Hello").badge(1)       } else {         Text("Hello") // 💥 always crash: iOS 14 + release mode       }     }   } } Sample crash log: OS Version: iPhone OS 14.8.1 (18H107) Release Type: User Baseband Version: n/a Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4328914944 ... Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [54802] Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 libswiftCore.dylib 0x00000001b0a74750 swift::ResolveAsSymbolicReference::operator()(swift::Demangle::__runtime::SymbolicReferenceKind, swift::Demangle::__runtime::Directness, int, void const*) + 124 (MetadataValues.h:1263) 1 libswiftCore.dylib 0x00000001b0a96018 swift::Demangle::__runtime::Demangler::demangleSymbolicReference(unsigned char) + 212 (functional:1880) 2 libswiftCore.dylib 0x00000001b0a92d04 swift::Demangle::__runtime::Demangler::demangleType(__swift::__runtime::llvm::StringRef, std::__1::function<swift::Demangle::__runtime::Node* (swift::Demangle::__runtime::SymbolicReferenceKind, swi... + 200 (Demangler.cpp:589) 3 libswiftCore.dylib 0x00000001b0a7a660 swift_getTypeByMangledNameImpl(swift::MetadataRequest, __swift::__runtime::llvm::StringRef, void const* const*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsi... + 496 (MetadataLookup.cpp:69) 4 libswiftCore.dylib 0x00000001b0a77ab0 swift::swift_getTypeByMangledName(swift::MetadataRequest, __swift::__runtime::llvm::StringRef, void const* const*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, u... + 604 (CompatibilityOverride.def:153) ...
13
1
12k
Apr ’22
SwiftUI NavigationLink unexpectly pops itself in very simple use case (iOS 15 only)
I just discovered that the following simple code snippet has a very confusing behavior on iOS 15.0-15.1. When I go to the NavigationLink, the child page pops up unexpectly once the app goes into the background and reopens. This issue does not happen on iOS 14. struct ContentView: View {   var body: some View {     NavigationView {       TabView {         NavigationLink {           Text("👀 Go to background. This view will pop.")         } label: {           Text("Push")         }       }     }     .navigationViewStyle(.stack)   } } You may have noticed that I have nested the TabView in the NavigationView, and this issue is related to this structure. Like many social apps such as Telegram and WeChat, I believe nesting TabView in NavigationView is a widely used structure. I am very hopeful that this issue will be resolved.
1
0
800
Dec ’21