iOS - How to get a time interval in a picker view - ios

I want to set a time interval in one picker view. How can I manage two time pickers in one picker view? One for a starting time and one for the ending time?
You can see what I mean in the screenshot.
Screenshot of the design
Thanks for your help!

Related

Generate viewcontrollers for every day of the year

So the point is that I would like to have a viewcontroller for every day of the year in my custom navigation bar menu. I am using PagingMenuController library as my menu. There does not have to be 365 menu tabs, the interval can be like 90 days and every time the day changes it deletes the first day from the array and creates new one as last day of the array.
Basically is there a way to achieve it any way painlessly?
The app called ClutchPoints has this feature and I would like to get the exact same result.
This might be too much but I really hope there are some generous people out there who can help me.
Don't create 365 (or even 90) views at a time. You will have serious memory/performance problems if you do that.
You should look at the way table views, collection views, and UIPageViewControllers work. Those all only create the small number of views/view controllers that are actually visible at any one time, and configure the visible ones based on a data source that has the array of data that is being displayed. The views are recycled in order to manage memory.

How to create UI with time and date grid for ios app

I want to create something like this(refer image)
as you can see in above image, here column represents date and row representing time. User can vertically scroll for time and horizontally for date. blank spaces will be clickable.
I have searched for similar kind of UI, but I don't know what to search. any thoughts to implement this custom UI will be a great help.
Thank you.
Here is the idea, if you want to implement a slightly simple design as displayed in your screenshot.
You can divide the complete UI in 3 small parts and design it,
To display "February 2017", you can addd a label.
TO display DATE, You can use CollectionView, which will have direction of Horizontal and set the content and create a logic by which you can display 31 for Month or week wise as per your need.
You want to display Time which scroll vertical, then to display that you can use Tableview in which time will be displayed.
Above is the just idea by which you can create a simple UI, in which
as per DATE selection, Time will be displayed in tableview.
What you are looking for is a week view which is similar like this component Calendar-UI. You can take it as a reference or modify in it as per your need.
You can customize the UICollectionView by subclassing UICollectionViewLayout to let UICollectionView behave the way you want.
Check this library, it may be helpful to you. Here is the github link.

Designing UI for schedule app (ios Swift)

I'm making an app for iPhone and it should display time tables for various weekly programs (this is an app for a community center). Here is an example of the data:
Mon: 3pm - 4pm: Jogging, 4pm - 5pm: Group Prayers, 6pm - 7pm: Dinner
Wed: 5pm - 6pm: Speech by Dr. X, 6pm - 7pm: Questions and answers, 7pm - 8pm: Discussoin
Fri: ....
The data is fetched from the web and it's read-only.
I want to display the data similar to the image below. So here are two questions I have:
How did this person accomplish this? I'm assuming he put tableview within scrollview (you can swipe left and Sunday tab appears). How??
Is there a better way to dislpay the data? If so, please give suggestions.
Thanks!
I think the better solution for this is to use a pan gesture recognizer to move the table view and the other table view for sunday.
I don't know if there is better way. But the standard iOS calendar uses a different interface and navigation to show the same info.
Use a scrollView and top of it add button as an array. Then make the content size of scrollView as nos of button * width. It might help you.
I think this is the best way to fulfill your criteria.
Let me know if you want any details of above solution.

Call "cellForItemAtIndexPath" before showing ViewController?

I have an app with custom calendar constructed from a UICollectionView. When I load a month for the calendar, I'd like to pre-load the previous and next months so that I can quickly swipe forward or back without delay.
Right now there's a delay in loading the next or previous months after swiping, and in instruments a lot of the delay is attributed to the UICollectionView cellForItemAtIndexPath method.
Is there a way to force that method to run without showing the view controller? I need to do that for the previous and next months and that should reduce the transition time by about 400ms.
Possible? Thanks for your time

How can I implement an iOS calendar picker similar to Hipmunk's?

I'm working on a couple of iOS apps that require the user to select a calendar date, and while the built-in date picker widget is all right, I'd much prefer if users could choose days from a calendar grid, similar to how it works in Hipmunk's iOS app. In that app, users are shown an infinite scroll view showing a grid of days, with each cell showing the month and day. The days of the week are shown in a persistent (i.e. non-scrolling) banner.
In addition to simply showing a calendar, this control should allow dates to be highlighted/selected. Better still, users should be able to select a whole range of dates by tapping on the start and end days' cells, at which the whole range of days should be highlighted.
Any ideas?
It's an "infinite" UIScrollView with various other views inside of it. Apple provides a demo infinite UIScrollview in their StreetScroller project.
You'll be allocating and initializing views for the various things you wanted displayed on each day, and probably reusing views at the top for the dates (as one scrolls off to the left you change the date and move it over to the right, reusing it the way a UITableView traditionally does).
Selection is a matter of changing visible state of the objects that back your views.

Resources