Created
October 18, 2016 11:13
-
-
Save aravindhkumar23/597a53a06bdbb23bd0b832840540c0b3 to your computer and use it in GitHub Desktop.
Sorting Array of dictionary with key(Int) eg:[{"name":"value","time":"time"},{}]
This file contains 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
sortedarray = storedarray.sort{ | |
(($0 as! Dictionary<String, AnyObject>)["time"] as? Int) < (($1 as! Dictionary<String, AnyObject>)["time"] as? Int) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment