tags | language |
---|---|
navigation, calendar, views, segue |
objc |
Create a viewer for your tasks last year or this upcoming year.
- Check out the
.xcworkspace
file. Views are set up. - Create a new class for the event detail view. Connect it up
- Now we need to write three methods to get calendar details from the phone. This is hard to do...in this repo I've included the answer for the three methods declared in the
.h
file if you'd like to use them. Please please please feel free to use them. Its a lot of documentation reading and learning how to access the phone calendar through EventKit is not the point of this lab. If you want a challenge, write those methods without my solution. Remember, you don't need to understand everything going on, just make it work - Before doing anything you need to call the
requestCalendarPermission
method. - Each method returns events from the respective time period. They are an array of EKEvent objects. Most importantly they have a
title
property that has the name of the event. - When you click on the each button, do the appropriate thing by passing the correct array of events to the
destinationViewController
- In the destination there is a
UITextView
. This is a standardUIView
that is made to list lots of text. List the title of each event separated by a new line which is the@"\n"
. so@"hello\nJoe"
would print:
hello
Joe
UITextView
s have atext
property just likeUILabel
s.
- To work with
EKEvent
objects, you need to import the EventKit Framework. Do this by typing#import <EventKit/EventKit.h>
- Instead of Buttons, play with two
UIDatePicker
views and display any arbitrary start and end date events.