I\'m creating a custom navigation controller. I have something like this:
public class CustomNavigationController: UINavigationController {
// MARK: - L
I had this issue happen to users on iOS 12.4, so to do a workaround in my custom initializer I did something like this:
init(rootViewController: UIViewController, numberOfPages: Int) {
self.numberOfPages = numberOfPages
if #available(iOS 13.0, *) {
super.init(rootViewController: rootViewController)
} else {
super.init(nibName: nil, bundle: nil)
self.viewControllers = [rootViewController]
}
}
I basically initialize my class differently for every iOS version below 13. This does seem like the shortest solution.