0

I have a case when parameter should have been UIViewController! to map from objc properly, but it is, sadly, UIViewController.

This

func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController currentVC: UIViewController) -> UIViewController? {
    guard unsafeAddressOf(currentVC).hashValue != 0 else { // 31316097 filed with apple

feels a bit fragile. hashValue might map to 0 for pointers other than 0x0. How do I make an unsafe pointer for NULL to compare unsafeAddressOf(currentVC) against?

Swift 2.3 in case it's a typical lets do with for swift 2 but but but we have made it much, much better in swift 3! Kind of answer is required.

Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66

1 Answers1

-1

currentVC can't be nil. It's not an Optional type.

Alexander
  • 59,041
  • 12
  • 98
  • 151