Evernoteã®å©ç¹ã®1ã€ã¯ããã®éåšæ§ã§ãã åœç€Ÿã®ã¢ããªã±ãŒã·ã§ã³ã¯ãã»ãŒãã¹ãŠã®éèŠãªã¢ãã€ã«ãã©ãããã©ãŒã ã2ã€ã®æã人æ°ã®ããã³ã³ãã¥ãŒã¿ãŒOSãããã³ãã®ä»ãã¹ãŠã®å ŽåïŒWebã€ã³ã¿ãŒãã§ã€ã¹çµç±ïŒã§åäœããŸãã ããããç§ãã¡ã¯ããã§æ¢ãŸãã€ããã¯ãããŸããã
çŸåšãããå€ãã®ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãEvernoteã«æ å ±ãèªã¿æžãããæ©èœããµããŒãããŠããŸãã ç§ãã¡ã¯ããããšãŠãæ°ã«å ¥ã£ãŠãããããã«ç¶ããããšæã£ãŠããŸã-ããªãã®ããŒãã«ã¢ã¯ã»ã¹ããæ¹æ³ãå€ãã»ã©ãããè¯ãã§ãïŒãããã«ãããç§ãã¡ã«æããŸãïŒã éçºè ãšããŠã3000äžäººä»¥äžã®ãŠãŒã¶ãŒã«ã¢ã¯ã»ã¹ãããããã®äººã ã®ç®ã§ã¢ããªã±ãŒã·ã§ã³ã®äŸ¡å€ãå³åº§ã«é«ããå€éšã®ãããžã¿ã«ã¡ã¢ãªããšéä¿¡ããæ©äŒãéãããšãã§ããŸãã
Evernoteãã©ãããã©ãŒã ïŒãŸãã¯éçºå šè¬ïŒã®åŠç¿ãå§ããã°ããã§ãã¢ããªã±ãŒã·ã§ã³ããµãŒãã¹ã«çµ±åãããéçºè åãã®ããã¥ã¢ã«ãå®æçã«çºè¡ããããšã«ããŸããã
ãã®æçš¿ã§ã¯ãEvernoteããã¹ãiOSã¢ããªã±ãŒã·ã§ã³ã«çµ±åããããã®ç¹å®ã®æé ã«ã€ããŠèª¬æããŸãã Xcodeã§æ°ãããããžã§ã¯ããéå§ããEvernoteãœãããŠã§ã¢éçºãããïŒSDKïŒãããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããCloud APIãä»ããŠEvernoteãšå¯Ÿè©±ããã·ã³ãã«ãªã¢ããªã±ãŒã·ã§ã³ãäœæããŸãã
å§ããåã«ãå°æ¥ã®ç¬ç«ããä»äºã«å¿ èŠãªãã®ããªã¹ãããŸãã
- sandbox.evernote.comã®ã¢ã«ãŠã³ãã¯ãéçºè åãã®Evernoteãµã³ãããã¯ã¹ãµãŒããŒã§ãã Evernote Cloud APIãä»ããŠå®è¡ãããã¢ããªã±ãŒã·ã§ã³ããããã°ããããã«äœ¿çšãããŸãã ããã§ãã¹ãã¢ã«ãŠã³ããäœæã§ããŸãã
- Evernote APIããŒïŒããŒããªã¯ãšã¹ã ïŒã APIããŒã¯ã ã³ã³ã·ã¥ãŒãããŒãšã³ã³ã·ã¥ãŒãã·ãŒã¯ã¬ããã®2ã€ã®éšåã§æ§æãããŸãã ïŒ æ³šïŒç¬èªã®ã¢ããªã±ãŒã·ã§ã³ãéçºããŠããå Žåã¯ãã¢ããªã±ãŒã·ã§ã³ã®éçºãçµäºããããEvernoteã¡ã€ã³ãµãŒããŒã§ããŒãæå¹ã«ããããã«äŸé Œããå¿ èŠãããããšã«æ³šæããŠãã ãããããã¯dev.evernote.com/supportã®ãã©ãŒã ããè¡ããŸã ïŒã
- å·çæç¹ã§ã®Xcodeã®ææ°ããŒãžã§ã³ã¯ãIntel Macã«ã€ã³ã¹ããŒã«ãããŠãã4.3.2ã§ãã
ãã¹ãŠåšåº«ããããŸããïŒ ããã§ã¯ãå§ããŸãããã
ãã®ã¢ããªã±ãŒã·ã§ã³ã¯ãçŸåšã®ãŠãŒã¶ãŒã®ååãšã¢ã«ãŠã³ãå ã®ã¡ã¢ã®ç·æ°ã衚瀺ãããšãã2ã€ã®ããšãæ£ç¢ºã«è¡ããŸãã
*ã¢ããªã±ãŒã·ã§ã³ã®ããã«ãã®ã¢ã€ãã¢ãå¶ç¶ã«éžæããããšãæ確ã«ãã䟡å€ããããéå§æã«ãã®æ å ±ã«ç°¡åã«ã¢ã¯ã»ã¹ããããã®APIããããã©ããããããŸããã§ãã*
åºç€ãç¯ã
ã³ãŒããæžãå§ããŠæåã®ãŠãŒã¶ãŒã«æéãäžããåã«ãXcodeãããžã§ã¯ããäœæããiOSçšã®Evernote SDKãã€ã³ã¹ããŒã«ããæ¹æ³ãæºåããå¿ èŠããããŸãã
Xcodeãããžã§ã¯ãã®äœæ
- Xcodeãèµ·åããã¡ãã¥ãŒããããã¡ã€ã«ã>ãæ°èŠã>ããããžã§ã¯ããã䜿çšããŠãããžã§ã¯ããäœæããŸãã
- ãããžã§ã¯ããã³ãã¬ãŒããæå®ããããã«æ±ããããããå·ŠåŽã®ã¡ãã¥ãŒã®[iOS]ã§[ã¢ããªã±ãŒã·ã§ã³]ãéžæãã[ã·ã³ã°ã«ãã¥ãŒã¢ããªã±ãŒã·ã§ã³]ãã¯ãªãã¯ããŸãã 次ã«ã次ãžããã¯ãªãã¯ããŸãã
- 次ã®ç»é¢ã§ãæ°ããã¢ããªã±ãŒã·ã§ã³ã®ããã€ãã®ç¹æ§ãæ確ã«ããå¿
èŠããããŸãã
- 補ååã«ãEvernoteCounterããæå®ããŸãã
- äŒç€Ÿèå¥åã¯ä»»æã§ãã ãã®å€ã¯ãäžçäžã®ã¢ããªã±ãŒã·ã§ã³ãèå¥ããããã«äœ¿çšãããŸãããã³ã³ãã¥ãŒã¿ãŒãããå ã«å®è¡ããããšã¯ãªããããéèŠã§ã¯ãããŸããã ãã®äŸã§ã¯ããcom.somecompanyããæå®ããŸããã
- ã¯ã©ã¹ãã¬ãã£ãã¯ã¹ã«ãECããæå®ããŸãïŒãEvernoteCounterãã®ç¥ïŒã ãã®ç¥èªã¯ãã³ãŒãã®èšè¿°ãéå§ãããšãã«ãã¹ãŠã®ã¯ã©ã¹åã«å è¡ããŸãã
- ããã€ã¹ãã¡ããªã§ãiPhoneããæå®ããŸãã
- 3ã€ã®ããã¯ã¹ããã¹ãŠãªãã«ãªã£ãŠããããšã確èªããŠãã ããã
- å®äºãããã次ã®ããã«ãã£ãŒã«ãã«å
¥åããå¿
èŠããããŸãã
- æåŸã«ããããžã§ã¯ãã®å Žæã瀺ãããã«æ±ããããŸãã ããªãã®è£éã§ãããéžæããŠãã ããã
Xcodeãããžã§ã¯ãã®æºåãã§ããŸããã æ°åéãããèã«çœ®ããŸãã ã¢ããªã±ãŒã·ã§ã³ãEvernoteã¯ã©ãŠãAPIãšããåãããã«ã¯ãSDKãå¿ èŠã§ãã ãããååŸããŠããããžã§ã¯ãã«è¿œå ããŸãããã
iOSçšEvernote SDKãããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããŸã
- Evernote SDKã¯ãã¹ãŠGithubã§å ¥æã§ããŸãã ãã®äžã«ã¯iOS SDKããããŸã ã
- å³äžå€®ã®ãããŠã³ããŒãããªã³ã¯ãã¯ãªãã¯ããŸãã
- 衚瀺ãããããŒãžã§ããzipãšããŠããŠã³ããŒãããã¯ãªãã¯ããŸãã SDKã®çŸåšã®ããŒãžã§ã³ãããŠã³ããŒãããŸãã
- ãã¡ã€ã«ã解åãããšã次ã®ãããªãã£ã¬ã¯ããªã衚瀺ãããŸãã
ããŠã³ããŒãããSDKãã£ã¬ã¯ããªã§ã
evernote-sdk-ios
ãã©ã«ããŒãéžæãã
evernote-sdk-ios
ãããžã§ã¯ãã«ãã©ãã°ããŸãã
Xcodeã¯ãããªããäœããããã«ã€ããŠããã€ã質åãããŸãã ããã©ã«ãã§ã¯ãã¹ãŠãæ®ãããšãã§ããŸã-[å®äº]ãã¯ãªãã¯ããŸãã
iOSçšEvernote SDKã«ã¯
Security.framework
ã³ã³ããŒãã³ããå¿ èŠãªã®ã§ãã¢ããªã±ãŒã·ã§ã³éçºããã»ã¹ã«å«ããå¿ èŠããããŸãã
- XcodeãŠã£ã³ããŠã®å·Šäžé ã«ãããããžã§ã¯ããã¯ãªãã¯ããŸãã
- ãŠã£ã³ããŠã®äžéšäžå€®ã«ãã[ãã«ããã§ãŒãº]ãã¯ãªãã¯ããŸãã
- ãã©ã€ãã©ãªãšãã€ããªããªã³ã¯ããªã¹ããå±éããå·Šäžã®ãã©ã¹èšå·ãã¯ãªãã¯ããŸãã
- 衚瀺ããããªã¹ãã®æ€çŽ¢ããŒã§ããã»ãã¥ãªãã£ããšå ¥åãå§ããŸãã
-
Security.framework
ããªã¹ãã«è¡šç€ºããããããããã¯ãªãã¯ããŠåŒ·èª¿è¡šç€ºãããè¿œå ããã¯ãªãã¯ããŸãã
ãã¹ãŠã®æºåäœæ¥ãå®äºããã®ã§ã楜ããéšåã«ç§»ããŸãããã
ã¢ããªã±ãŒã·ã§ã³äœæ
ãã§ã«è¿°ã¹ãããã«ãã¢ããªã±ãŒã·ã§ã³ã¯ãã£ã1ã€ã®ããšãè¡ãããšãã§ããŸã-Evernoteã¢ã«ãŠã³ãã§ãŠãŒã¶ãŒãèªèšŒãããã®ã¢ã«ãŠã³ãã®ã¡ã¢ã®ç·æ°ã衚瀺ããŸãã
ã¢ããªã±ãŒã·ã§ã³ã®ã«ãŒãæ©èœãæãäžããåã«ãOAuthã䜿çšããŠEvernote Cloud APIãä»ããŠèªèšŒçšã«æ§æããå¿ èŠããããŸãã iOS SDKã䜿çšãããšãæ°åã§åé¡ãªããã®ãã³ãã«ãå®è£ ã§ããŸãã
OAuthã®æ§æ
ãŸãã
ECAppDelegate.m
ãå€æŽããå¿ èŠããããŸãã ããã©ã«ãã§ã¯ãXcodeã¯didFinishLaunchingWithOptionsã¡ãœãããèªåçã«äœæããŸãã å€æŽããåã«ããã®ã¡ãœããã¯æ¬¡ã®ããã«ãªããŸãã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
OAuthãæ©èœããããã«ã¯ãæ£ãããã¹ããšèªèšŒã®ç¹æš©ã§
EvernoteSession
ã€ã³ã¹ã¿ã³ã¹ãäœæããå¿ èŠããããŸãã å€æŽããã
ECAppDelegate.m
ã¯æ¬¡ã®ããã«ãªããŸãã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
EVERNOTE_HOST
ã¯ã察話ãããªã¢ãŒããã¹ãã§ãã ã¢ããªã±ãŒã·ã§ã³ã®éçºäžã¯ããµã³ãããã¯ã¹ãµãŒããŒã§ããsandbox.evernote.comã«é£çµ¡ããå¿ èŠããããŸãã ã¢ããªã±ãŒã·ã§ã³ããªãªãŒã¹ããåã«ãå¿ ã
EVERNOTE_HOST
ã
www.evernote.com
www.evernote.com
ãåã«æžããããã«ã¡ã€ã³ãµãŒããŒã§ããŒã®ã¢ã¯ãã£ããŒã·ã§ã³ãèŠæ±ããŸãã
CONSUMER_KEY
ãš
CONSUMER_SECRET
ã¯ã以åã«åãåã£ãAPIããŒã®2ã€ã®éšåã§ãã ãã®ãããå®éã®ããŒã®ãã©ã¡ãŒã¿ãŒã§äœ¿çšå¯èœãªå€ãå€æŽããå¿ èŠããããŸãã
次ã«ã
EvernoteSession
æ°ããã€ã³ã¹ã¿ã³ã¹ãåæåãããã®ããããã£ãæå®ããŸãïŒhostã
consumerKey
ã
consumerSecret
ã æåŸã«ãæ°ããã»ãã·ã§ã³å€æ°ã«ã¯ãã¢ããªã±ãŒã·ã§ã³ãEvernote Cloud APIãšå¯Ÿè©±ãããã³ã«äœ¿çšãããã·ã³ã°ã«ãã³ãªããžã§ã¯ããå²ãåœãŠãããŸãã
ãŸããããããŒãã¡ã€ã«ã«EvernoteSession.hãå«ããããšãå¿ããªãã§ãã ããã
ECViewController.h
ã
ECViewController.h
ã«å«ãŸããçŽåŸã«é©åãªå®£èšãè¿œå ããŸãã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
OAuthããã·ãŒãžã£ã«ã¯WebããŒãžãä»ããã¢ããªã±ãŒã·ã§ã³ã®æ¿èªãå«ãŸãããããã¢ããªã±ãŒã·ã§ã³ãéããŠãããªã³ã¯ãåŠçã§ããããšã確èªããå¿ èŠããããŸãã 幞ããªããšã«ãããã¯ãã§ã«iOS SDKã«çµã¿èŸŒãŸããŠããã
ECAppDelegate.m
ãã¡ã€ã«ã®æåŸã«ãã®ã¡ãœãããè¿œå ãã
ECAppDelegate.m
ã§ãïŒ
end
çŽåïŒã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã®äœæ
ããã§ãã¢ããªã±ãŒã·ã§ã³çšã®ã·ã³ãã«ãªã€ã³ã¿ãŒãã§ã€ã¹ãäœæã§ããŸãã å·ŠåŽã®
ECViewController.xib
ãã¯ãªãã¯ããŸãã ã€ã³ã¿ã¬ã¹ããšãã£ã¿ãéããiPhoneç»é¢ã§èšç®ãããèšå®ã衚瀺ãããŸãã ããã§ã¯ããã¿ã³ãããã¹ããã£ãŒã«ããªã©ã®ã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ããã©ãã°ãäœæãã«ã¹ã¿ãã€ãºã§ããŸãããã®ã¢ããªã±ãŒã·ã§ã³ã§ã¯ãããã€ãã®ããã¹ããã£ãŒã«ãïŒEvernoteã®ãŠãŒã¶ãŒåçšãã¡ã¢ã®æ°çšïŒãåãã£ãŒã«ãã®çœ²åããã¿ã³ãå¿ èŠã§ãã©ã®æé ãèµ·åãããããã¯ãªãã¯ããŸãã ïŒããã¹ããã£ãŒã«ãã¯
UILabel
ã¿ã€ãã§ãªããã°ãªããªãããšã«æ³šæããŠãã ãããããã«ãããå€ãåçã«èšå®ã§ããŸããããã«ã€ããŠã¯åŸã§èª¬æããŸãïŒã
å¿ èŠãªãã¹ãŠã®ã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ããªããžã§ã¯ãã©ã€ãã©ãªãããšãã£ã¿ãŒãã£ãŒã«ãã«ãã©ãã°ããŸãã å®äºãããšã次ã®ããã«ãªããŸãã
ãã¿ã³ã®ã¯ãªãã¯ãåŠçããã«ã¯ã
IBOutlet
ããããã£ãš
IBAction
ã¡ãœããã宣èšããå¿ èŠããããŸãã ããããã¹ãŠã
ECViewController.h
ãã¡ã€ã«ã«è¿œå ããŸãããã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
次ã«ãããã¹ãå€é åãé¢é£ä»ããŸããããã¯ããŠãŒã¶ãŒåãšã¡ã¢ã®æ°ã
ECViewController
察å¿ããããããã£ïŒ
usernameField
ãš
noteCountField
ïŒã«è¡šç€ºããŸãã
- å·ŠåŽã®ãããžã§ã¯ããã©ãŠã¶ãŒã§
ECViewController.xib
ãã¯ãªãã¯ããŠãã€ã³ã¿ãŒãã§ã€ã¹ã¬ã€ã¢ãŠããéããŸãã - 次ã«ãããã¬ãŒã¹ãã«ããŒãã®äžã®ããã¡ã€ã«ã®ææè ããå³ã¯ãªãã¯ããŠããªã³ã¯ããã«ãå±éããŸãã
-
usernameField
ã®å³åŽã®ç©ºã®é åãã¯ãªãã¯ãã次ã«ç€ºãããã«ã察å¿ããå€ã®é åã«ãã©ãã°ããŸãã
-
noteCountField
ã§ãåãããšãnoteCountField
ãŸãã
次ã«ã以åã«çºè¡šãã
retrieveUserNameAndNoteCount
ã¡ãœããã«ãã¿ã³ãé¢é£ä»ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãã³ã³ãããŒã«ãæŒããªãããã¿ã³ãããã¡ã€ã«ã®ææè ãã«ãã©ãã°ããŸãã ããŠã¹ãã¿ã³ãæŸããåŸã衚瀺ããã[éä¿¡æžã¿ã€ãã³ã]ãŠã£ã³ããŠã§
retrieveUserNameAndNoteCount
ãéžæã
retrieveUserNameAndNoteCount
ã
ããã§ãã¿ã¹ã¯ãå®è¡ããæºåãã§ããããã¹ããã£ãŒã«ããšãã¿ã³ãã§ããŸãã
ECViewController.m
å éšäœæ¥ãå®è¡ããå¿ èŠããããŸãã XcodeãçæããåŸãããã©ã«ãã§ãã®ãã¡ã€ã«ãã©ã®ããã«èŠãããã以äžã«ç€ºããŸãã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
ã¿ã¹ã¯ãå®äºããã«ã¯ïŒã¢ã«ãŠã³ãã®ãŠãŒã¶ãŒåãšã¡ã¢ã®æ°ã衚瀺ïŒã2ã€ã®ã¡ãœãããäœæããå¿ èŠããããŸãã
ãã¡ãããæåã®ãã¿ã³ã¯ããã¿ã³ãã¯ãªãã¯ããããšãã«åŒã³åºãããã¡ãœããã§ãã
retrieveUserNameAndNoteCount
ã§ãã
ãã®æ¹æ³ã¯æ¬¡ã®ãšããã§ãã
- Evernote Cloud APIã§èªèšŒãæäŸããŸãïŒäœãåé¡ãçºçããå Žåã¯ãšã©ãŒã¡ãã»ãŒãžã衚瀺ããŸãïŒã
- çŸåšã®ãŠãŒã¶ãŒã«é¢ããæ
å ±ã
EDAMUser
ãªããžã§ã¯ããšããŠEDAMUser
ãŸãã ïŒãšããã§ããEDAMãã¯ãEvernoteããŒã¿ã¢ã¯ã»ã¹ãšç®¡çãã®ç¥ã§ãïŒã - usernameFieldã®å€ãšããŠãŠãŒã¶ãŒåãæå®ã
usernameField
ã - å¥ã®ã¡ãœãããåŒã³åºããŠããã®ãŠãŒã¶ãŒã®ã¡ã¢ã®æ°ãååŸããŸãã
å®æããã¡ãœããã¯æ¬¡ã®ãšããã§ãã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
å¿é ããå¿ èŠã¯ãããŸãããä»ãããããã¹ãŠã詳现ã«åæããŸãã
ãŸãã
EvernoteSession
ããŒã«ã«ã€ã³ã¹ã¿ã³ã¹ãååŸããŸãïŒå¯äžã®ã€ã³ã¹ã¿ã³ã¹ïŒã·ã³ã°ã«ãã³ïŒã§ããããã
ECAppDelegate.m
äœæãããã®ãšåãã«ãªããŸãïŒã ãã®åŸã
authenticateWithCompletionHandler
åŒã³åºããŸãã ãã®ã¡ãœããã¯ãEvernoteã¯ã©ãŠãAPIã§ã»ãã·ã§ã³ã®èªèšŒãè©Šã¿ãŸãïŒããã«ã€ããŠã¯ã以äžã®OAuthã»ã¯ã·ã§ã³ã§èª¬æããŸãïŒã èªèšŒäžã«ãšã©ãŒãçºçããå ŽåããŸãã¯äœããã®çç±ã§èªèšŒã倱æããå Žåãããã«é¢ããæ å ±ãNSLogã䜿çšããŠèšé²ããããã€ã¢ãã°ããã¯ã¹ïŒ
UIAlertView
ã€ã³ã¹ã¿ã³ã¹ïŒã«è¡šç€ºãããèªèšŒã®å€±æããŠãŒã¶ãŒã«å ±åãããŸãã
èªèšŒãæåããå Žåãã¢ããªã±ãŒã·ã§ã³ã®ã¡ã€ã³ããžãã¯ã«é²ãããšãã§ããŸãã ã¢ããªã±ãŒã·ã§ã³ãèªèšŒããŒã¯ã³ãåä¿¡ãããšããã«ããã®ããŒã¯ã³ã¯1幎éæå¹ã§ããããŠãŒã¶ãŒã¯å床ãã°ã€ã³ããå¿ èŠãããããšã«æ³šæããŠãã ããã ãã ãããŠãŒã¶ãŒãã¢ããªã±ãŒã·ã§ã³ãåã€ã³ã¹ããŒã«ããããšã«æ±ºããå Žåã¯ãå床ãã°ã€ã³ããå¿ èŠããããŸãã
ãŸãã䜿çšããã¢ã«ãŠã³ãã決å®ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ã
EvernoteUserStore
ïŒ
userStore
ïŒã®ããŒã«ã«ã€ã³ã¹ã¿ã³ã¹ãäœæãããã®
getUserWithSuccess
ã¡ãœãããåŒã³åºããŸãã ããã¯éåæèŠæ±ã§ãããå¿çã§ã¯ãããã¯ã®åœ¢åŒã§å®è£ ãããé¢æ°ãèŠæ±ããŸãïŒå®éããããã¯å¿åé¢æ°ã§ãïŒã æåã®ãããã¯ã¯åäžã®ãã©ã¡ãŒã¿ãŒ
EDAMUser
ãåãå ¥ããèŠæ±ãæåããããšãå ±åããŸãã 2çªç®ã®ãããã¯ïŒ
failure
ïŒã¯ã
NSError
ã€ã³ã¹ã¿ã³ã¹ã1ã€åãå ¥ããŸããããã¯ãæ£ç¢ºã«äœãåé¡ã§ãã£ããã説æããŠããŸãã ãšã©ãŒãæ€åºããããšãã¢ããªã±ãŒã·ã§ã³ã¯ãããåã«ãã°ã«èšé²ãããã以å€ã¯äœãããŸããã
APIãªã¯ãšã¹ããæåããå Žåã
EDAMUser
ã€ã³ã¹ã¿ã³ã¹ãã
username
ããããã£ããªã¯ãšã¹ãããããã
usernameField
ã®å€ãšããŠæå®ã
usernameField
ã
æåŸã«ãä»ã®ã¡ãœãã
countAllNotesAndSetTextField
ãåŒã³åºããŸãã
ç»åãã¯ãªãã¯ããŠGithubã§ãã®ã³ãŒãã衚瀺ããŸã
ãã®ã¡ãœããã¯ããã®ååãéåŒã«èšã£ãŠããããã«ãã¢ã«ãŠã³ãå ã®ããŒãã®æ°ãã«ãŠã³ãããç»é¢ã«è¡šç€ºããŸãã ä»çµã¿ãèŠãŠã¿ãŸãããã
æåã«ã
noteCount
ã«ãŠã³ã¿ãŒ
noteCount
ã宣èšã
noteCount
ã ãã®å€æ°ã§ã¯ãã¢ã«ãŠã³ãã®ã¡ã¢ãã«ãŠã³ããããŸãïŒããã«ã€ããŠã¯åŸã§è©³ãã説æããŸãïŒã
次ã«ã
noteStore
ãšãã
EvernoteNoteStore
ããŒã«ã«ã€ã³ã¹ã¿ã³ã¹ãäœæããŸãã ãã®ãªããžã§ã¯ãã䜿çšããŠã
listNotebooksWithSuccess
ïŒæ¬¡ã®è¡ã§åŒã³åºããŸãïŒãªã©ã®ã¡ãœããã䜿çšããŠãEvernoteã¯ã©ãŠãAPIããããŒããããŒãããã¯ãªã©ãžã®ã¢ã¯ã»ã¹ãèŠæ±ããŸãã Cloud APIã«ã¯ãã¢ã«ãŠã³ãå ã®ãã¹ãŠã®ããŒãã®æ°ãååŸããæ¢è£œã®æ¹æ³ãå«ãŸããŠããªãããã次ã®äžé£ã®ã¢ã¯ã·ã§ã³ãå®è¡ããå¿ èŠããããŸãã
-
listNotebooksWithSuccess
ã䜿çšããŠããŠãŒã¶ãŒã¢ã«ãŠã³ãå ã®ãã¹ãŠã®ããŒãããã¯ã®ãªã¹ããååŸããŸã - ãã®ãªã¹ãã調ã¹ãŠãåããŒãããã¯ã®ããŒãã®æ°ãååŸããŸãã
åç
listNotebooksWithSuccess
ã
listNotebooksWithSuccess
ããã«ãããã€ãã®ãããã¯ã§ãã æåã¯æåãããµãŒããŒå¿çãåŠçãã
EDAMNotebook
ãªããžã§ã¯ãã®ã³ã¬ã¯ã·ã§ã³ãå«ãåäžã®
NSArray
ãã©ã¡ãŒã¿ãŒãåãå ¥ããŸã-ãŠãŒã¶ãŒã®ã¢ã«ãŠã³ãã®åããŒãããã¯ã«1ã€ã
å
EDAMNotebook
ãªããžã§ã¯ãã«ã¯ãäžæã®GUIDãããèå¥åãå«ãŸããŠããŸãã ãã®GUIDã䜿çšããŠã察å¿ããããŒãããã¯ã«ããããŒããæ€çŽ¢ã§ããããã«ãã
EDAMNoteFilter
ã€ã³ã¹ã¿ã³ã¹ãäœæããŸãã æåŸã«ã
EDAMNoteFilter
ããã©ã¡ãŒã¿ãŒãšããŠäœ¿çšããŠã
findNoteCountsWithFilter
ãåŒã³åºããŠããã®ããŒãããã¯å ã®ããŒãã®æ°ãïŒ
EDAMNoteCollectionsCounts
ãªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ãšããŠïŒ
EDAMNoteCollectionsCounts
ãŸãã
çªå·ãåŸãããã®ã§ãããã
noteCount
å€æ°ã«è¿œå ããç»é¢ã®
noteCountField
ãæŽæ°ããŸãã çµæã¯æ¬¡ã®ãšããã§ãã
OAuth
ã»ãã·ã§ã³ãèªèšŒã«åæ Œããªãå ŽåïŒã€ãŸããããŒã¯ã³ãåä¿¡ãããªãå ŽåïŒããã¿ã³ãã¯ãªãã¯ãããšãã¢ããªã±ãŒã·ã§ã³ã¯ã¢ãã€ã«Safariã«å¶åŸ¡ã移ããEvernote Webãµã€ããéããŸãã ããã§ããŠãŒã¶ãŒã¯Evernoteã¢ã«ãŠã³ãã«ãã°ã€ã³ããã¢ããªã±ãŒã·ã§ã³ãã¢ã«ãŠã³ãã«ã¢ã¯ã»ã¹ããããšãèš±å¯ããå¿ èŠããããŸãã
ãŠãŒã¶ãŒããã°ã€ã³ãããšããã©ãŠã¶ãŒã¯ã¢ããªã±ãŒã·ã§ã³ã«å¶åŸ¡ãæ»ãããŠãŒã¶ãŒããã¿ã³ãã¯ãªãã¯ãããã®ããã«ããã»ã¹ãç¶è¡ããŸãã ãã¹ãŠãããŸããã£ãå Žåãäžèšã®ããã«ãŠãŒã¶ãŒåãšã¡ã¢ã®æ°ãç»é¢ã«è¡šç€ºãããŸãã
çµè«ãšããŠ
ãŸãã泚ç®ã«å€ãããã1ã€ã®ãã€ã³ãïŒEvernoteCounterã¢ããªã±ãŒã·ã§ã³ã¯ãiOS SDKã®çµ±åãšäœ¿çšã®å®¹æãã瀺ãããã«äœæãããŸããã ããã倧é䜿çšã®å®éã®ã¢ããªã±ãŒã·ã§ã³ã§ããå Žåããšã©ãŒãçºçããå¯èœæ§ã®ããæ¡ä»¶ã«ãã£ãšæ³šæãæãããä¿è·ãããã°ã©ãã³ã°ã®å®è·µã«åãçµãå¿ èŠããããŸãã ãã ããç解ã®ããã«ãã¹ãã¢ããªã±ãŒã·ã§ã³ã®ã³ãŒããè€éã«ããªãããã«ãããã§ã¯çç¥ããŸããã
Xcodeã®EvernoteCounterãããžã§ã¯ãå šäœã¯ãGithubã§å ¥æã§ããŸãã ã³ãŒããæ¯æŽããã³æ¹åãããå Žåã¯ãå€æŽãææ¡ããããšãheããªãã§ãã ããïŒãã®ã¢ããªã±ãŒã·ã§ã³ã®æ°ããæ©èœã«ã€ããŠã¯è©±ããŠããªãããšã«æ³šæããŠãã ããã