I have a very simple question on the property .capitalized in Swift 3.
Here is my piece of code:
var pinkman = "yo yo yo mr white"
var capitalizeIt = pinkman.capitalized
value of type 'String' has no member 'capitalized'
Assuming that you're using Xcode 8..
In your build settings, is your
use Legacy Swift Version set to
Yes? In which case, it'd be compiling to swift 2.3. If no, then it'll be compiling Swift 3.
Swift 2.3 doesn't have a
.capitalizedString, from 3.0 onwards it's the former.
Furthermore, are you importing at least Foundation? If not, then UIKit, AppKit, Cocoa would be fine too as they automatically import Foundation.
Finally, is the swift file you've created part of an Objective-C project? Or is it part of a Swift project?