uipageviewcontroller

Setting becomeFirstResponder on viewController nested in PageViewController

你离开我真会死。 提交于 2020-06-28 06:22:15
问题 I have a pageViewController that has two child view controllers that you can swipe between. One of them has a textView that I want to be the first responder when you scroll onto that page, then lose focus when you scroll away. Right now I have this: override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) composeTextView.delegate = self composeTextView.becomeFirstResponder() } The keyboard shows up as soon as you start to scroll onto the view. But as soon as the

Updating an @EnvironmentObject var to pass data to PageViewController in SwiftUI results in loss of swiping between ViewControllers

情到浓时终转凉″ 提交于 2020-05-29 09:23:02
问题 In my SwiftUI app, I currently have a PageViewController implemented using UIKit. It follows the traditional SwiftUI - UIKit implementation outlined in Apple's SwiftUI UIKit integration tutorials. I have the data that populates a UIViewController, within the controllers array that is passed to the PageViewController, provided by an @Environment variable. In a different screen in the app, you can issue an action that causes the Environment object to update, triggering a re-render of a

Updating an @EnvironmentObject var to pass data to PageViewController in SwiftUI results in loss of swiping between ViewControllers

两盒软妹~` 提交于 2020-05-29 09:21:09
问题 In my SwiftUI app, I currently have a PageViewController implemented using UIKit. It follows the traditional SwiftUI - UIKit implementation outlined in Apple's SwiftUI UIKit integration tutorials. I have the data that populates a UIViewController, within the controllers array that is passed to the PageViewController, provided by an @Environment variable. In a different screen in the app, you can issue an action that causes the Environment object to update, triggering a re-render of a

UIPageView Page turn gestures got disabled when used inside UIScrollView

偶尔善良 提交于 2020-03-04 18:37:10
问题 I need to add a UIPageViewController inside UIScrollView. My view hierarchy is UIVIewController (UIView) > UIScrollVIew > UIVIew(ContentView) And inside that, I added my UIPageViewController programmatically. UIPageViewController is loaded perfectly as expected. Scrollview is scrolling as well. But its page gestures got disabled by I guess scrollview. Basically, i need UIPageView inside scrollview. I want the scrollview to scroll only vertically. And horizontal swipes should only work for

Conditional sibling of a PageView (UIPageViewController) breaks paging

断了今生、忘了曾经 提交于 2020-02-25 07:03:28
问题 I'm using this UIPageViewController implementation in SwiftUI as a starting point, but I want to have a view (eg: "OK" Text or a Button) appear above or below the PageView when currentPage is the last page. However any time I add an if statement above or below the PageView, as soon as I swipe to the second page, all other pages get removed and it becomes impossible to swipe between pages. If I take out the if logic, everything works fine. Here's the code: The PageViewController: struct

Conditional sibling of a PageView (UIPageViewController) breaks paging

吃可爱长大的小学妹 提交于 2020-02-25 07:02:05
问题 I'm using this UIPageViewController implementation in SwiftUI as a starting point, but I want to have a view (eg: "OK" Text or a Button) appear above or below the PageView when currentPage is the last page. However any time I add an if statement above or below the PageView, as soon as I swipe to the second page, all other pages get removed and it becomes impossible to swipe between pages. If I take out the if logic, everything works fine. Here's the code: The PageViewController: struct

UIPageViewController keeping previous ViewController on the Background of the view

别说谁变了你拦得住时间么 提交于 2020-01-25 00:40:14
问题 I have an UIPageViewController, that i bring up programatically, i have overwritten the viewControllerBeforeViewController and the viewControllerAfterViewController methods to dinamically create the viewcontrollers after each flip. The problem is that when i don't complete the flip page movement and the previous view controller comes back to the view, the same view controller remains on the background of the view, messing with the content i am displaying. I have tried using the callback

How to add a UIPageController and UICollectionViewController to a UIViewController programmatically

試著忘記壹切 提交于 2020-01-24 23:10:28
问题 I already have a UIViewController made programmatically, and would like at the bottom to have a collection view with 4 cells, but I want to be able to swipe through different pages of the collection view to see different cells. I'm not sure where to begin with this wether to enable paging on the collection view and how that would work with setting up the cells, or to create a page controller and adding the collection view to that? There are a couple of ways that I have seen online already,

Adding a UIPageViewController to a subview, subview only shows edge of pageContentview

别来无恙 提交于 2020-01-24 07:50:07
问题 I'm trying to display an entire pageContentView within a SubView on a rootViewController. I'm able to see the pageView but it doesn't auto-resize correctly to fit the SubView, it only shows a cutoff portion of the pageContentView Here's what it looks like Here's what it should look like I can't figure out how to resize the pageView so it display correctly in a subView. RootViewController.h #import <UIKit/UIKit.h> #import "PageContentViewController.h" @class PageContentViewController;

UIPageViewController programmatically turning pages does not update Page Indicator

只谈情不闲聊 提交于 2020-01-14 16:36:19
问题 When I programmatically turn the page in a UIPageViewController using a method similar to this answer, the Page Indicators are not updated. Swiping to the next/previous page updates the page indicators as expected. What do I need to do to update the Page Indicators when programmatically turning the page? i.e. How do I set the current "index" after programmatically changing the page so the Page Indicators know which page indicator to show as active? I noticed in the documentation, the