Before me is the task: to create a catalog of goods. On the main page there are 2 buttons: phones and accessories. When you click on the phone, a list of phones opens, where there is a phone picture, name and price. When you click on the button accessories happens about the same thing only with accessories. Tell me, please, how to implement it. I have 2 questions:

  1. How to make, that at pushing the button the new empty form opened?
  2. How to realize that in the new form there was a list of products as in the Yandex Market application.

What form element to use?

    2 answers 2

    1. The easiest way is through UINavigationController , in xcode there is a corresponding template to open a new view, in the handler of the button you create its controller (hereafter [self.navigationController pushViewController:vc animated:YES]; vc) and make [self.navigationController pushViewController:vc animated:YES]; . All he gets on the screen.

    2. In J.Market, this is a UITableView with custom cells, you need to create a descendant class from UITableViewCell and add missing fields to it.

    • What do you mean (hereinafter vc)? What is in the square brackets also in the handler of the button to write? - Sergey4590
    • that I called the variable kololler vc, nothing more. - aknew

    How, yes it’s very simple, we throw two buttons on the view into the interface of the builder, attach an action (IBAction) to them, then add two UIViewController or two UIView classes to the project, we sharpen tables or fields for entering text, etc. We take Yandex api parsim it and display everything beautifully as it should.

    • And yet what is better to use UINavigationController or UIViewController ??? - Sergey4590
    • If you can, give an example of implementation, at least one button. - Sergey4590
    • UINavigationController is more convenient if you go a lot, for example in the same market, from categories go to the list of products, then to the description of a particular product, then we can go to the list of stores, etc., well, the x86-64 method is simpler if you do not have such a complex Navigation - aknew
    • I think UINavigationController suits me. Help us implement it on one button. - Sergey4590
    • Well, if you decide to use a UINavigationController, then you will not tie it on one button, you must create a UINavigationController in AppDelegate and then bind the action to UIBarButtonItem already in your ViewController. Here is a guide on how to use UINavigationController uinnoblog.com/uinavigationcontroller-programmatically.html - x86-64