Created
March 21, 2016 17:50
-
-
Save Bionik6/507a3394a34b2502331d 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
| func generateUniqueKey(keys: String...) -> String { | |
| let newArray = keys.sort() | |
| var cuttedStr = [String]() | |
| for str in newArray { | |
| let newString = NSString(string: str) | |
| let result = newString.substringWithRange(NSRange(location: 0, length: 8)) | |
| cuttedStr.append(result) | |
| } | |
| return cuttedStr.joinWithSeparator("-") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment