uiviewcontroller

How to make SWRevealViewController menu disappear when users tap on the view-controller

独自空忆成欢 提交于 2019-12-24 16:26:38
问题 I have View controller with embedded SWRevealViewController I've added code below to disable any interaction while the menu on use. The viewcontroller is embeded with tableview. How to make menu disappears when users tap on the view-controller as the slack app "When the menu is on use and you tap on the chat the menu disappears" class Feed: UIViewController,SWRevealViewControllerDelegate { @IBOutlet weak var menuButton:UIBarButtonItem! @IBOutlet weak var menuButton:UIBarButtonItem! override

How to remove a subview from memory and display right away?

回眸只為那壹抹淺笑 提交于 2019-12-24 14:52:37
问题 How do I remove a UIImageView's subview (a View Controller in this case) from memory and display immediately? [myGroovySubview release]; isn't doing it. Any help appreciated! Thanks // :) 回答1: myGroovySubview.hidden = YES; hides the view. You could also try to remove it from its superview with [myGroovySubview removeFromSuperview]; If you removed it from its superview, the release call should automatically remove it from memory since the reference count should be zero after that call. 来源:

Persist data and pass to multiple views

心不动则不痛 提交于 2019-12-24 14:51:38
问题 I have an app where a user logs in by entering their details and that sends a HTTP GET request to my API which authenticates the user and sends the users data/user object back from the database. Once this is done, within my HTTP request which is triggered on button tap I send the users data onto the next view and perform a transition to the view by using the following code: if let parseJSON = json { // parseJSON contains the return data. We are programmatically creating a segue between two

iOS - go to second uiviewcontroller of some tab from another tab

旧巷老猫 提交于 2019-12-24 14:39:12
问题 I'm developing an iOS 5 app using Storyboard. I have UITabBarController which has 3 tabs. Every tab has its own UINavigationController . UINavigationController of first tab has one UITableViewController which segues to another UIViewController etc. UINavigationController of second tab has only one UIViewController . What I want to achieve is to navigate to UIViewController (second view in UINavigationController of first tab) when certain action happens in UIViewController of second tab. I've

Passing an NSManagedObject Effectively through Storyboard

随声附和 提交于 2019-12-24 14:17:56
问题 I have quite a complicated setup in my app that involves an embedded UISplitViewController which feeds a bunch of UIViewControllers . What I am needing to do is pass an NSManagedObject through the embedded UISplitViewController so I can access it in my separate detail' UIViewControllers . I have attached an image of my storyboard with some awesome annotations.... This is my prepareForSegue function at the minute, this is in the View Controller where I already have my NSManagedObject, I am

iphone development: is it possible to extend more than one viewControllers?

旧城冷巷雨未停 提交于 2019-12-24 14:09:13
问题 in my app I want to use googleAnalytics. To use it I have to extend GAITrackedViewController but the problem is I already extend GLKViewController because my view has an openGL application. So is it possible to extend the properties of both view controllers? 回答1: For a similar case, I've simply created a subclass of UIViewController (GLKViewController in your case). That subclass handles the tracking of the view. All "specific" ViewControllers extend that custom UIViewController, instead of

Does a UIView retain its view controller

巧了我就是萌 提交于 2019-12-24 13:04:28
问题 Does a UIView retain it's associated view controller? For example, in the following code the view is retained by the parent view. It would be handy if this view also retained its ViewController so that I could go ahead and release the controller in the loadView method. - (void) loadView { ... MyViewController* ctrl = [[MyViewController alloc] init]; [self.view addSubview: ctrl.view]; [ctrl release]; } The alternative, I suppose, is to keep track of the controller as an instance variable and

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

UINavigationController barstyle property changes layout

戏子无情 提交于 2019-12-24 12:05:16
问题 I have a modal view controller which displays a navigation controller. The navigation controller in-turn has a regular UIViewController as its root view controller. The only UI element that the above-mentioned UIViewController has is a UISwitch. Now here's the problem: When I change the barStyle property of the navigation controller, the layout of the UISwitch inside the UIViewController changes. Here's what I am talking about: If I don't set the barStyle property, here's what I get: http:/

Using a ContainerViewController, how do i add an interactive animation between child ViewControllers?

雨燕双飞 提交于 2019-12-24 11:50:43
问题 I'm trying to create a customized NavigationViewController where the Navigation bar is a swipeable bar at the top that controls the transitions (think UITabBarController but with swipe gestures not buttons). Here is a quick mockup. I apologize for the crudeness I have the header bar set up as a ScrollView. I have been able to successfully detect the scroll amount using the scrollViewDidScroll method. So I have the header bar portion rigged up. I now need to implement the transition movement