I just completed the ios tutorial, and while I can manipulate a single screen now, I am not sure how to implement a “button listener” and tell that button to go to another view that I tell it to go to.
Here is my code so far:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *homeToLearn;
- (IBAction)homeToPlanBusiness:(id)sender;
- (IBAction)homeToLearn:(id)sender;
- (IBAction)homeToMyPlans:(id)sender;
- (IBAction)homeToSettings:(id)sender;
@end
how do I make one of these buttons go to a LeanController that I made? I guess I need to make a LearnView but even once I make that, how do I tie them in together?
Thanks!
Are you trying to do this in code, with storyboards or IB? What version of iOS are you trying to target?
Generally speaking, there are two main ways to accomplish what you want to do. If you want it to be “navigation based” you would do something like this after creating a navigation controller to handle the different view controllers:
[self.navController pushViewController:newLeanController animated:YES]If you are just swapping views you can do something like:
[self.view addSubview:newLeanView]