IOS snippets version

Can someone tell me what is the best way to do the following in Xcode (iPhone).

I have a main navigation screen with some buttons on it. When the user presses any of the buttons, they go to the sub-navigation screen with additional buttons on it. Here they press any button and go to the list of parameters. By clicking on any parameter of the list, a screen with some information for the user is displayed. Each of these screens (regardless of which part of the application you are in) will look the same. Only the text and images on these screens will change.

I attached a diagram that could explain it better. What is the best way to handle this in Xcode? I tried to do all this in Stroyboard, as I am new to Objective-C, but just a huge number of separate pages slows my machine down to a crawl. Therefore, rethinking is required.

I also make the Android version of this application, and I use snippets for this. Can anybody help?

enter image description here

EDITOR: Just got to my car, and this is what I have done so far. I understand that this is a complete wrong way to do this. I created a view controller for each "screen" if you want.

So, I just create one view controller for the whole "screen", for example. Individual page by chart, and then dynamically add text depending on the selected screen. Can someone point me towards the textbook or what should I look for? I don’t know where to start with Xcode.

enter image description here

+7
ios xcode
source share
2 answers

If the presentation elements are the same (and only the actual text and images change), all you need to do in your storyboard is to create one view controller in which all these ui elements will be, from the code, which you can then configure it depending on the content that you want to display in it (depending on what the user clicked on the previous view controller).

EDIT: Not sure why this was understated, but I will be more clear. Obviously, one view controller is NOT ALL that you need to do in the storyboard. This is all you need to do on the storyboard associated with all the elements called the page on the chart. Then you will have to bind it to the PageViewController class and to all the outputs associated with the custom user interface elements and in the code of your prepareForSegue: method prepareForSegue: from Secondary Nav Screen View Controller you will have to configure it according to what you want to show.

Here you can find a good primer for beginners, along with many other good primers. You probably lack that you also need to tell the storyboard which class is the view controller, and how to connect things like shortcuts and images to real code so that you can customize them accordingly.

those.

enter image description hereenter image description here

+7
source share

From what you are describing, it looks like you want the UINavigationController as the window of your rootViewController application and show your screens in it. You want to create four controller classes:

  • HMMainScreenController
  • HMSecondaryScreenController
  • HMListScreenController
  • HMPageController

I hope it will be obvious what will be in everyone. You set up your window in your application as follows:

 HMMainScreenController *mainController = [[HMMainScreenController alloc] init]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:mainController]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = navigationController; [self.window makeKeyAndVisible]; 

When the user presses a button on your main controller, you should do this:

 HMSecondaryScreenController *secondaryController = [[HMSecondaryScreenController alloc] init]; // configure it appropriately [self.navigationController pushViewController:secondaryController]; 

etc. for your list and page controllers.

+1
source share

All Articles