Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
working . . .

opswhisperer

:octocat:
working . . .
View GitHub Profile
@opswhisperer
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() {
super.viewDidLoad()
for i in 1...100 {
@opswhisperer
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. https://www.devilhornsoftware.com/blog/2015/12/30/a-smarter-smart-banner
View BranchSmartBanner.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Branch.io Smart Banner</title>
<script type="text/javascript">
var ratingCount, averageUserRating, appID, branchKey;
appID = "284882215";
branchKey = "YOUR_API_KEY"
function getRating(content) {
@opswhisperer
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")
//load
var data = NSUserDefaults.standardUserDefaults().objectForKey("places") as! NSData
places = NSKeyedUnarchiver.unarchiveObjectWithData(data) as! [Dictionary<String,String>]