uiviewcontroller

Using UISegmentedControl to switch between two views

荒凉一梦 提交于 2020-01-06 01:47:17
问题 I created a subclass of UIViewController. In it I have two properties of: @property (nonatomic, retain) IBOutlet UIView *presetsView; @property (nonatomic, retain) IBOutlet UIView *customView; I added a new UIView to my .xib and put some UI elements in it. I want to hide one view, and show the other based on when the UISegmentedControl is pressed. My question is in Interface Builder, my original View that was provided me by IB, has an outlet connected to it already to File's Owner. Because I

NSMutableArray of ViewControllers

混江龙づ霸主 提交于 2020-01-05 15:13:09
问题 I am woundering how I could create an NSMutableArray of viewcontrollers. Then once I had that array how could I use it in a method that detects left and right UIgesture swipes to animate in and out of view... this is the method that is picking up my gestures which is just animating between two views, however I would like to animate between as many views that are in the array of view controllers. - (void)swipedScreen:(UISwipeGestureRecognizer*)gesture { //Left swipe if (gesture.direction ==

Xcode Swift Go back to previous viewController (TableViewController)

耗尽温柔 提交于 2020-01-05 13:08:36
问题 In my TableviewController I have a bar button item in the top right corner. After clicking the button a new view controller is shown. In this Controller I enter some data in to textfields and save them. To save this data I have to click on a button, which is also a bar button item in the right corner. But now it delegates me to the first view Controller of my app. What did I do, that it delegates me back to the table view controller? EDIT: When I use the following code, the app give me an

ios view controllers keep staking in memory

杀马特。学长 韩版系。学妹 提交于 2020-01-05 12:14:10
问题 I am new to Objective C. I am working on my first app. - It basically consists of 2 view controllers, and I use modal segue to switch between them. The main vc is a menu that loads up the 2nd vc with different attributes for each menu item. - I noticed that the memory keeps increasing when I switch from one vc to the other. This was my attempt to solve the issue but it doesn't make a difference and it doesn't look clean. -(void)viewDidDisappear:(BOOL)animated{ ViewController *me = self; me =

Make image accessible from other ViewController

痞子三分冷 提交于 2020-01-05 12:09:23
问题 I just want to know the code for making an image called profpic accessible to all other ViewControllers that I make or intend to make. I have read many posts on global variables, public variables, and other suggestions that have yet to work. If it helps, I am specifically using this to display an image from ViewControllerA as the background for ViewControllerB . 回答1: You can use a singleton class and put the UIImage on it. Set it in ViewControllerA and get it in ViewControllerB @interface

how to make the modal view controller transparent

放肆的年华 提交于 2020-01-05 10:16:15
问题 I am using present view controller for displaying a new view controller from left.. the code i used is.. UIViewController *controller; UINavigationController *navi; UIView *popmenu = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 300)]; popmenu.backgroundColor = [UIColor yellowColor]; controller.view = popmenu; controller.view.superview.backgroundColor = [UIColor clearColor]; navi = [[UINavigationController alloc]initWithRootViewController:controller]; navi.view.superview.backgroundColor

Flip ViewController but maintain same NavigationController with Storyboard

此生再无相见时 提交于 2020-01-05 09:56:13
问题 I'm trying to flip the viewcontroller inside navigationcontroller but with little success so far, I tried thousands of solutions but none suited. I want to flip the controller like this: Press button to go on the map: http://i39.tinypic.com/fabul3.jpg Press same button to go back with change image: http://i40.tinypic.com/2qa1y0h.jpg I need to mantain the coerence with storyboard for segue. Do you have any idea or example of how to do this? 回答1: Rather than flipping the view controller, you

Flip ViewController but maintain same NavigationController with Storyboard

倖福魔咒の 提交于 2020-01-05 09:55:11
问题 I'm trying to flip the viewcontroller inside navigationcontroller but with little success so far, I tried thousands of solutions but none suited. I want to flip the controller like this: Press button to go on the map: http://i39.tinypic.com/fabul3.jpg Press same button to go back with change image: http://i40.tinypic.com/2qa1y0h.jpg I need to mantain the coerence with storyboard for segue. Do you have any idea or example of how to do this? 回答1: Rather than flipping the view controller, you

Flip ViewController but maintain same NavigationController with Storyboard

安稳与你 提交于 2020-01-05 09:54:32
问题 I'm trying to flip the viewcontroller inside navigationcontroller but with little success so far, I tried thousands of solutions but none suited. I want to flip the controller like this: Press button to go on the map: http://i39.tinypic.com/fabul3.jpg Press same button to go back with change image: http://i40.tinypic.com/2qa1y0h.jpg I need to mantain the coerence with storyboard for segue. Do you have any idea or example of how to do this? 回答1: Rather than flipping the view controller, you

Passing some data back to RootViewController iOS 7

≡放荡痞女 提交于 2020-01-05 09:00:15
问题 Suppose , We have 3 ViewControllers called ViewControllerA , ViewControllerB , ViewControllerC in our UINavigationController . To be specific , ViewControllerA is the RootViewController and ViewControllerB and ViewControllerC are pushed on it. So, Currently ViewControllerC is on the Top and visible to user. I want to return to ViewControllerA by calling [self.navigationController popToRootViewControllerAnimated:YES]; method and pass some data to ViewControllerA from here. I have to update