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
| // | |
| // Macros.swift | |
| // | |
| // Created by Xavier Muñiz on 6/12/14. | |
| import Foundation | |
| // dLog and aLog macros to abbreviate NSLog. | |
| // Use like this: |
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
| // Playground is where kids play | |
| import CoreData | |
| @objc(City) | |
| class City: NSManagedObject { | |
| @NSManaged var name: String | |
| } | |
| var cityEntity = NSEntityDescription() |
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
| // setOps.js MIT License © 2014 James Abney http://github.com/jabney | |
| // Set operations union, intersection, symmetric difference, | |
| // relative complement, equals. Set operations are fast. | |
| (function(so) { | |
| 'use strict'; | |
| var uidList = [], uid; | |
| // Create and push the uid identity method. |
- To add Settings.bundle in Xcode. Command N and in Resource, choose Settings Bundle .
- Open
Root.plistin source code, paste the code below to replace it,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
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
| import Foundation | |
| extension Data { | |
| var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription | |
| guard let object = try? JSONSerialization.jsonObject(with: self, options: []), | |
| let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]), | |
| let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil } | |
| return prettyPrintedString | |
| } |
OlderNewer
