ElaWorkshop / TagListView

Simple and highly customizable iOS tag list view, in Swift.
MIT License
2.62k stars 490 forks source link

Ambiguous use of "cornerRadius" #227

Open Ins0mn1aUA opened 5 years ago

Ins0mn1aUA commented 5 years ago

i use pod TagListView, and Xcode call me: ambiguous use of 'cornerRadius'. How to solve it ?

danielrobleM commented 5 years ago

Hi @Ins0mn1aUA did you find any solution ?. I create a new project for test and work fine, but in my actual project i get the same error

Ins0mn1aUA commented 4 years ago

Hi, @danielrobleM :) I have the same one. In main project I've this error, in another test projects all works fine. Still don't know how to solve this problem.

Ji4n1ng commented 4 years ago

For me, that is because I used SwifterSwift which has a extension named cornerRadius. Perhaps the author could try to modify the name to solve this problem.

    /// SwifterSwift: Corner radius of view; also inspectable from Storyboard.
    @IBInspectable var cornerRadius: CGFloat {
        get {
            return layer.cornerRadius
        }
        set {
            layer.masksToBounds = true
            layer.cornerRadius = abs(CGFloat(Int(newValue * 100)) / 100)
        }
    }
Ji4n1ng commented 4 years ago

If you still want to use SwifterSwift, you could set cornerRadius by yourself:

        tagListView.tagViews.forEach {
            $0.layer.cornerRadius = 8
            $0.layer.masksToBounds = true
        }
weihas commented 1 year ago

use taglistview.setValue(5.0, forKey: "cornerRadius") to avoid this question