ios - Presenting a ViewController over another ViewController -


i've got pretty lengthy question today, takes amount of explaining. let's start example.


example

let's have 3 view controllers:

  1. fullsizeviewcontroller
  2. firstviewcontroller
  3. secondviewcontroller

fullsizeviewcontroller, name states, intended take space of whole screen. firstviewcontroller , secondviewcontroller, on other hand, should take 3/4 of height of screen. here's few pictures illustrate.

fullsizeviewcontroller

here have fullsizeviewcontroller. nothing special, 2 buttons - "first" & "second". if haven't caught on now, 2 buttons should toggle each of respective view controllers, shown below.

firstviewcontoller


the issue

i'm having main issues this? how able to

  1. animate view controllers bottom
  2. change size of 2 smaller view controllers
  3. still allow interaction fullsizeviewcontroller small view controller open on top of main content, not 2 toggle buttons?

what i've tried

since i'm not sure how this, haven't tried much, have tried 1 thing.

in ibaction connected "first" button:

let firstvc: firstviewcontroller = self.storyboard?.instantiateviewcontrollerwithidentifier("firstviewcontroller")! firstviewcontroller         self.presentviewcontroller(firstvc, animated: true, completion: nil) 

in viewdidload of firstviewcontroller:

self.view.frame.size = cgsizemake(uiscreen.mainscreen().bounds.size.width, uiscreen.mainscreen().bounds.size.height - 68) 

tl;dr how can achieve this?

your full size vc should custom container view controller. when want 1 of other controllers come on screen, instantiate it, size how want, add child view controller, , use animatewithduration change frame off bottom of screen want end up. shouldn't use presentviewcontroller since gives modal vc takes on whole screen. should read document called "implementing custom container view controller" if haven't already.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -