Sliding drawer equivalent in iOS - ios

After wasting lot of time searching, I am finally posting this question, hoping I get an answer.
I want to have a widget in iOS, which has the similar functionality of Sliding Drawer in Android. (Like the bar at the bottom, and on pulling it, it shows up a new view).
Any help would be greatly appreciated.
Thanks

A few similar questions that might help you out:
Making a pull out tray - (iOS)
iOS: Sliding UIView on/off screen

I recently made a drawer container controller and put it up on Github:
https://github.com/saldavonschwartz/DrawerContainerController
While not exactly the same (you are asking about a vertical single view sliding up/down), you might want to download the code and take a look. My approach might as well work for what you are trying to do: basically, creating a container controller which can host another controller and its view and present its view in a custom way.
Specifically, you might want to look at:
-replaceContainedController:forIdentifier: for how you would go about adding child view controllers the 'Apple' way.
-didPanContent: and -translateContentContainerViewToPosition:animated:completion: for the sliding animation from input of a UIPanGestureRecognizer

Related

Add same NavigationBar on every page in swift

I recently try to develop an application in swift and wanted to make a navigation bar which is the same on every single view.
I tried different approaches. The best one so far was a solution from another stack overflow-question you can see here
The solution from Jacob King works for me, but because I am relatively new in Swift, I am concerned if his approach would add a second, third, fourth,... navigation bar every time I navigate between two views, which both inherit the navigation bar? And if that is true, how can I solve this problem?
Thanks for all efforts in advance.
From the looks of the code, he says you would need to declare each ViewController. In his case, when he taps the open search button the code would execute the open search function, so from the looks of it it would not create infinite amounts of navigation bars. Remember in the future after implementing your code you can always build and run your application to test things like these to make sure I’m right. It never hurts to try! - Colin
you have to create a viecontroller class with a navigation bar and then all the viecontrollere you will have to put
miaviewcontroller: viewcontroller_with_bar

Which control should I use to display an ActionSheet-like view at the top of the screen?

I was asked to display a list of three options for the user in a View sliding from the top to bottom. They say it should slide from the top because the action is initiated from a dropdown-like button on the navigation bar.
Most of what I found on that subject mentions the deprecated UIActionSheet class.
The "new" way using UIAlertController doesn't seem to allow us to change position of the view. At the least from what I've found.
The end result I'm trying to get can be seen on the image below,
From what I've learned about iOS programming, one method I could think to achieve that would be to create a new UIViewController and to use a custom class to control the transition. But it just seems so much. And I think it wouldn't not look like a dropdown afterall.
The other option would be to create the TableView with options and leave it on the Controller where it should be displayed, configuring its height to zero. And then Animating when necessary. I also have such a bad feeling doing it this way.
Is there a right way to do this on iOS? Does one of the options I've found seems acceptable?
Thanks.
Following the suggestion given by #Losiowaty on the comments, I started looking for a custom View/Control on cocoapods and ended up finding quite a few that did what I was looking.
The one I decided to use is this:
https://github.com/lminhtm/LMDropdownView

How to load another UIViewController to a UIView Example Like UITabbarController

I have a 2 UIViewController(s), I need to be able to change the views at the bottom of the Airtime and Data Plan Upon tap gesture on Airtime and Data Plan!
The yellow line will indicate the active view controller. some thing like tab bar.
Perhaps, the image attached is an android version
Could anyone provide a help on how to go about this.
Thanks
I personally use a library called ICVIewPager
https://github.com/iltercengiz/ICViewPager
This is pretty simple and easy to use with examples. It should put you in the right direction without writing a lot of code.

Custom iOS transition similar to UIScrollView paging (like what Luminosity does for their transitions)

I'm after a straightforward custom push transition where the new view controller "pushes" the current view controller off to the left and replaces it. Pretty much what UIScrollView does when paging is turned on...but for view controller transitions.
Luminosity does this for all (or most) of their transitions: https://itunes.apple.com/au/app/lumosity-mobile/id577232024?mt=8
Given the simplicity of this transition, I'd have thought a simple google search would find an example and source code, but all I can find are exotic transitions (flip, explode, swing etc. etc. etc.)
If anyone can point me in the right direction that would be fantastic. I assume the transition code is straightforward, so my next step is to actually learn how custom transitions work and build it myself.
NB: the transition I describe is different to the default ios push transition which does a bunch of funky fading and sliding: http://watchingapple.com/2009/11/a-closer-look-at-iphone-transition-animations/
I guess you found your answer by now. But for anyone else that finds this question...
There is a very good drop in library on github by Colin Eberhardt called VCTransitionsLibrary that has a number of cool ios 7+ transitions. I think the 'pan' transition matches the questioners requirements perfectly:
https://github.com/ColinEberhardt/VCTransitionsLibrary/blob/master/README.md

Titanium Mobile - Create an iPad Popover in NavBar

I am currently playing around with Titanium Mobile and trying to create and populate a popover when a button in the NavBar (at the top) is clicked. Currently, the popover is created, but it's not populated with any data. (I'm trying to populate it with a view from my file "category_list.js").
Here's what I have tried so far: http://pastie.org/2145045
The problem is: The popover shows up, but it's not being populated with any data.
UPDATE: More specifically, after looking around, I guess what I am trying to do is create a navigation group within a popover. Apparently, this forum post says it's possible.
But I can't seem to figure it out. If anyone can provide a concrete example of how a navigation group works within the context of a popover using Appcelerator, it would help me out tremendously.
Any help would be greatly appreciated! Thanks.
http://blog.clearlyinnovative.com/post/7182213033/titanium-appcelerator-quickie-ipad-popover-with
I wonder if if has anything to do with popover.add(categories_list); being called once at line 18 and once in the click event at line 73. When I've worked with popovers in the past you only need to add to it once. Let me know if this gets you anywhere closer to a solution?
The other problem I see that I'm 99% sure is causing this issue is the popovers don't adjust auto to the child view height and width. Try adding height: 300, width: 250 when creating the popover.

Resources