efremidze / Cluster

Easy Map Annotation Clustering 📍
MIT License
1.28k stars 121 forks source link

BorderedClusterAnnotationView borderColor conflicts error #42

Closed savasadar closed 7 years ago

savasadar commented 7 years ago

Hello, Thanks for this useful library. I get an error implement it in my project just like your example. Example project is working properly but When I add library to my project and use it I got this error.

Getter for 'borderColor' with Objective-C selector 'borderColor' conflicts with getter for 'borderColor' from superclass 'UIView' with the same Objective-C selector

in here:

class BorderedClusterAnnotationView: ClusterAnnotationView {
    let borderColor: UIColor   //I got error on this line

What is the problem? I can't solve it.

Thanks

savasadar commented 7 years ago

I fixed this issue with change borderColor variable name to mBorderColor like this;

`class BorderedClusterAnnotationView: ClusterAnnotationView {
    let mBorderColor: UIColor

    init(annotation: MKAnnotation?, reuseIdentifier: String?, type: ClusterAnnotationType, borderColor: UIColor) {
        self.mBorderColor = borderColor
        super.init(annotation: annotation, reuseIdentifier: reuseIdentifier, type: type)
    }

    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func configure(with type: ClusterAnnotationType) {
        super.configure(with: type)

        switch type {
        case .image:
            layer.borderWidth = 0
        case .color:
            layer.borderColor = mBorderColor.cgColor
            layer.borderWidth = 2
        }
    }
}`
efremidze commented 7 years ago

Xcode version?

savasadar commented 7 years ago

Xcode 8 - Swift 3