Last active
June 6, 2016 06:39
-
-
Save Adnan1990/060db4d20dd603e5187a308c2e604d22 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
//Generic to swap values of two variables regardless of their data type | |
func genericSwap<T>(inout a:T,inout b: T) | |
{ | |
let temp = a | |
a = b | |
b = temp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment