I'm new to Swift and am getting a Thread 1: signal SIGABRT error.
Expected: I'm using swiping navigation for elements on the main view controller page: left (Reflection), right (Goals), and up (Insights).
Actual: Left and right work as expected; however, up triggers the SIGABRT error.
I've read this StackOverflow thread, and I don't seem to have any incomplete outlets, but I'm also not clear if each triggered segue needs an accompanying presenting segue or if so, how to add that correctly:
Below is the main view controller called "ViewController2"
//MAIN
class ViewController2: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
leftSwipe.direction = UISwipeGestureRecognizer.Direction.left
self.view.addGestureRecognizer(leftSwipe)
let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
rightSwipe.direction = UISwipeGestureRecognizer.Direction.right
self.view.addGestureRecognizer(rightSwipe)
let upSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
upSwipe.direction = UISwipeGestureRecognizer.Direction.up
self.view.addGestureRecognizer(upSwipe)
}
Here is the up view controller called "ViewController3"
//INSIGHTS
class ViewController3: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let upSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
upSwipe.direction = UISwipeGestureRecognizer.Direction.up
self.view.addGestureRecognizer(upSwipe)
}
- Insights has the appropriate ViewController3 class
- Main points to ViewController2 class
- The storyboard segue identifier from Main to Insights is named "goUp"
Thanks for your advice and help!