Hiding the master view controller with UISplitViewController in iOS8

后端 未结 10 997
囚心锁ツ
囚心锁ツ 2020-12-12 19:06

I have an iOS7 application, which was based on the Xcode master-detail template, that I am porting to iOS8. One area that has changed a lot is the UISplitViewControlle

10条回答
  •  忘掉有多难
    2020-12-12 19:50

    Swift 4 update:

    Insert it into prepare(for segue: ...

    if splitViewController?.displayMode == .primaryOverlay {
        let animations: () -> Void = {
            self.splitViewController?.preferredDisplayMode = .primaryHidden
        }
        let completion: (Bool) -> Void = { _ in
            self.splitViewController?.preferredDisplayMode = .automatic
        }
        UIView.animate(withDuration: 0.3, animations: animations, completion: completion)
    }
    

提交回复
热议问题