Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add properties for CALayer appearance #34

Merged
merged 3 commits into from
Feb 6, 2019
Merged

Add properties for CALayer appearance #34

merged 3 commits into from
Feb 6, 2019

Conversation

hodovani
Copy link
Contributor

@hodovani hodovani commented Feb 6, 2019

Resolve #30

Add:

  • allowsEdgeAntialiasing
  • allowsGroupOpacity
  • borderColor
  • borderWidth
  • cornerRadius
  • isDoubleSided
  • masksToBounds
  • opacity
  • shadowColor
  • shadowOpacity
  • shadowRadius

@hodovani hodovani self-assigned this Feb 6, 2019
@codecov-io
Copy link

codecov-io commented Feb 6, 2019

Codecov Report

Merging #34 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #34   +/-   ##
=======================================
  Coverage   95.23%   95.23%           
=======================================
  Files           5        5           
  Lines         336      336           
=======================================
  Hits          320      320           
  Misses         16       16

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac6dcbb...b795fcd. Read the comment docs.

@MaxDesiatov MaxDesiatov changed the title Add modifiers the layer’s appearance Add properties for CALayer appearance Feb 6, 2019
}

static func render(props: Props, hooks: Hooks) -> AnyNode {
let left = hooks.state(0.5 as Float)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please rename this to a more sensible name, maybe just plain state? left doesn't seem like a good fit as it doesn't seem to be related to any position properties in any way

style.opacity.flatMap { view.layer.opacity = $0 }
style.shadowColor.flatMap { view.layer.shadowColor = UIColor($0).cgColor }
style.shadowOpacity.flatMap { view.layer.shadowOpacity = $0 }
style.shadowRadius.flatMap { view.layer.shadowRadius = CGFloat($0) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like masksToBounds is missing here

@hodovani hodovani merged commit 8ee92cb into master Feb 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the calayer-options branch February 6, 2019 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants