SlideShare a Scribd company logo
1 of 24
Download to read offline
"リマインダー"の繰り返しを
自由に設定する

Cocoa勉強会	#64	/	2014-02-08	/	木村渡

Powered by Rabbit 2.1.1 and COZMIXNG
リマインダー

http://support.apple.com/kb/HT4970?
viewlocale=ja_JP
リマインダー
iOS/OS Xの標準アプリ
指定の期日にアラーム/通知
iCloudやiTunes経由で同期できる
これでタスク管理をしようとすると
「むきー!」となるので注意
背景
iOS7になってからリマインダーを使
いはじめた。
「3週間ごとの繰り返し」を設定し
たいモノができた。
既定の繰り返しからしか選べない?
背景
EventKit
第55回の発表参照。
カレンダーとリマインダーへのアクセ
スを提供するフレームワーク。
Calendar and Reminders Programming Guide
(Mac Developer Library)
邦訳	カレンダーとリマインダーのプログラミングガイド
EKRecurrenceRule
EKRecurrenceFrequency
interval
Days of the Week
どうみても、いろんな繰り返しが指定
できそう。
EKRecurrenceRule
ドキュメントを見た感じではさまざま
な設定が可能。
実際に試して、確認する必要がある。
現在利用可能なもの以外の繰り返し
の指定を受け入れるか。
リマインダーアプリがその繰り返し
で動作するか。
EventKit超概要(リマインダー)
このような階層になっている。
EKEventStore - リマインダー	or イ
ベント
EKCalendar - "ビジネス"、"買い
物"などの種類。
EKReminder - 個々のリマインダー
RubyCocoa+irbで試してみる
% irb1.8 -rosx/cocoa --simple-prompt
>> include OSX
>> require_framework 'EventKit'

※デモはirbでなくpryです。
ストアとカレンダーを取得
>> store =
EKEventStore.alloc.
initWithAccessToEntityTypes(
EKEntityTypeReminder)
>> calendars =
store.calendarsForEntityType(
EKEntityTypeReminder)
>> calendar = calendars.find {|cal|
cal.title == "テストだよ!"}
新規のリマインダーを作成

>> reminder = EKReminder.
reminderWithEventStore(store)
>> reminder.title = "3週間ごとに実⾏する!
>> reminder.calendar = calendar
リマインダー期限を設定

>> 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でいいじゃん…
3週間ごとの繰り返しを作成

>> rule = EKRecurrenceRule.alloc.
initRecurrenceWithFrequency_inter
end(EKRecurrenceFrequencyWeekly,
3, nil)
>> reminder.addRecurrenceRule(rule)
保存する
>> result, err = store.saveReminder_
commit_error(reminder, true)
=> [true, nil]
アプリで確認。
3週間ごとになっているかを確認
完了させて次の繰り返しへ。
3週間ごとになっているかを確認
もう一度。

3週間ごとになってる!
いろんな設定を試してみる
EKRecurrenceRuleの長ーいイニシャ
ライザ。array渡す。
initRecurrenceWithFrequency:
interval:
daysOfTheWeek:daysOfTheMonth:
monthsOfTheYear:weeksOfTheYear:
daysOfTheYear:
setPositions:end:
月2回(15日,	月末)
frequency:
EKRecurrenceFrequencyMonthly
daysOfTheMonth: [15, -1]
毎月第1、第3水曜日
frequency:
EKRecurrenceFrequencyMonthly
daysOfTheWeek:
EKRecurrenceDayOfWeek.dayOfW
eek_weekNumber(4, 1),..
まとめとか感想とか
プログラムからはかなり自由に繰り
返しを設定できる。
ただしアプリの表示は「カスタムの
繰り返しパターン」に。
まとめとか感想とか
RubyCocoa便利ですよ!(宣伝)
10.5 Leopard以降のOS Xに標準イ
ンストール済み。
irb/pryで対話的に試行錯誤でき
る。コンパイル不要。
ruby 2.0や2.1への対応作業中…
終

Powered by Rabbit 2.1.1 and COZMIXNG

More Related Content

Viewers also liked (12)

らくらくアップデートSparkle
らくらくアップデートSparkleらくらくアップデートSparkle
らくらくアップデートSparkle
 
ClangでObjective-Cを静的解析
ClangでObjective-Cを静的解析ClangでObjective-Cを静的解析
ClangでObjective-Cを静的解析
 
InputMethodKitで入力プログラムをつくろう
InputMethodKitで入力プログラムをつくろうInputMethodKitで入力プログラムをつくろう
InputMethodKitで入力プログラムをつくろう
 
Hotkeyslib3 Cocoaでホットキー
Hotkeyslib3 CocoaでホットキーHotkeyslib3 Cocoaでホットキー
Hotkeyslib3 Cocoaでホットキー
 
Quickcursorに見る、アプリケーション間通信
Quickcursorに見る、アプリケーション間通信Quickcursorに見る、アプリケーション間通信
Quickcursorに見る、アプリケーション間通信
 
InputMethodKit超入門
InputMethodKit超入門InputMethodKit超入門
InputMethodKit超入門
 
Precipitateに見る、外部リソースのSpotlight化
Precipitateに見る、外部リソースのSpotlight化Precipitateに見る、外部リソースのSpotlight化
Precipitateに見る、外部リソースのSpotlight化
 
PSMTabBarControl
PSMTabBarControlPSMTabBarControl
PSMTabBarControl
 
SIMBLでCocoaアプリをパワーアップ
SIMBLでCocoaアプリをパワーアップSIMBLでCocoaアプリをパワーアップ
SIMBLでCocoaアプリをパワーアップ
 
Three20のTTURLRequest
Three20のTTURLRequestThree20のTTURLRequest
Three20のTTURLRequest
 
OS X DYLD_* environments
OS X DYLD_* environmentsOS X DYLD_* environments
OS X DYLD_* environments
 
Clang Modules
Clang ModulesClang Modules
Clang Modules
 

Similar to リマインダーの繰り返しを自由に設定する (EventKit)

Similar to リマインダーの繰り返しを自由に設定する (EventKit) (13)

Pebble開発について大いに語る
Pebble開発について大いに語るPebble開発について大いに語る
Pebble開発について大いに語る
 
iPhoneアプリ無料勉強会 vol3
iPhoneアプリ無料勉強会 vol3iPhoneアプリ無料勉強会 vol3
iPhoneアプリ無料勉強会 vol3
 
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
 
iPhoneアプリ開発の歩き方〜Swift編〜
iPhoneアプリ開発の歩き方〜Swift編〜iPhoneアプリ開発の歩き方〜Swift編〜
iPhoneアプリ開発の歩き方〜Swift編〜
 
Cakephp
CakephpCakephp
Cakephp
 
Unityの夕べ in Fukuoka
Unityの夕べ in FukuokaUnityの夕べ in Fukuoka
Unityの夕べ in Fukuoka
 
Visual studio 2015 update1 ctpとcsi
Visual studio 2015 update1 ctpとcsiVisual studio 2015 update1 ctpとcsi
Visual studio 2015 update1 ctpとcsi
 
Watch kit解説と実際のtips
Watch kit解説と実際のtipsWatch kit解説と実際のtips
Watch kit解説と実際のtips
 
Jsug 20160422 slides
Jsug 20160422 slidesJsug 20160422 slides
Jsug 20160422 slides
 
NSNotification in Swift #cocoa_kansai
NSNotification in Swift #cocoa_kansaiNSNotification in Swift #cocoa_kansai
NSNotification in Swift #cocoa_kansai
 
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
 
[DSO] Machine Learning Seminar Vol.8 Chapter 9
[DSO] Machine Learning Seminar Vol.8 Chapter 9[DSO] Machine Learning Seminar Vol.8 Chapter 9
[DSO] Machine Learning Seminar Vol.8 Chapter 9
 
iOSやAndroidアプリ開発のGoodPractice
iOSやAndroidアプリ開発のGoodPracticeiOSやAndroidアプリ開発のGoodPractice
iOSやAndroidアプリ開発のGoodPractice
 

Recently uploaded

Recently uploaded (12)

新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 

リマインダーの繰り返しを自由に設定する (EventKit)