Created
March 9, 2015 03:30
-
-
Save masters3d/206296e6dbd3e39328ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array{ | |
func indexInbound (index: Int) -> Bool{ | |
if 0 <= index && index < count { | |
return true | |
} else { | |
return false | |
} | |
} | |
} | |
let b = a.indexInbound(2) ? a[2] : -1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment