CopyPastor

Detecting plagiarism made easy.

Score: 1.8606050610542297; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2020-05-23
by jawadAli

Original Post

Original - Posted on 2017-11-02
by LinusGeffarth



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You can use this extension to stop swipe
extension UIPageViewController { var isPagingEnabled: Bool { get { var isEnabled: Bool = true for view in view.subviews { if let subView = view as? UIScrollView { isEnabled = subView.isScrollEnabled } } return isEnabled } set { for view in view.subviews { if let subView = view as? UIScrollView { subView.isScrollEnabled = newValue } } } } }
Usage
pageController.isPagingEnabled = false
Implementing @lee's (@user2159978's) solution as an extension:
extension UIPageViewController { var isPagingEnabled: Bool { get { var isEnabled: Bool = true for view in view.subviews { if let subView = view as? UIScrollView { isEnabled = subView.isScrollEnabled } } return isEnabled } set { for view in view.subviews { if let subView = view as? UIScrollView { subView.isScrollEnabled = newValue } } } } }
Usage: (in `UIPageViewController`)
self.isPagingEnabled = false

        
Present in both answers; Present only in the new answer; Present only in the old answer;