More Related Content Similar to H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례 Similar to H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례 (20) H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례2. 김'윤'봉 |'YoonBong'Kim
iOS Developer
@y8k
Eager for some knowledge constantly.
14. ✓ 확장'파일'속성으로'제어
속성이'부여된'파일은'/Documents'디렉토리의'데이터라도'iCloud로'백업'안됨
파일'생성'직후에'호출
iOS'5.0.1'에서'추가됨
#include'<sys/xattr.h>
-'(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL'*)URL'''{
''''const'char*'filePath'='[[URL'path]'fileSystemRepresentation];
''''const'char*'attrName'='"com.apple.MobileBackup";
''''u_int8_t'attrValue'='1;'
''''int'result'='setxattr(filePath,'attrName,'&attrValue,'sizeof(attrValue),'0,'0);
''''return'result'=='0;
}
16. ✓ Apple의'권고안
CoreFoundation는'미적용
C'구조체'객체'포인터'대신'다른'객체(NSObject)에'포인터를'저장
객체와'객체가'아닌'타입'사이에'직접'캐스팅의'금지
NSAutorelease'대신'@autoreleasepool'와'중괄호({,})를'이용
assign,'retain'대신'weak,'strong'속성'이용
➡ 성능보다는'생산성의'향상
18. ✓ ACAccount'Framework
ACAccount,'ACAccountStore,'ACAccountType'클래스'제공
현재는'트위터'계정정보만'저장'및'사용'가능
구조상'다른'OAUTH'서비스도'적용이'가능
ACAccountStore
ACAccountType
Service'1 Service'2
Account Account Account ...
Account Account Account
... ... ...
21. ✓ Built-in'Composer'사용하기
enum'TWTweetComposeViewControllerResult'{
'TWTweetComposeViewControllerResultCancelled,
'TWTweetComposeViewControllerResultDone
};
23. ✓ JSON'Parser의'내장
NSJSONSerialization'Class'의'추가
JSON'Data'to'Object
+'isValidJSONObject:
+'dataWithJSONObject:(id)obj'options:(NSJSONWritingOptions)opt'
'''''error:(NSError'**)error;
+'JSONObjectWithData:(NSData'*)data'options:(NSJSONReadingOptions)opt'
'''''error:(NSError'**)error;
Stream'to'JSON
+'writeJSONObject:(id)obj'toStream:(NSOutputStream'*)stream'
'''''options:(NSJSONWritingOptions)opt'error:(NSError'**)error;
+'(id)JSONObjectWithStream:(NSInputStream'*)stream'
'''''options:(NSJSONReadingOptions)opt'error:(NSError'**)error;
25. ✓ 추가된'메소드
-'addChildViewController:
//'child'추가/삭제
-'removeFromParentViewController:
-'transitionFromViewController:toViewController:
//'child간'전환'애니메이션
''duration:options:animations:completion:
-'willMoveToParentViewController:
//'parent로'이동
-'didMoveToParentViewController:
27. ✓ UIPageViewController로'이미지'뷰어'구현
두 개의 View Controller가 필요
컨텐츠가 정의된 View Controller
페이지를 제어할 UIPageViewController가 정의된 View Controller
컨텐츠 정의 View Controller
이미지 설명과 정보, 페이지 번호 property 구현
UIPageViewController
포함된 View Controller에 ContainerViewController로 정의
페이지 넘김 효과 정의
dataSource, delegate 정의
28. ✓ UIPageViewController'구조
각각은'동일한'구조의'ViewController
현재'index의'-1,'+1'위치의'ViewController'미리'준비되는'구조
idx'='current'-'1 idx'='current idx'='current'+'1
Before Current After
30. ✓
UINavigationBar와'UIToolbar는'기본적으로'background에'image'적용'불가
UINavigationBar,'UIToolBar'의'background'에'이미지'적용
''iOS4'까지는'기본적으로'제공하는'메소드'없음
-'drawRect'메소드를'이용,'Layer를'이용'등의'방법'등'이용
-'기본'NavigationBar가'아닌'UIView를'이용하여'구현
''iOS5'에서'기본'메소드'지원
-'setBackgroundImage:'forBarMetrics':'UINavigationBar
-'setBackgroundImage:'forToolbarPosition'barMetrics':'UIToolBar
31. ✓
단말기의'UDID를'얻는'[[UIDevice'currentDevice]'uniqueIdentifier]
-'단말기를'구분하기'위한'유일값
-'Deployment가'iOS'5.0'이상일'경우'컴파일'경고.
-'당장의'조치가'아닌'서서히'사용을'줄여나갈려는'의지로'해석됨
UUID의'사용'권장
-'앱을'사용하는'사용자의'유일한'값
-'유일값으로'UUID를'이용하여'생성하도록'권고
-'Core'Foundation'레벨에서의'API'존재
36. ✓
[[[UIDevice'currentDevice]'systemVersion]'floatValue]'>='5.0f'로'분기
재사용'및'효율적인'코드'관리를'위해서'클래스'단위를'iOS'버전별로'나누자!
귀찮다고'생각하기보다'미리'해놓는다고'생각하자!
단,'새로운'기능이라고'다'좋은'것은'아니다!
37. ✓
In'Xcode'4.x
$(ARCHS_STANDARD_32_BIT)'=='armv7
By'Xcode'3.x
Standard'=='armv6
Optimized'=='armv7
38. ✓
최신'버전보다는'현재'사용자가'많이'사용하는'OS를'기준!
적용'가능한'부분은'일부의'적용으로'사용자에게'새로운'경험을'줄'수'있다는'점!
➡ 따라서'적절한'새로운'기능'조합과'함께'전략이'필요함!
✓
새로운'무언가는'개발자의'활력소이다.
이'활력소를'스스로의'것만이'아닌'프로젝트에'적용함으로'보람을'느끼자!
부단히'노력하는'모습'어필!
➡ 배움을'게을리하지'말아야'할'개발자들의'필수덕목!!