Upload
masayuki-nii
View
327
Download
2
Embed Size (px)
DESCRIPTION
Cocoa勉強会#55 2012/10/13 EventKitでリマインダーの中身を探る 新居雅行
Citation preview
212年10月13日土曜日
EventKit
Brand New on Mountain Lion
Developer Library• Calendar and Reminders Programming Guide• LionまでのCalendarの情報はもしかしてすっかり消えている?
312年10月13日土曜日
リマインダー
リマインダー or To Do List管理• みなさんはなにを使っていますか?• 私は、スティッキーズ→Calendar→Bento→Remember the Milk→リマインダー
Mountain Lionで新たに搭載されたアプリ• iOSにも搭載されている• カレンダーの区分をそのまま利用• カレンダーの統合表示はない• 時間は必ず時刻まで設定させられる• つまりは、微妙にTo Doではない• どうやら、Appleはこのジャンルに弱い模様
412年10月13日土曜日
データベースからの取り出し
EKEventStoreクラスのインスタンスを得る• OS X: EKEventStore *store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskEvent];• iOS: [store requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) {// handle access here}];
全部取り出す• NSPredicate *predicate = [store predicateForRemindersInCalendars:nil];[store fetchRemindersMatchingPredicate:predicate completion:^(NSArray *reminders) { for (EKReminder *reminder in reminders) { // do something for each reminder }}];• 日付や完了日の範囲を指定して取り出しができる
512年10月13日土曜日
EKReminderクラス
プロパティはこれだけ?• startDateComponents• dueDateComponents• completed• completionDateEKCalendarItemが親クラス• calendar、title、location、creationDate、lastModifiedDate、timeZone、URL、hasNotes、notes 、hasAttendees 、attendees 、hasAlarms、alarms• calendarItemIdentifier, recurrenceRules etc.さらに、EKObject: NSObject
612年10月13日土曜日
EKAlarm
EKAlarm • absoluteDate、relativeOffset、structuredLocation、proximity• type、emailAddress、soundName、url• proximity : EKAlarmProximityNone, EKAlarmProximityEnter, EKAlarmProximityLeave,• type : EKAlarmTypeDisplay, EKAlarmTypeAudio, EKAlarmTypeProcedure, EKAlarmTypeEmail,
EKStructuredLocation• title、geoLocation 、radius
712年10月13日土曜日
Demo
812年10月13日土曜日
謎
重要度のプロパティがない• クラスダンプするとある• これは純粋に「忘れいている」ではないか?
912年10月13日土曜日
まとめ
EventKitは簡単に使えるが、どうみても足りない
リマインダーやTo Doはまだまだ未開拓かも?
1012年10月13日土曜日