Orderella / PopupDialog

A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
http://www.mwfire.de
Other
3.95k stars 521 forks source link

Ambiguous use of 'cornerRadius' #344

Closed abdelmagied94 closed 4 years ago

abdelmagied94 commented 4 years ago

Report

Environment

Dependency management

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.

stale[bot] commented 4 years ago

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.

QuyetND commented 4 years ago

I had same issuse, please update set cornerRadius via function to fix issue.

MegaX8892 commented 4 years ago

I found a quick fix for this issue by setting popup.view.backgroundColor = .clear