I converted my project to swift 3, but stuck on following sequence. How to convert split
function to swift 3.
let myString = " key=value "
let myData = myString.characters.split(1, allowEmptySlices: true, isSeparator: { $0 == "=" }).map(String.init)
if let postValue = (valueWithData.count > 1 ? valueWithData[1] : nil) as String? {
postData += "\(valueWithData[0])=\(postValue)&"
}
I need get key value from myString
. Got error:
'split(_:allowEmptySlices:isSeparator:)' has been explicitly marked unavailable here