1

I'm making an app for my Independent Study, and I have a UI functionality in mind - I just don't know how I would go about implementing it.

It's very simple in theory.

I want to have an initial view that fills the screen. When the user swipes up from the lower middle part of the screen, I want to do something that acts similar to control center, but for it to be a view that allows for me to choose between each of the 7 days in the upcoming week, displayed as icons with tags, and the user can swipe through them similar to how one swipes through the pages of apps on the home screen.

Similar to control center, the view should animate by sliding in from down to up, take up only part of the screen (In my case, about 1/5 of the screen as opposed to control center taking up more than 1/2) and the view behind it should of course remain running.

I am a beginner with iOS trying to get on my feet.

My question really boils down to this: I am unsure of what View class to use in interface builder for this, and whether or not this requires a segue/new view controller.

My initial thought was to drag and drop a View into the top level view, set its boundaries to how I want it to end up, then set it to hidden until I handle a swipe up, at which point it animates by sliding up.

I have done my best to describe my question but I am willing to clarify further if needed.

  • This question is not fit for SO. http://stackoverflow.com/help/on-topic This requiers a website of itself to guide you on how to do it. You need a calendar functionality, UI for it, gestures, scrollviews possibly, maybe UITableView or a UICollectionView. Calculating frames / or constraints if you work in storyboard together with code for the animations. And so on. https://www.youtube.com/results?search_query=swift+ios+animation+swipe , **edit** Everything regarding coding is simple in theory, but actual coding takes time. –  Mar 01 '17 at 04:30
  • Here is something that might get you going too: http://stackoverflow.com/questions/36863138/sliding-in-uiview-from-bottom –  Mar 01 '17 at 04:33

1 Answers1

0

You can use 2 scenes in StoryBoard.

One as the mainView and one as the controlPanel.

Design as you like. You can detect user calling it by using UISwipeGestureRecognizer. And call the segue to that controlPanel scene.

On the controlPanel scene, you should set the backgroundColor to clearColor, and add another UIView on it with blackColor and alpha 0.5f.

To present it above the mainView, use modal presentation.

GeneCode
  • 7,545
  • 8
  • 50
  • 85
  • 1
    This actually all makes sense - I'm going to give this a try and report back. Thanks! – Louis DeVesto Mar 01 '17 at 04:36
  • This seems to be what I was looking for. Thanks for the quick answer! – Louis DeVesto Mar 01 '17 at 04:45
  • Glad I could help you. – GeneCode Mar 01 '17 at 04:47
  • Quick follow up question - Once the control panel scene is up, I want to be able to swipe down and have it animate out of view, from up to down (similar to Control Panel) but it isn't clear to me how I would do that. Could I do that in code and pop off the control panel scene with a certain animation set or is there an easy way to reverse direction? – Louis DeVesto Mar 01 '17 at 04:56
  • In ur control panel view, add another swipegesture (this time downside), and you can use segueUnwind to dismiss your control panel. – GeneCode Mar 01 '17 at 04:59