sgtnasty
(Ronaldo Nascimento)
1
Trying to remember what I was doing here, but this code apparently no longer works in Swift 5.
let s = String(describing: confType).characters.prefix(1)
// ^~~~~~~~~~
// error here
So String.characters no longer works, what is the Swift 5 equivalent? I cant find the docs for 4.0.
Forgot error message:
Swift.String:5:16: note: 'characters' was obsoleted in Swift 5.0
public var characters: String { get set }
sveinhal
(Svein Halvor Halvorsen)
2
Just drop it, string is a collection of characters.
1 Like
sgtnasty
(Ronaldo Nascimento)
3
Thanks that worked, I was trying to use String[] as an array of chars but I need a Swift refresher. 