iOS Loading full calendar into ScrollView - ios

We have few calendar libraries like Kal, Tapko etc. but they all present each month separately.
Is there any way to show all months into continuous scrollView?
We can try but as calendar for say 10 years if contains tasks on everyday so its going to be pretty heavy data into UIScrollView.
So how can we solve this problem.
Main motive of asking question is to show whole calendar into continuous scrollView.
Thanks

You can use tableView. Just make a month per cell with reuseIdentifier. Other will be done behind the scenes.

Related

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.

Imitating split view animation used in iOS Calendar app

I am currently experimenting with a calendar framework I found online which possesses most of the functionality I need. However, I would really like to add a feature similar to the animation in the iOS Calendar where when a date is tapped, the view splits at that location and the selected week moves to the top of the calendar. Its an intuitive way to display info about the selected day. I just need some suggestions as to how this can be achieved since I'm not super familiar with collection views.
The calendar is a grid collection view with months as different sections from what I understand. Is it possible to just stick a supplementary view anywhere in a collection view dynamically? Or maybe I should look into adjusting insets at a specific location? I'm really not sure what direction to take and could use some suggestions.
Here is sort of what I want to do but with a table view.

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.

Creating a custom calendar/ month view in iOS

I'm trying to create a custom calendar/ month view from scratch similar to this:
And with that I'm wondering what the correct approach would be. I'm calculating which weekday the first day of the month falls on (mon-sun), and the number of days in the month. This should be enough to determine how the calendar should look, but I'm stuck trying to figure out a way to lay this all out.
Is it best to have 37 buttons in a grid layout in the storyboard and iterate through them somehow, changing their label, or dynamically create these buttons on the fly? Is there any element/ framework in iOS I could make use of to make this process easier?
If going for the latter, how would you set up the constraints to make this scalable on different size classes and screen sizes?
Tim in first comment is right. The best way to build layout for custom calendar view such yours is UICollectionView. Also to make less mistakes you can use NSDate extensions like this one: https://github.com/erica/NSDate-Extensions

how many cells to commence with in a UICollectionView for a Calendar? (i.e. with infinite number of dates)

How many cells to commence with in a UICollectionView for a Calendar? That is my understanding is:
UICollectionView is good in that it only instantiates cells it
needs to display, but then
You still have to add the cells to the collection view
So what is best practice if say your view would only show 10 cells, but you had unlimited cells (e.g. scrolling up and down dates in a calendar). Do you enter say 100 cells for 100 dates (say 50 either side of the starting date of interest) and then manually keep track of when you get to one of these edges and then add more? This would kind of be ashame the UICollectionView framework couldn't keep track of this itself no?
So overall questions therefore (sorry) are really:
How many cells (dates) should you be creating in the collectionview. Should it be limited therefore to say 100
Is there no support in UICollectionView to automate adding more cells in for you for a Calendar type situation where dates are endless if the user wants to keep scrolling forward or backward
Any what is impact on the caching strategy for UICollectionViewLayoutAttributes too?
There is a project on Github with a calendar based on UICollectionView
https://www.cocoacontrols.com/controls/rsdayflow
I have used this component in a production project.
You can easily change it's appearance since every day is a uicollectionviewcell.
This project is based on https://github.com/evadne/DayFlow
that can be a good base to create what you need.
If you want to build your own calendar it can help you to find response to your questions: the code is easy to understand, and the implementation is in my opinion quite neat
It depends on how much is visualized in one screen. If it is one month i would have one month before and one month later. If it is only a day, one day before, one day later. Then use this infinite scrolling trick. There are many examples outside. I didn't read through the following link, but the pictures visualize the idea nicely:
Building a Infinitely-Scrolling Gallery With a UICollectionView

Resources