Post marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliessolved.tooltip
// how I worked around Scanner.'scanUpTo(_:into:)' being deprecated in iOS 13.0
public func extractLinesFrom(string: String) -> [String] {
var result: [String] = []
let scanner = Scanner(string: string)
while scanner.isAtEnd == false {
guard let line = scanner.scanUpToCharacters(from: .newlines) else { return result }
result.append(line)
}
return result
}The API drops the need for NSString local variable as well as makes use of optional return type so we can bail out early.