Skip to content

Instantly share code, notes, and snippets.

working . . .


working . . .
View GitHub Profile
opswhisperer / gist:1898af786db8eee732d6
Created May 26, 2015
save and load a Swift Dictionary to NSUserDefaults
View gist:1898af786db8eee732d6
//save dict to userDefaults
var data = NSKeyedArchiver.archivedDataWithRootObject(places)
NSUserDefaults.standardUserDefaults().setObject(data, forKey: "places")
var data = NSUserDefaults.standardUserDefaults().objectForKey("places") as! NSData
places = NSKeyedUnarchiver.unarchiveObjectWithData(data) as! [Dictionary<String,String>]
opswhisperer / gist:14d8dbfb9f16dab8e1a8
Last active Aug 29, 2015
Creates a view that will slide out from under the table row when selected
View gist:14d8dbfb9f16dab8e1a8
import UIKit
class BasicTableViewController: UITableViewController {
var tableData = [String]()
var selectedCellIndexPath: NSIndexPath?
override func viewDidLoad() {
for i in 1...100 {
opswhisperer / BranchSmartBanner.html
Last active Dec 30, 2015
Here's how you get the Branch smart banned to pull your ratings from the AppStore automatically.
View BranchSmartBanner.html
<!DOCTYPE html>
<meta charset="utf-8">
<title> Smart Banner</title>
<script type="text/javascript">
var ratingCount, averageUserRating, appID, branchKey;
appID = "284882215";
branchKey = "YOUR_API_KEY"
function getRating(content) {