0

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:

Connection Inspector View

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!

Cristik
  • 30,989
  • 25
  • 91
  • 127
grehce
  • 199
  • 2
  • 15
  • Could you give the error message in console when this happens? – Larme Aug 02 '18 at 16:10
  • @cristik Thank you! Smart clarification. Fix: I removed the extra Case 4 parameter (swipeDown) since I hadn't used it for that main view controller. 2018-08-01 23:03:09.779549-0700 Kintsugi Mindful Wellness[63589:12403287] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'goDown'' – grehce Aug 03 '18 at 20:43

1 Answers1

0

Fix: I removed the extra Case 4 parameter (swipeDown) since I hadn't used it for that main view controller.

2018-08-01 23:03:09.779549-0700 Kintsugi Mindful Wellness[63589:12403287] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'goDown''

grehce
  • 199
  • 2
  • 15