본문 바로가기
[Kotlin] 장점, 단점, 그리고 아쉬운 점 이야기 [Kotlin] 장점, 단점, 그리고 아쉬운 점 이야기 https://medium.com/keepsafe-engineering/lessons-from-converting-an-app-to-100-kotlin-68984a05dcb6https://medium.com/keepsafe-engineering/kotlin-the-good-the-bad-and-the-ugly-bf5f09b87e6f -위 링크의 글을 쓴 필자는 마켓에 출시된 Java 로 되어 있는 앱을 Kotlin 으로 전환했다.많은 사람들이 Kotlin lib 때문에 dex method limit 이 걸릴 것을 걱정하지만,실제 converting 후 proguard 적용시 method count 는 10% 줄어들고, code line 은 30% 줄.. 2018. 1. 15.
[ios/tutorial] Implicit Animation 없이 property 값 바꾸기 [ios/tutorial] Implicit Animation 없이 property 값 바꾸기 -예를 들면 버튼의 text 를 바꿀 경우, 자연스럽게 글자가 fade out - fade in animation 이 먹는다.순간적으로 버튼의 text 를 바꿀 경우 이는 원하지 않는 동작일 수 있다. -다음 코드를 수행하면 implicit animation 없이 바로 작업을 수행할 수 있다.[UIView performWithoutAnimation:^{ [self.btn setTitle:btnText forState:UIControlStateNormal]; [self.btn layoutIfNeeded];}]; [ios/tutorial] Implicit Animation -> Layer Level 에 대한 이야기 .. 2017. 12. 13.
[ios/tutorial] Core Animation 모든 것!! [ios/tutorial] Core Animation 모든 것!! 참고 : https://www.objc.io/issues/12-animations/animations-explained/ -Animation 을 수행하는 방법은 크게 2가지. 1. UIView 의 class method “animateWithDuration:” 을 사용하는 방법2. Core Animation 을 사용하는 방법. Simple Animation 이 아니라면 Core Animation 을 사용하는 것이 추천된다.훨씬 코드의 가독성이 좋고, 더 많은 기능을 제공한다.But, 더 많은 학습을 필요로 한다. 물론 애플의 권장사항은 할수만 있다면 항상 UIKit 에서 제공되는 Animation 을 사용하길 원한다. -Core Anima.. 2017. 11. 30.
[ios/reference] Layer Style Property Animations [ios/reference] Layer Style Property Animations https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/LayerStyleProperties/LayerStyleProperties.html -Geometry Properties bounds position frame anchorPoint cornerRadius transform zPosition -Background Properties backgroundColor backgroundFilters ( only OS X) -Layer Content contents contentsGravity masksToBounds .. 2017. 11. 24.
[ios/reference] Improving Animation Performance [ios/reference] Improving Animation Performance https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/ImprovingAnimationPerformance/ImprovingAnimationPerformance.html#//apple_ref/doc/uid/TP40004514-CH9-SW1 -가능하면 항상 Opaque Layer 를 사용하라. opaque property 를 YES 로 해놓으면 alpha channel 을 유지할 필요가 없음을 알게 된다. 그래서 blend 하는 로직을 타지 않아도 되서 rendering performance 가 좋아진다. 만약 c.. 2017. 11. 23.
[ios/reference] Core Animation Basics [ios/reference] Core Animation Basics https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/CoreAnimationBasics/CoreAnimationBasics.html#//apple_ref/doc/uid/TP40004514-CH2-SW3 -Prerequisite 로 앞의 글들을 읽어보길...앞의 글들에서 catch 하지 못한 부가 정보들만 정리[ios/reference] Core Animation -Core Animation 을 사용하지 않고, 변화에 대해서 drawRect: 에서 다시 그리는 방법도 있지만,이 방법은 MainThread 에서 그림을 그리기 때문에.. 2017. 11. 20.
[ios] Nullable & NonNull annotation [ios] Nullable & NonNull annotation -안드로이드에 보면 @Nullable, @NonNull 이라는 annotation 이 있어 API 사용에 대한 혜안을 주기 편리하다. -iOS 에도 있을까? -있다._Nullable 과 _Nonnull 이 그것이다. --(NSString* _Nullable)informationWithId:(NSString* _Nonnull)id; 위와 같은 문법으로 사용하면 된다. -_Nullable 과 _Nonnull 대신 nullable 과 nonnull 로 사용해도 된다.대신 이 경우에는 괄호의 처음에 온다.-(nullable NSString*)informationWithId:(nonnull NSString*)id; -property 에도 nullab.. 2017. 10. 30.
[Kotlin Tutorial] Annotation 과 Reflection #2 [Kotlin Tutorial] Annotation 과 Reflection #2 참조 : Kotlin in action 10.2. Reflection: introspecting Kotlin objects at runtime -Kotlin 에서의 reflection 은 java.lang.reflect package 의 API 들과 kotlin.reflect package 의 API 들을 사용한다.Kotlin 의 reflection 은 Java 에 없는 nullable type 이나 properties 들의 접근을 가능하게 한다. -runtime lib 의 size 를 줄이기 위해, kotlin 의 reflection API 는 kotlin-reflect.jar 라는 별개의 jar 로 pakcage 되어 있.. 2017. 9. 12.
[Kotlin Tutorial] Annotation 과 Reflection #1 - Chap 10. Annotations and reflection [Kotlin Tutorial] Annotation 과 Reflection #1 - Chap 10. Annotations and reflection 참조 : Kotlin in action 10.1. Declaring and applying annotations. 10.1.1. Applying annotations -Annotation 사용법은 Java 와 동일하다. @ 를 prefix 로 하고 annotation name 을 써주면 된다. -@Deprecated 의 경우 Kotlin 은 Java 의 것에서 향상되었다.replaceWith parameter 가 추가되어, 새로운 version 의 API 에 연결될 수 있다.@Deprecated(“Use removeAt(index) instead.”, Rep.. 2017. 9. 7.
반응형