I was testing out Xcode 10.2 beta 10P82s. I created a new branch on my current app and when I tried to convert to Swift 5 it asked me to make sure I could build on all targets before I converted. This was strange because there were NO errors when I cleaned and build. But the errors showed up if I went to each file and scrolled down.
One such error is on my extensions.
For example I have the following extension
import Foundation
import UIKit
extension UIView {
public func createRoundedCorners() {
layer.cornerRadius = 7
clipsToBounds = true
}
}
In various ViewControllers I use this. For example I have a albumArtImageView: UIImageView
and in my code I call albumArtImageView.createRoundedCorners()
.
I get an error:
Value of type 'UIImageView?' has no member 'createRoundedCorners'
In Xcode 10.1 and before this worked.
What has changed? What do I need to do so this works?