diff --git a/Tusker/Screens/Timeline/TimelinesPageViewController.swift b/Tusker/Screens/Timeline/TimelinesPageViewController.swift index 129b5057..eacb7f7b 100644 --- a/Tusker/Screens/Timeline/TimelinesPageViewController.swift +++ b/Tusker/Screens/Timeline/TimelinesPageViewController.swift @@ -85,7 +85,7 @@ class TimelinesPageViewController: SegmentedPageViewController NSUserActivity? { - return (currentViewController as! TimelineViewController).stateRestorationActivity() + return (currentViewController as? TimelineViewController)?.stateRestorationActivity() } func restoreActivity(_ activity: NSUserActivity) { diff --git a/Tusker/Screens/Utilities/SegmentedPageViewController.swift b/Tusker/Screens/Utilities/SegmentedPageViewController.swift index dd44ff92..30c1f6d8 100644 --- a/Tusker/Screens/Utilities/SegmentedPageViewController.swift +++ b/Tusker/Screens/Utilities/SegmentedPageViewController.swift @@ -23,8 +23,8 @@ class SegmentedPageViewController: UIPage var currentIndex: Int! { pages.firstIndex(of: currentPage) } - var currentViewController: UIViewController { - viewControllers!.first! + var currentViewController: UIViewController! { + viewControllers?.first } let segmentedControl = ScrollingSegmentedControl()