-1

I just want to know what exactly should I use in storyboard UI so that I can create multiple views which can replace one view with the after a click of button:- Replacing first view with second in this way

And not this way

Ruturaj
  • 3
  • 4
  • Even if anyone can tell me what is that view called I could google more about it. Thank you – Ruturaj Sep 19 '20 at 10:41
  • That’s a navigation controller interface and it’s called Push. You need a navigation controller and its root view controller, plus a Show segue to the second view controller. – matt Sep 20 '20 at 02:34

1 Answers1

0

You can use a CollectionView as the Header of a TableView if you want a UI shown in first image. TableView will be having Chat options and the Collection View will be having images as you have in the given picture.

Quick Overview :- TableView only supports Vertical scrolling which is best in your use case. Collection can support both vertical as well as horizontal scrolling. So basically what you can do is have a collection view of height as much as you want as a header of your tableview. So when the user scrolls through your tableview your scrollview will also move up just like we have in facebook and instagram stories.

Even if you have more images in collection view then your predefine height set the scroll mode as you prefer horizontal or Vertical so that user can have a look at everything you have in there.

Edit :- After editing your question this can be done for what you're looking :-

You need a Navigation Controller. Here's the Navigation Controller Push and Present of the answer which shows in detail how you can achieve that. By doing Push you can achieve what you want (first image) and by doing present you'll achieve the second image result.

WhiteSpidy.
  • 1,107
  • 1
  • 6
  • 28
  • I am sorry but I wasn't asking about the content to be scrolled. I will edit the question to be specific enough. I'll edit those images too. – Ruturaj Sep 20 '20 at 02:16
  • Thank you for that. I was gonna need that too, for future use, in my app. I am a newbie to iOS app development. – Ruturaj Sep 20 '20 at 03:12
  • That's called a Navigation Controller. Here's the link of the answer which shows in detail how you can achieve that. Link :- https://stackoverflow.com/questions/20742745/navigation-controller-push-view-controller By doing Push you can achieve what you want (first image) and by doing present you'll achieve the second image result. – WhiteSpidy. Sep 20 '20 at 05:49
  • I'll edit my answer as well. Please accept it and give a upvote so that other's can find it easily. – WhiteSpidy. Sep 20 '20 at 05:51
  • App Dev your answer(edited) was absolutely correct. I couldn't vote you as my reputation is less than 15. I think the votes have been saved but I can't see them. Thank you – Ruturaj Sep 29 '20 at 03:35
  • No worries buddy. Glad that this helped you. – WhiteSpidy. Sep 29 '20 at 05:01