uicontainerview

Embedding a UITableView as a container view within a UIViewController

*爱你&永不变心* 提交于 2019-12-25 18:36:42
问题 I would like to add a textfield and send button that sticks to the bottom of uitableview similar to a chat app. I have come across comments on embedding a UITableView as a container view within a UIViewController. However, they seem to lack an example on how to achieve this. More specifically details including where to add a textfield/button and move textfield up when keyboard appears, etc. Thanks! 回答1: follow the steps using the storyboard 1) drag a uiviewcontroller from the object library.

Delegation - Change variables from different viewsControllers

半腔热情 提交于 2019-12-24 12:51:18
问题 I have an UIImageView (img) on the container2View as an IBOutlet. How can I change the img.image and refresh the view from other container (containerView)? We have to use delegation mainController class mainController: UIViewController, containerDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { switch segue.identifier! { case

iOS How to control the UIContainer View show and disappear?

纵饮孤独 提交于 2019-12-24 12:42:57
问题 I had a UIViewController and a UIContainer View. I want to simulate the UIAlertView effect, But I don't know how to build the Container View show and hide about the great method. I had put the UITableView in my UIContainer View, I use delegate to send selected item to the UIViewController ( ParentViewController ) and show in the label.( segue name with alertSegue ) There have a show button in the ParentViewController ,and I need click the selected item ,it will close(hide/dismiss?) the

iOS Scroll View Allows Scrolling Past Content

百般思念 提交于 2019-12-24 06:28:55
问题 I'm trying to work on optimizing my app for landscape and smaller screens. I'm mostly using scroll views to achieve this. In one of my views I have a container view. This container view looks perfect when I toggle between devices in the storyboard. The container view is mapped to a view controller that has a scroll view that has top, bottom, leading, and trailing space set to superview 0. So it should fill the container. The actual view controller is set to Freeform Simulated Size with a

How to keep navigation bar from disappearing with MSMessagesViewController -> UIContainerView -> UINavigationController -> UITableViewController?

倖福魔咒の 提交于 2019-12-24 05:49:58
问题 I am trying to put a navigation controller with a table view controller within an iMessage app (iOS 10). This seems to work when I put the UINavigationController within an UIContainerView within the MSMessagesViewController . However, this breaks when in expanded view. The UINavigationBar that the controller has disappears. How can I remedy this, or am I taking the wrong approach? 回答1: Let me start with the assumption that you used view.addSubview to add your UITableViewController to the

Swift: How to programatically advance a UIPageViewController that is inside a Container View?

浪尽此生 提交于 2019-12-24 01:14:20
问题 I have one ViewController that contains a button and two image views that I would like to stay permanently, and a PageViewController that swipes through three other ViewControllers, and this all works well, however what I can't figure out how to do is how to go to the next slide programatically when the button is pressed. Here's what my PageController class looks like (based on Fattie's very helpful answer here: UIPageViewController and storyboard): class PageController: UIPageViewController,

Handle ContainerViewController's action in ParentViewController

家住魔仙堡 提交于 2019-12-24 00:41:17
问题 I have followed this link to implement the compleltionblock @interface : ParentViewController () @property (nonatomic, strong) ChildViewController *childViewController; @end In Parent View Controller's Table View Delegate method (didSelectRowAtIndexPath) I am adding container view as follows - (void) addChildView { ChildViewController * childViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ChildViewController"];

UIView-Encapsulated-Layout-Height and Container View

孤街醉人 提交于 2019-12-22 03:43:57
问题 I have UIViewController 1 , that has scroll view . Inside this scrollview there is container view that pinned to top/bottom leading/trailing (without fixed height). Container view has UITableView pinned to top/bottom trailing/leading and height constraint with 0 constant , that will change in updateViewConstraints to content size height. When View of UIViewController 1 appears, Container View has constraint: NSLayoutConstraint:0x7b03e5f0 V:[UITableView:0x7c42a200(54)], NSLayoutConstraint

Access container view child properties swift

南笙酒味 提交于 2019-12-21 07:13:05
问题 What I want to achieve: User presses the button in the ViewController then, the color of the button placed in the container view should change its color to red. How can I get access of the button placed in the container view, from the ViewController? 回答1: Step by step: Name the segue between your view controller and container view controller. Add a property to your view controller which will contain the container view controller. In your view controller implement a method prepareForSegue(_

Delegate using Container View in Swift

时光怂恿深爱的人放手 提交于 2019-12-20 12:35:50
问题 I'm developing an app for iPad Pro. In this app, containerView use to add additional views and interact with them. First, I created a protocol: protocol DataViewDelegate { func setTouch(touch: Bool) } Then, I created my first view controller import UIKit class ViewController: UIViewController, DataViewDelegate { @IBOutlet var container: UIView! @IBOutlet var labelText: UILabel! override func viewDidLoad() { super.viewDidLoad() } func setTouch(touch: Bool) { if touch == true { labelText.text =