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

Ambiguous use of 'cornerRadius' #177

Closed
tommyyoon opened this issue Mar 10, 2019 · 5 comments
Closed

Ambiguous use of 'cornerRadius' #177

tommyyoon opened this issue Mar 10, 2019 · 5 comments

Comments

@tommyyoon
Copy link

I am getting Ambiguous use of 'cornerRadius' error when I try to set the cornerRadius on Swift 4.2.

@andreamazz
Copy link
Owner

Hey @tommyyoon
It's not a library issue, maybe the problem relies on your configuration

@anonrig
Copy link

anonrig commented Jun 21, 2019

I'm having the same issue. I think that this is a library issue. I'm having this issue with all shadow related attributes.

Any idea why @andreamazz

@anonrig
Copy link

anonrig commented Jun 21, 2019

There's 2 shadowOpacity defined in my scope.

  1. AMPopTip attribute shadowOpacity
  2. QuartzCore's CALayer attribute shadowOpacity

@anonrig
Copy link

anonrig commented Jun 21, 2019

Shouldn't the library override the shadoowOpacity attribute since PopTip is a UIView? This is my configuration:

let tip = PopTip()
tip.font = UIFont.mediumFont(size: 14)
tip.textColor = UIColor(hex: 0x2f2f2f)!
tip.layer.shadowOffset = CGSize(width: 0, height: 2)
tip.layer.shadowRadius = 4
tip.layer.shadowOpacity = 0.06
tip.layer.shadowColor = UIColor.black.cgColor
tip.bubbleColor = .white
tip.shouldDismissOnTapOutside = true
tip.offset = 8
tip.edgeInsets = UIEdgeInsets(top: 10, left: 12, bottom: 10, right: 12)
tip.layer.cornerRadius = 10
tip.show(text: "Added to favorites!", direction: .left, maxWidth: 164, in: self.viewSource, from: self.viewSource.favoriteButton.frame)

Since on draw function you are overriding tip.layer attributes, even if I set them beforehand, it gets override, and tip.shadowOpacity gives an ambiguous error.

@andreamazz
Copy link
Owner

In hindsight, the shadow properties of the layers could've been left alone, except for the shadowPath, which uses an internal bezier path.
However, you should have no ambiguous errors, I've just tested the demo project, and there are no errors or warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants