as you know there are few changes in xcode 7 and swift 2. I got 2 errors shown below, how can I fix them? Thanks
extension String {
var wordList:[String] {
return "".join(componentsSeparatedByCharactersInSet(NSCharacterSet.punctuationCharacterSet())).componentsSeparatedByString(" ")
}
var first: String {
return String(self[startIndex])
}
var last: String {
return String(self[endIndex.predecessor()])
}
var scrambleMiddle: String {
if count(self) < 4 { //'(String) -> _' is not identical to 'Int'
return self
}
return first + String(Array(dropLast(dropFirst(self))).shuffled) + last //Type 'String' does not conform to protocol 'Sliceable'
}
}