Skip to content

Commit

Permalink
Merge pull request #7 from cats-oss/fix-crash-bag
Browse files Browse the repository at this point in the history
Change OBJC_ASSOCIATION_ASSIGN to .OBJC_ASSOCIATION_RETAIN_NONATOMIC
  • Loading branch information
Fumito Nakazawa authored Jul 5, 2018
2 parents a7ff795 + d162ae0 commit 44d6cb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sica.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Sica"
s.version = "0.3.0"
s.version = "0.3.1"
s.summary = "Sica can execute various animations sequentially or parallely"
s.homepage = "https://github.com/cats-oss/Sica"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
4 changes: 2 additions & 2 deletions Sica/Source/CALayer+Sica.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ private let _animatorAssociatedKey = UnsafeMutablePointer<UInt>.allocate(capacit
extension CALayer {
public var sica: Animator {
set {
objc_setAssociatedObject(self, _animatorAssociatedKey, newValue, .OBJC_ASSOCIATION_ASSIGN)
objc_setAssociatedObject(self, _animatorAssociatedKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
get {
guard let animator = objc_getAssociatedObject(self, _animatorAssociatedKey) as? Animator else {
let animator = Animator(layer: self)
objc_setAssociatedObject(self, _animatorAssociatedKey, animator, .OBJC_ASSOCIATION_ASSIGN)
objc_setAssociatedObject(self, _animatorAssociatedKey, animator, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
return animator
}
return animator
Expand Down
4 changes: 2 additions & 2 deletions Sica/Source/View+Sica.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ private let _animatorAssociatedKey = UnsafeMutablePointer<UInt>.allocate(capacit
extension View {
public var sica: Animator {
set {
objc_setAssociatedObject(self, _animatorAssociatedKey, newValue, .OBJC_ASSOCIATION_ASSIGN)
objc_setAssociatedObject(self, _animatorAssociatedKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
get {
guard let animator = objc_getAssociatedObject(self, _animatorAssociatedKey) as? Animator else {
let animator = Animator(view: self)
objc_setAssociatedObject(self, _animatorAssociatedKey, animator, .OBJC_ASSOCIATION_ASSIGN)
objc_setAssociatedObject(self, _animatorAssociatedKey, animator, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
return animator
}
return animator
Expand Down

0 comments on commit 44d6cb2

Please sign in to comment.