uipageviewcontroller

SwiftUI: How to connect currentPage of PageView with firing view's passing index

邮差的信 提交于 2021-02-11 12:11:16
问题 I follow Apple's example interfacing-with-uikit to use PageView in SwiftUI. And I want to implement it in my app. The scenario is that in MovieView , when the user taps an image of image list then it triggers call to PageView with views and selected index as parameters. But when I click on any item of image list, it always show the page view with the 1st element. I try to change it in init() of PageView , however it is not working. In console, I try to print something, and I see the

UIPageViewController stops working after 1 swipe in SwiftUI

≡放荡痞女 提交于 2021-02-10 15:16:13
问题 I was following the Apple tutorial for SwiftUI and under 'Interfacing with UIKit' (https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit) we were made to make a UIPageController. In the tutorial, they used a State property to update the currentPage variable in PageView . I wanted to experiment a little bit and decided that I want to embed the PageView in a different view and have a currentPage property update in that parent view instead. So, naturally, I changed the @State

UIPageViewController stops working after 1 swipe in SwiftUI

时间秒杀一切 提交于 2021-02-10 15:15:25
问题 I was following the Apple tutorial for SwiftUI and under 'Interfacing with UIKit' (https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit) we were made to make a UIPageController. In the tutorial, they used a State property to update the currentPage variable in PageView . I wanted to experiment a little bit and decided that I want to embed the PageView in a different view and have a currentPage property update in that parent view instead. So, naturally, I changed the @State

UITextField losing firstResponder after view appears

只愿长相守 提交于 2021-02-07 12:19:55
问题 I have a UIPageViewController . One page has a single button, and the other page has a UITextField with a button. When the page scrolls to the view with the field, I'd like it to becomeFirstResponder and open the keyboard. Here's what happens: I call [self.locationQuery becomeFirstResponder] ViewController's viewDidAppear method. But it never opens the keyboard. I do the same in viewWillAppear , and it appears briefly, but then is quickly dismissed. If I'm on the page with the text field, and

How do I display an alert over a PageViewController after a popover dismissal?

和自甴很熟 提交于 2021-01-29 18:16:23
问题 I have a a VC structure like this UIPageViewController -> detailViewController -> popoverviewcontroller The popoverviewcontroller is dismissed using an unwind segue, bringing us back to the detailviewcontroller Now, after the popover is done being dismissed, I would like to refresh the pages on the pagecontroller, since the action the user takes has changed the data. I would also like to display an alert notifying the user about whether they were successful. So I tried putting this code in

Passing data from ContainerView to UIPageViewController and then it's connected ViewController

夙愿已清 提交于 2021-01-28 12:24:48
问题 I've been hitting my head on this for couple of days. My goal is to create an app that has a container view connected to a UIPageViewController such that I can display pages of different data/views. (my existing app w/ UITabBarController w/ 1 single data page/view works) So far, I've created the containerView and the UIPageController and the different ViewControllers using the guidance from this https://stackoverflow.com/a/26024779/14414215 and going thru a lot of SO pages but unable to get

Passing data from ContainerView to UIPageViewController and then it's connected ViewController

微笑、不失礼 提交于 2021-01-28 12:19:20
问题 I've been hitting my head on this for couple of days. My goal is to create an app that has a container view connected to a UIPageViewController such that I can display pages of different data/views. (my existing app w/ UITabBarController w/ 1 single data page/view works) So far, I've created the containerView and the UIPageController and the different ViewControllers using the guidance from this https://stackoverflow.com/a/26024779/14414215 and going thru a lot of SO pages but unable to get