How can I get the user interface calendar?

Could you help me with this question, please?

I just need to put a simple calendar on one of the screens, and I don’t know how to get it, because this user interface element is not in IB.

My client wants the screen to look like the image below, without a UISegmentedControl (with a list, day, month) on which there is a Calendar application on the iPhone.

He wants to see only the calendar, and when you click on one of the days, another view will appear (FYI: view with data downloaded from the corresponding site for that day).

http://craigl21.typepad.com/.a/6a00e008db59db8834010535e2d304970c-800wi

So finally my questions are:

  • How to get a calendar?
  • I have the "Today" function in the right pane of the working navigation panel (click and another view loaded). I would like to know how I can put a similar function for calendar days, and I believe that they are all buttons, and I don’t know how I can access them (since I don’t know anything about the Calendar element yet).
  • By default, today's date should be selected in blue when loading this view on the calendar, and when you click any of the days, another view will be loaded. If today is the date I download the Calendar view, will the new view with today's details be downloaded immediately? (how can this behavior be avoided?) or, hopefully, will the calendar wait for my click on today's date (or any other date)?

Your help would be greatly appreciated.

+6
source share
4 answers

The NSCalendar classes are used only for calculating the date, and apple does not provide a standard calendar item as part of their UIKit library. However, look at this github project, someone posted a project that contains a user UI.

https://github.com/guicocoa/calendar .

All of this is open source, so you can customize the design and functionality as you need.

+4
source

You can use the https://github.com/devinross/tapkulibrary calendar for your application. If you want to add an event to the selection date, do you need to import events from your application into your own iphone calendar? You must use EventKit for this.

+3
source

The calendar you are looking for is NSGregorianCalendar. When using NSDateComponents and NSDate, you can create your own calendar, as shown in your link.

You need a custom object for fragments with the NSDate property, in which you can get the date of the label using NSDateComponents. You can also assign a method to a delegate, so when your date cell object is touched, it tells the delegate that it has been touched, and then you can do what you want ...

0
source

In addition to the calendar app that @aporat offers, you should check out Kal , which is a very full-featured holiday Calendar app interface and is open source and editable and customizable.

It's kind of crazy that there is no calendar user interface of its own, but it is.

0
source

Source: https://habr.com/ru/post/890998/


All Articles