uipageviewcontroller

UIPageViewController returns no Gesture Recognizers in iOS 6

偶尔善良 提交于 2019-12-17 06:34:12
问题 I am trying to disable the pan gesture recognizer for a UIPageViewController. On iOS 5 I can loop through them and disable them. for (UIGestureRecognizer* recognizer in self.pageViewController.gestureRecognizers) { if ([recognizer isKindOfClass:[UIPanGestureRecognizer class]]) { recognizer.enabled = NO; } } On iOS 6 using UIPageViewControllerTransitionStyleScroll there are no gesture recognizers returned by the Page View Controller. Clarification This can be boiled down to: self

no page control displayed even after implementing delegate methods

前提是你 提交于 2019-12-14 03:32:39
问题 Page view controller not display after adding delegate and datasource. how to implement pageViewController Datasource and delegate import UIKit DataSource class PageViewController: UIPageViewController ,UIPageViewControllerDataSource,UIPageViewControllerDelegate { func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { let vc = storyboard?.instantiateViewController(withIdentifier: "vc") as! ViewController

Call both of After and Before Method in UIPageViewController when swim for forward in Swift 3 iOS

瘦欲@ 提交于 2019-12-13 12:23:49
问题 I made UIPageViewController with datasource array and it's works correctly. But when swiping to right for forwarding call both of After and Before methods. My codes is here: import UIKit class MainPageViewController: UIPageViewController,UIPageViewControllerDataSource { override func viewDidLoad() { super.viewDidLoad() self.dataSource = self initUPageVC(idx:0,isAnimate:false,direction: UIPageViewControllerNavigationDirection.forward) } func pageViewController(_ pageViewController:

How to pass data between two ViewController in UIPageViewController

末鹿安然 提交于 2019-12-13 05:01:15
问题 I have two UIViewControllers, A and B, I connect them within a UIPageViewController: Here is how it looks in the Storyboard: I don't know how to pass data to B from A. 回答1: Well assume you have some class (which you should have provided) like: class MyModel { var dataFromFirstController: Any? var dataFromSecondController: Any? var sharedData: Any? } Now you need a subclass of page view controller which is the one that controls the data so override view did load to create a model: var myModel:

UIPageViewController - first rotation resets views to initial page?

夙愿已清 提交于 2019-12-12 12:27:57
问题 I am trying to understand Apple's default template for a Page-based application. That template shows a sort of calendar with one page for each month of the year. When compiling the template without any changes, I noticed something odd. When the app launches, it displays in portrait mode, and when - after flipping through some of the pages (say, to June) - you change the rotation, it reloads in landscape mode showing two pages, BUT STARTING WITH JANUARY. This happens only once, though. On

In UIPageViewController, when “pageViewController:viewControllerBeforeViewController”get called?

二次信任 提交于 2019-12-12 12:14:06
问题 I try to display photos in UIPageViewController . Firstly I display my photos in a collection view and then tap one photo to enter page view. When I'm in page view, however, if I scroll the currently photo(to right or left), I find that both pageViewController:viewControllerBeforeViewController and pageViewController:viewControllerAfterViewController method will be called(by calling NSLog I found it). Should just one of the two methods be called once? I am quite confused by this and have big

How to properly advance a PageViewController in Swift

孤街浪徒 提交于 2019-12-12 06:24:44
问题 I am trying to develop a tutorial in Swift. I have a page view controller working with the indicators (http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/) but I want to add a button to go to the next page by clicking it instead of swiping the screen (TODO NextPage). I've tried: let startVC = self.viewControllerAtIndex(self.index + 1) as TutorialContentViewController let viewControllers = NSArray(object: startVC) self.pageViewController.setViewControllers(viewControllers as!

iOS - PageView controller with UITableView resize error

筅森魡賤 提交于 2019-12-12 03:37:39
问题 I have a controller with two UIViews the first one have 200 of height(constant across all iPhones) and the second one UIViews contain a PageViewController and should get the rest of the height and it does. The problems come when the UITableView get the data, It resize the UIView , with the resize, the UIView now have more height than it should have ( because tableView resized it) and I am not able to scroll to the last object. Example: Height screen = 600 First UIView = 200; Second UIView =

Unable Correctly to Add Navigation Buttons Using UIPageViewController for iOS

流过昼夜 提交于 2019-12-12 02:44:00
问题 For my project UIPageViewController could be a good choice, so, I started with the template provided by XCode 6.4 starting new project. I used the template: Page-Based Application which has already the basic implementation of UIPageViewController. The opportunity to scroll the pages is working fine, however, I would like to add the navigation bar as well. After reading the articles on that topic I tried to embed DataViewController into NavigationController (Editor>Embed), and then added the

Swift dynamic cast failed UIPageViewController

萝らか妹 提交于 2019-12-12 02:05:42
问题 I am trying to cast my window.rootViewController as a UIPageViewController but anytime I access the class property which I defined it blows up with swift dynamic cast failed . My storyboard has a UIPageViewController is the initial scene. PageViewController is just a subclass of UIPageViewController class AppDelegate: UIResponder, UIApplicationDelegate, UIPageViewControllerDataSource { var window: UIWindow! var pageViewController: PageViewController { return window.rootViewController as