Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Add a backgroundColor property to Reactive+CALayer.
Browse files Browse the repository at this point in the history
Reviewers: O2 Material Motion, O4 Material Apple platform reviewers, #material_motion, markwei

Reviewed By: O2 Material Motion, O4 Material Apple platform reviewers, #material_motion, markwei

Tags: #material_motion

Differential Revision: http://codereview.cc/D3233
  • Loading branch information
Jeff Verkoeyen committed May 17, 2017
1 parent c11949e commit 9c40e0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/reactivetypes/Reactive+CALayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ extension Reactive where O: CALayer {
}
}

public var backgroundColor: ReactiveProperty<CGColor> {
let layer = _object
return _properties.named(#function) {
return createCoreAnimationProperty(initialValue: layer.backgroundColor!,
externalWrite: { layer.backgroundColor = $0 },
keyPath: "backgroundColor")
}
}

public var cornerRadius: ReactiveProperty<CGFloat> {
let layer = _object
return _properties.named(#function) {
Expand Down

0 comments on commit 9c40e0b

Please sign in to comment.