🏠
Working from home
Pinned Loading
-
-
Swift 3 JSON pretty printing
Swift 3 JSON pretty printing 1//Function to pretty-print Json Object in Swift 3
2func prettyPrint(with json: [String:Any]) -> String{
3let data = try! JSONSerialization.data(withJSONObject: json, options: .prettyPrinted)
4let string = NSString(data: data, encoding: String.Encoding.utf8.rawValue)
5return string as! String
-
Luhn Algorithm in Swift 4.1
Luhn Algorithm in Swift 4.1 1func luhnCheck(_ number: String) -> Bool {
2var sum = 0
3let digitStrings = number.reversed().map { String($0) }
45for tuple in digitStrings.enumerated() {
-
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.


