狠狠撸
Search
Submit Search
リマインダーの繰り返しを自由に設定する (EventKit)
?
1 like
?
3,855 views
Wataru Kimura
Cocoa勉強会(関東) 64回 2014-02-08 EventKitを利用して、リマインダーアプリからは指定できない「繰り返し」を設定する。
Read less
Read more
1 of 24
Download now
Download to read offline
More Related Content
リマインダーの繰り返しを自由に設定する (EventKit)
1.
"リマインダー"の繰り返しを 自由に設定する Cocoa勉強会 #64 / 2014-02-08 / 木村渡 Powered by Rabbit
2.1.1 and COZMIXNG
2.
リマインダー http://support.apple.com/kb/HT4970? viewlocale=ja_JP
3.
リマインダー iOS/OS Xの標準アプリ 指定の期日にアラーム/通知 iCloudやiTunes経由で同期できる これでタスク管理をしようとすると 「むきー!」となるので注意
4.
背景 iOS7になってからリマインダーを使 いはじめた。 「3週間ごとの繰り返し」を設定し たいモノができた。 既定の繰り返しからしか選べない?
5.
背景
6.
EventKit 第55回の発表参照。 カレンダーとリマインダーへのアクセ スを提供するフレームワーク。 Calendar and Reminders
Programming Guide (Mac Developer Library) 邦訳 カレンダーとリマインダーのプログラミングガイド
7.
EKRecurrenceRule EKRecurrenceFrequency interval Days of the
Week どうみても、いろんな繰り返しが指定 できそう。
8.
EKRecurrenceRule ドキュメントを見た感じではさまざま な設定が可能。 実際に試して、確認する必要がある。 現在利用可能なもの以外の繰り返し の指定を受け入れるか。 リマインダーアプリがその繰り返し で動作するか。
9.
EventKit超概要(リマインダー) このような階層になっている。 EKEventStore - リマインダー or
イ ベント EKCalendar - "ビジネス"、"買い 物"などの種類。 EKReminder - 個々のリマインダー
10.
RubyCocoa+irbで試してみる % irb1.8 -rosx/cocoa
--simple-prompt >> include OSX >> require_framework 'EventKit' ※デモはirbでなくpryです。
11.
ストアとカレンダーを取得 >> store = EKEventStore.alloc. initWithAccessToEntityTypes( EKEntityTypeReminder) >>
calendars = store.calendarsForEntityType( EKEntityTypeReminder) >> calendar = calendars.find {|cal| cal.title == "テストだよ!"}
12.
新規のリマインダーを作成 >> reminder =
EKReminder. reminderWithEventStore(store) >> reminder.title = "3週間ごとに実?する! >> reminder.calendar = calendar
13.
リマインダー期限を設定 >> due_date =
NSDateComponents.alloc.i >> due_date.year = 2014; due_date.month = 2; due_date.day = 8 >> due_date.hour = 18; due_date.minute = 30 >> reminder.dueDateComponents = due_da NSDateでいいじゃん…
14.
3週間ごとの繰り返しを作成 >> rule =
EKRecurrenceRule.alloc. initRecurrenceWithFrequency_inter end(EKRecurrenceFrequencyWeekly, 3, nil) >> reminder.addRecurrenceRule(rule)
15.
保存する >> result, err
= store.saveReminder_ commit_error(reminder, true) => [true, nil]
16.
アプリで确认。
17.
3週間ごとになっているかを確認 完了させて次の繰り返しへ。
18.
3週間ごとになっているかを確認 もう一度。 3週間ごとになってる!
19.
いろんな設定を試してみる EKRecurrenceRuleの長ーいイニシャ ライザ。array渡す。 initRecurrenceWithFrequency: interval: daysOfTheWeek:daysOfTheMonth: monthsOfTheYear:weeksOfTheYear: daysOfTheYear: setPositions:end:
20.
月2回(15日, 月末) frequency: EKRecurrenceFrequencyMonthly daysOfTheMonth: [15, -1]
21.
毎月第1、第3水曜日 frequency: EKRecurrenceFrequencyMonthly daysOfTheWeek: EKRecurrenceDayOfWeek.dayOfW eek_weekNumber(4, 1),..
22.
まとめとか感想とか プログラムからはかなり自由に繰り 返しを設定できる。 ただしアプリの表示は「カスタムの 繰り返しパターン」に。
23.
まとめとか感想とか RubyCocoa便利ですよ!(宣伝) 10.5 Leopard以降のOS Xに標準イ ンストール済み。 irb/pryで対話的に試行錯誤でき る。コンパイル不要。 ruby
2.0や2.1への対応作业中…
24.
終 Powered by Rabbit
2.1.1 and COZMIXNG
Download