Skip to content

Instantly share code, notes, and snippets.

@olbrichj
Created June 14, 2018 17:14
Show Gist options
  • Save olbrichj/b5966cfc3877dd85fb3b1c233c2cddb1 to your computer and use it in GitHub Desktop.
Save olbrichj/b5966cfc3877dd85fb3b1c233c2cddb1 to your computer and use it in GitHub Desktop.
var title : [String] = []
var lock = NSLock()
func write(_ text: String) {
let words = text.split(separator: " ")
lock.lock()
for word in words {
title.append(String(word))
print(word)
}
lock.unlock()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment