10
EventKitでリマインダーの 中身を探る Cocoa勉強会#55 2012/10/13 Masayuki Nii [email protected] 1 121013日土曜日

Cocoa勉強会#55-EventKitでリマインダーの中身を探る

Embed Size (px)

DESCRIPTION

Cocoa勉強会#55 2012/10/13 EventKitでリマインダーの中身を探る 新居雅行

Citation preview

Page 1: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

EventKitでリマインダーの中身を探る

Cocoa勉強会#552012/10/13Masayuki [email protected]

112年10月13日土曜日

Page 2: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

212年10月13日土曜日

Page 3: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

EventKit

Brand New on Mountain Lion

Developer Library• Calendar and Reminders Programming Guide• LionまでのCalendarの情報はもしかしてすっかり消えている?

312年10月13日土曜日

Page 4: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

リマインダー

リマインダー or To Do List管理• みなさんはなにを使っていますか?• 私は、スティッキーズ→Calendar→Bento→Remember the Milk→リマインダー

Mountain Lionで新たに搭載されたアプリ• iOSにも搭載されている• カレンダーの区分をそのまま利用• カレンダーの統合表示はない• 時間は必ず時刻まで設定させられる• つまりは、微妙にTo Doではない• どうやら、Appleはこのジャンルに弱い模様

412年10月13日土曜日

Page 5: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

データベースからの取り出し

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日土曜日

Page 6: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

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日土曜日

Page 7: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

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日土曜日

Page 8: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

Demo

812年10月13日土曜日

Page 9: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

重要度のプロパティがない• クラスダンプするとある• これは純粋に「忘れいている」ではないか?

912年10月13日土曜日

Page 10: Cocoa勉強会#55-EventKitでリマインダーの中身を探る

まとめ

EventKitは簡単に使えるが、どうみても足りない

リマインダーやTo Doはまだまだ未開拓かも?

1012年10月13日土曜日