uipageviewcontroller

Preload next page in UIPageViewController

笑着哭i 提交于 2019-12-05 23:56:47
问题 I've looked many, many places and have yet to find some good sample code showing how to pre-load the "next" page in a UIPageViewController. There are a few answers on SO detailing some theoretical ways to do it (see this question) but no one has yet to post a working example. In the workflow of my app I'm showing 1 page per screen and I want to have the "next" screen preloaded because as it is, swiping to the next page can be very slow, sometimes requiring 2 swipes (if you swipe too fast) in

UIPageViewController with Peeking

大兔子大兔子 提交于 2019-12-05 23:56:37
问题 I'm trying to create a page browser by using a UIPageViewController in Interface Builder that allows displaying part of the adjacent pages (aka peeking). I've been following a tutorial at http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/ (and ported it into Swift) which is rather straightforward but I can't quite figure out what changes to make to have a page displayed in the UIPageViewController which is smaller than the screen (and centered) and having the adjacent pages

PageViewController showing a black screen

久未见 提交于 2019-12-05 23:53:00
In storyboard I have a UIPageViewController and this is my code class ReservedTimesViewController: UIPageViewController { override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } } extension ReservedTimesViewController: UIPageViewControllerDataSource { func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier:

UIPageviewController - Change from two page mode to one page mode without changing orientation

白昼怎懂夜的黑 提交于 2019-12-05 21:02:11
I am using UIPageViewController to show two view controllers at a time. After showing a couple of such views, i want to show single view controllers without changing orientation, it is fixed to landscape. I am making in iPad. Below is the code i am using for this: -(id)initWithViewControllers:(NSMutableArray *)Controllers { self = [super initWithNibName:nil bundle:nil]; if(self) { self.VControllers = Controllers; pageController = [[UIPageViewController alloc]initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:

Swipe to delete on a tableView that is inside a pageViewController

时光毁灭记忆、已成空白 提交于 2019-12-05 19:03:57
问题 I've got a tableView inside of a pageViewController and when swiping on a cell to bring up the option to delete the cell the gesture is only recognized under certain circumstances, say you swiped very quickly and aggressively. I imagine this is happening because it's not sure whether the swiping gesture is meant for the pageView or the tableView . Is there a way to specifically determine where the swipe gesture is happening to enable a nice smooth display of the delete button? 回答1: I had the

UIPageViewControllerDatasource calling both swipe left and swipe right methods

坚强是说给别人听的谎言 提交于 2019-12-05 12:12:28
If viewControllerBeforeViewController viewControllerAfterViewController either of the method returns nil the counter part is also called. Is this behaviour expected behaviour ? Any way i can stop this from happening. This is what I am tried to do . - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController { if ([viewController isKindOfClass:[QuestionViewController class]]){ QuestionViewController* qvc = (QuestionViewController*)viewController; CVPQuestion* prevQuestion = [_surveyContext

Disable UIPageViewController Swipe - Swift

*爱你&永不变心* 提交于 2019-12-05 11:55:16
In my project i use UIPageViewController to swipe between 5 child UIViewController. In some of child view controller, i need to disable the swipe gesture of the UIPageViewController so when user swipe it not change to other view. So how i can disable the swipe from the child view controller? Appreciate for help..thanks In your page view controller, add following override func viewDidLoad(){ super.viewDidLoad() NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(yourpageviewcontroller.enableSwipe(_:)), name:"enableSwipe", object: nil) NSNotificationCenter.defaultCenter()

UIButton across all pages of UIPageViewController

偶尔善良 提交于 2019-12-05 11:19:38
I am working on an iPhone app, and created a UIPageViewController (lets call it the container ), which contains a number of UIViewController pages (lets call them the subpages ). The subpages transition style is scroll. Now, what I like to do is create a button on the top right corner of the container and NOT in the subpages . The idea is, the button will stay on screen when the subpages scroll from one page to the other. If I create the button in one of the subpages , then each subpage will have its own button, and the button will scroll with the subpages . I want to keep the button without

UIPageViewController and removing current view controller

烂漫一生 提交于 2019-12-05 09:40:46
I setup UIPageViewController to forward and backward through some view controllers . I have a problem which is when a view controller adds to UIPageViewController the memory usage will increase until the compiler gives me Received memory warning and then app runs too slowly until the app empties the memory and works fine again . How can I navigate through view controllers without increasing memory ? or better to say how can remove current view controller when a new on adds . here is my code : // Create the page view controller. self.pageViewController = [self.storyboard

Set timer to UIPageViewController

筅森魡賤 提交于 2019-12-05 07:29:02
问题 I'm trying to have the UIPageViewController navigate through the pages for every 5 seconds. How to do this in Swift? Is there any way to explicitly call viewControllerAfterViewController ? var timer = NSTimer.scheduledTimerWithTimeInterval(5, target: self, selector: Selector("update"), userInfo: nil, repeats: true) func update() -> UIViewController { // can u please tell me what to add here } func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController