물방울들을 UIView 에서 CASharpLayer로 변경시켜봤습니다. #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
안녕하세요!!!! 오랜만입니다ㅜㅜ 연휴는 잘 보내셨는지요
Core Animation 공부하다가 공부한 내용을 LeFal 님 께서 만드신 WaterDrops에 적용시키면 좋을거 같아서 한번 수정해봤습니다.
기존에 물방울들이 WaterDropView의 SubView들이 었는데, 성능 측면에서 물방울들이 UIView가 아닌 CALayer 였으면 좋다고 생각해서 물방울들을 CASharpLayer로 바꿔봤습니다.
이로인해서 두 가지 변화가 있었습니다.
첫째는 물방울이 많아졌을때 메모리 사용량 입니다.
실제 이렇게 까지 물방울들을 많이 만들지는 않겠지만 물방울이 많아 지면 많이 질수록 layer 를 생성하는 것 보다 view 를 생성하는 것이 메모리를 더 많이 먹게됩니다.
두번째는 물방울의 모양입니다.
의도하신건지는 잘 모르겠지만 전에는 물방울 들의 모양이 완전 원이 아닌 코너가 둥근 직사각형의 모양이었습니다.
UIBezierPath를 이용해서 좀더 선명한 원을 만들어봤습니다.
마지막으로 좋은 오픈소스 감사합니다 :)