Ambiguous use of 'cornerRadius'
abdelmagied94 opened this issue · 3 comments
Report
Environment
- Xcode version (e.g. 9.1): 11.1
- PopupDialog version (e.g. 0.5.0): 1.1.1
- Minimum deployment target (e.g. 9.0): 10.0
- Language (Objective-C / Swift): Swift
- In case of Swift - Version (e.g. 4): 5.0
Dependency management
- Dependency manager (e.g. CocoaPods): CocoaPods
- Version (e.g. 1.3.1): 1.8.4
What did you do?
Try to add custom corner radius to PopupDialogContainerView
as following:
PopupDialogContainerView.appearance().cornerRadius = 14
What did you expect to happen?
Code is compiled fine and corner radius shown as defined.
What happened instead?
Code haven't been compiled with compile error Ambiguous use of 'cornerRadius'
Any solutions, you suggest
I figured out the problem. I'm already defined a cornerRadius
property in UIView
extension that lead to this ambiguity.
I suggest to define a method that set the corner radius. For example:
/// Alias method for `cornerRadius` variable to avoid ambiguity.
@objc public dynamic func setupCornerRadius(_ radius: Float) {
self.cornerRadius = radius
}
Note:
This solution is inspired from another solution for similar issue in AssistoLab/DropDown library.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I had same issuse, please update set cornerRadius via function to fix issue.
I found a quick fix for this issue by setting popup.view.backgroundColor = .clear