uiviewcontroller

How to navigate to different view controllers based on slide out menu

£可爱£侵袭症+ 提交于 2020-01-04 06:01:14
问题 I'm new to Swift and have been trying various thing for many hours now. Here's how my app looks like: Ideally I want them to click an option from this pop out menu that will take them to another view. Right now, I'm on the QuotesTimelineViewController but say I want to click on the bookmark button then I'd want to go to the SavedQuotesViewController. Here is how my storyboard looks like: The QuotesViewController has a NavigationController embedded in it. When you click the menu button it goes

iOS - Updating auto layout constraint constant stops working after pushing another view controller then returning

醉酒当歌 提交于 2020-01-04 06:00:41
问题 I have a UIViewController designed in IB (Storyboard) that has a UIView containing a few controls. The UIView has an auto layout constraint to fix its height. In my UIViewController subclass I have an IBOutlet NSLayoutConstraint (ivar) wired to the height constraint so that I can adjust it in code. Depending on user events, I expand/shrink the height of the UIView by modifying the constraint's constant property between 80 and 44, which also slides up/down a UITableView which is constrained to

dismissModalViewControllerAnimated nonatomic?

房东的猫 提交于 2020-01-04 05:38:09
问题 I have a weird timing issue, it seems. I open a uiimagepicker as a modal view. When the user picks an image or I want to take the image, save it to a variable, then open an email interface as a modalview. My problem is that I am calling dismissModalViewController on the imagepicker, then calling presentmodalviewcontroller for my email interface, but the imagepicker isn't going away in time for the email view to be presented. Is there a way to 'wait' for that line of code to complete? (void

how can I know current viewcontroller name in iphone

我与影子孤独终老i 提交于 2020-01-04 05:32:08
问题 I have BaseView which implement UIViewController. Every view in project must implement this BaseView. In BaseView, I have method: -(void) checkLoginStatus { defaults = [[NSUserDefaults alloc] init]; if(![[defaults objectForKey:@"USERID"] length] > 0 ) { Login *login=[[Login alloc] initWithNibName:@"Login" bundle:nil]; [self.navigationController pushViewController:login animated:TRUE]; [login release]; } [defaults release]; } The problem is my Login view also implement BaseView, checks for

Dismiss ChildView From ParentViewController

天涯浪子 提交于 2020-01-04 04:18:07
问题 I have a parent view that opens a child view like so: ChildViewController *child = [[ChildViewController alloc] initWithNibName:nil bundle:nil]; [self presentModalViewController:child animated:YES]; Which works perfectly fine. I need to dismiss the child view from the parent view but when I do that, nothing happens. Is it because the parent view stops all of its processes when I open the child view? Or is it my code: [child dismissModalViewControllerAnimated:YES]; ? Thanks 回答1:

Create A UIViewController Extended Class With A Custom Initializer

爷,独闯天下 提交于 2020-01-04 03:57:25
问题 I love Swift, except for this required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } If I create any UIViewController extended class I have to have this ugly, unclear, required init, as the init I don't want. Is there a way I can set up my code so I can have code setup so I can have my own required init, and then it just calls this at the end? I don't want my client code to have to deal with this, and I'd like to have one clear init() call, instead of a

Animation stops after segueing to different view controller

最后都变了- 提交于 2020-01-04 01:49:13
问题 I have an animation in my app that basically just makes a UIButton grow and shrink to make it obvious to the user that they should tap. The problem is that while it works fine when the view first appears, it doesn't work if I go to a different view controller (with a segue) and then return (nothing happens). Here is my code: override func viewWillAppear(animated: Bool) { expandAnimation() } func expandAnimation() { var animation = CABasicAnimation(keyPath: "transform.scale") animation.toValue

Replacing a UIViewController root view with my own view

主宰稳场 提交于 2020-01-03 20:01:15
问题 I'm trying to replace a UIViewController root view with a subclassed UIView. In the iPhone SDK's UIViewController Class Reference, within it's Overview section, this is stated: You use each instance of UIViewController to manage a full-screen view. For a simple view controller, this entails managing the view hierarchy responsible for presenting your application content. A typical view hierarchy consists of a root view—a reference to which is available in the view property of this class—and

Replacing a UIViewController root view with my own view

瘦欲@ 提交于 2020-01-03 19:59:23
问题 I'm trying to replace a UIViewController root view with a subclassed UIView. In the iPhone SDK's UIViewController Class Reference, within it's Overview section, this is stated: You use each instance of UIViewController to manage a full-screen view. For a simple view controller, this entails managing the view hierarchy responsible for presenting your application content. A typical view hierarchy consists of a root view—a reference to which is available in the view property of this class—and

Will multiple presentViewController method calls throughout the view controllers lead to memory leak in iOS?

断了今生、忘了曾经 提交于 2020-01-03 17:15:08
问题 I know there has been a lot of discussions occurred related to this topic. But in all discussions all have discussed with 2 view controllers (A&B). My scenario is similar but different. What will happen when there are multiple view controllers like A,B,C,D. So the presenting flow moves as , View controller A (Home) presents View controller B(List). Then from View controller B presents View Controller C (Details).Then from View Controller C presents View Controller D(Advanced Details). Then