I've got a UISplitViewController, but I don't want the master view 'sliding in' from the left edge of the screen when user makes a left to right swipe gesture, as I want that gesture to be exclusively used for drawing actions on a UIImageView canvas that's in the detail view controller.
I've got this code in the viewDidLoad of the detail view controller class:
let right = UISwipeGestureRecognizer(target : AppDelegate(), action : #selector(AppDelegate.rightSwipe))
right.direction = .right
self.wordImage.addGestureRecognizer(right)
and in my appDelegate class I've got:
@objc func rightSwipe(){
guard let splitViewController = self.window?.rootViewController as? UISplitViewController else {
fatalError("Missing SplitViewController")
}
splitViewController.preferredDisplayMode = .primaryHidden
}
I can swipe left to right in the canvas and it will draw a line and not slide in the master view controller (as I intended). However, the line drawing of the user's gesture only lasts a short distance until the line drawing stops. I can make an upwardish movement and draw, say, an 'S' curve and just keep on draweing, with no problem. The problem only seems to manifest when I'm making an absolutley straight line from with a left to right swipe gesture.