Safe (returns an optional) collection type lookup in Swift 2+. So useful! This should be in the standard library.http://stackoverflow.com/questions/25329186/safe-bounds-checked-array-lookup-in-swift-through-optional-bindings/30593673#30593673 …
// Bliss :) title = (webView.title?.componentsSeparatedByString("**")[safe: 1] ?? webView.title)https://twitter.com/aral/status/733199221088718848 …
-
-
Well, it would’ve been bliss if I could have said: title = (webView.title?.split(“**”)[safe: 1] ?? webView.title)https://twitter.com/aral/status/733199899358068736 …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.