uicontainerview

how can I pass data from one container to another, both embedded in the same uiviewcontroller in swift?

烂漫一生 提交于 2019-12-01 13:24:47
I have a parent UIViewController and it has two different view containers - each of them has embedded UIViewController inside. It looks somehow like this: I want to change the label on the right container when user presses the button stored on the left one. So far I was able to do it while having a button placed in a parent view controller, then I was just using a protocol: in my parent component I had: class ParentController: UIViewController { var delegateEmbedded:HandleEmbedded? override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if (segue.identifier ==

How to set height of containers in stack view?

只愿长相守 提交于 2019-11-30 09:05:48
I'd like to ask you if it's possible to set height in percentage of each container placed in vertical stack view? I want to have 3 containers in stack view. First should take 40% of screen size, second 20% and third 40%. Thank you 'Fill proportionally' distribution type works with intrinsic content size . So if our vertical stack(height say 600) view has 2 views, ViewA (intrinsic content height 200) and ViewB(intrinsic content height 100), the stack view will size them to ViewA(height 400) and ViewB(height 200). Also, If all the views do not have intrinsic content height, vertical stack view

Add a ContainerView inside a UIViewController created from .xib

放肆的年华 提交于 2019-11-30 00:23:49
问题 I have a .xib file and i want to add it a container view (to place inside a ViewController). Unfortunately a container view is only disposable by storyboard. But when i create a .xib file and i search for the container view controller, i don´t found it. Can someone give me a tips how to achieve my task? 回答1: If you're using a xib instead of a storyboard , you can just add a plain UIView to the xib to act as a container. Then in code, add your childViewController's view as a subview of the

How to set height of containers in stack view?

☆樱花仙子☆ 提交于 2019-11-29 13:28:48
问题 I'd like to ask you if it's possible to set height in percentage of each container placed in vertical stack view? I want to have 3 containers in stack view. First should take 40% of screen size, second 20% and third 40%. Thank you 回答1: 'Fill proportionally' distribution type works with intrinsic content size . So if our vertical stack(height say 600) view has 2 views, ViewA (intrinsic content height 200) and ViewB(intrinsic content height 100), the stack view will size them to ViewA(height

How do I get the views inside a container in Swift?

[亡魂溺海] 提交于 2019-11-28 18:35:27
I have a Container View that I popped into my storyboard. There's a wonderful little arrow that represents the embed segue to another scene. That scene's top level object is controlled by a custom UIViewController . I want to call a method that's implemented in my custom class. If I have access to the container, how do I get a reference to what's inside? You can use prepareForSegue , a method in UIViewController , to gain access to any UIViewController being segued to from your current view controller, this includes embed segues. From the documentation about prepareForSegue : The default

Sizing a Container View with a controller of dynamic size inside a scrollview

試著忘記壹切 提交于 2019-11-28 15:14:47
I'm trying to create a container view, with a controller that has a dynamic height, inside a UIScrollView and have it sized automatically using auto layout. View Controller A is the scrollview, which has the container view included, along with more content below. View Controller B is the view controller that I want to have a dynamic size and for all the content to be displayed in full height in View Controller A's Scroll View. I'm having some problems getting the dynamic size of B to automatically set the size of the Container View in A. However if I set a height constraint on the Container

Storyboards and custom container view controllers

偶尔善良 提交于 2019-11-28 06:56:03
I'm creating a custom container view as per the apple spec . I would like to use the storyboard to connect three static child UIViewControllers. Is there an easy way in the storyboard to connect via a Relationship as seen for the UINavigationController in the storyboard? Based on my research, it seems like this isn't possible. It IS possible to link a container view controller to a child. In fact, it's trivially easy to do so. You bring up the Object library, type "Container" into the search field, and look for the object "Container view". It looks like this: Drag a container view into your

Swapping child views in a container view

不想你离开。 提交于 2019-11-27 18:23:38
Let ContainerView be the parent container view with two child content views: NavigationView and ContentView . I would like to be able to swap out the controller of ContentView with another view. For example, swapping a home page controller with a news page controller. Currently, the only way I can think to do this is by using a delegate to tell the ContainerView that I want to switch views. This seems like a sloppy way to do this because the ContainerViewController would end up having a bunch of special delegates for all of the subviews. This also needs to communicate with the NavigationView

How do I get the views inside a container in Swift?

自闭症网瘾萝莉.ら 提交于 2019-11-27 11:28:50
问题 I have a Container View that I popped into my storyboard. There's a wonderful little arrow that represents the embed segue to another scene. That scene's top level object is controlled by a custom UIViewController . I want to call a method that's implemented in my custom class. If I have access to the container, how do I get a reference to what's inside? 回答1: You can use prepareForSegue , a method in UIViewController , to gain access to any UIViewController being segued to from your current

Sizing a Container View with a controller of dynamic size inside a scrollview

烂漫一生 提交于 2019-11-27 09:04:11
问题 I'm trying to create a container view, with a controller that has a dynamic height, inside a UIScrollView and have it sized automatically using auto layout. View Controller A is the scrollview, which has the container view included, along with more content below. View Controller B is the view controller that I want to have a dynamic size and for all the content to be displayed in full height in View Controller A's Scroll View. I'm having some problems getting the dynamic size of B to