MANI
March 27, 2020, 1:42am
1
Hello, everytime I launch my simulator and press my navigationlink nothing happens. When I Close the simulator I get an error in AppDelegate. the error says Thread 1: signal SIGTERM on line 12
Here is a copy from the console
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGTERM
frame #0: 0x00007fff51af125a libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x00007fff51af15d0 libsystem_kernel.dylib`mach_msg + 60
frame #2: 0x00007fff23da14d5 CoreFoundation`__CFRunLoopServiceMachPort + 165
frame #3: 0x00007fff23d9c107 CoreFoundation`__CFRunLoopRun + 1383
frame #4: 0x00007fff23d9b884 CoreFoundation`CFRunLoopRunSpecific + 404
frame #5: 0x00007fff38b5ac1a GraphicsServices`GSEventRunModal + 139
frame #6: 0x00007fff48c19220 UIKitCore`UIApplicationMain + 1605
* frame #7: 0x0000000107af6e8b AppEllerSannhet`main at AppDelegate.swift:12:7
frame #8: 0x00007fff519b910d libdyld.dylib`start + 1
(lldb)
It’s very difficult, if not impossible, to diagnose problems like this without seeing the code that caused it.
MANI
March 27, 2020, 4:36pm
3
This is the Code for my navigation link
import SwiftUI
struct ContentView: View {
var body: some View {
ZStack {
Rectangle()
.foregroundColor(Color("darkPink"))
.edgesIgnoringSafeArea(.all)
Rectangle()
.foregroundColor(Color("lightPink"))
.rotationEffect(Angle(degrees: 45))
.edgesIgnoringSafeArea(.all)
NavigationLink(destination: KortStokk()) {
Text("App!")
.background(LinearGradient(gradient: Gradient(colors: [Color("darkRed"), Color("lightRed")]), startPoint: .leading, endPoint: .trailing))
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Alexis
March 27, 2020, 6:02pm
4
Hello. Navigation link only works when the view is in NavigationView.
NavigationView{
ZStack {
Rectangle()
.foregroundColor(Color("darkPink"))
.edgesIgnoringSafeArea(.all)
Rectangle()
.foregroundColor(Color("lightPink"))
.rotationEffect(Angle(degrees: 45))
.edgesIgnoringSafeArea(.all)
NavigationLink(destination: KortStokk()) {
Text("App!")
.background(LinearGradient(gradient: Gradient(colors: [Color("darkRed"), Color("lightRed")]), startPoint: .leading, endPoint: .trailing))
}
}
}
}
}
After you embed your code in a NavigationView {} you will notice a bug in the simulators that I am surprised that Apple still have not fixed.
The bug is that after tapping on a NavigationLink and then returning to that screen you can’t select that same link again. If you have multiple NavigationLinks then you can select a different one, come back and then select the other one again.