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
class MediaItem : MTLModel, MTLJSONSerializing { | |
var mediaFileName : String! | |
var mediaMD5String : String! | |
var mediaFileURL : String! | |
var mediaFileSize : Int! | |
class func documentsDirectory() -> String{ | |
return NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String | |
} |
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
// | |
// GenericDataSource.swift | |
// | |
// Created by Dan Nolan on 23/09/2014. | |
// Creative Commons blah blah just use this as however you want I release all witchcraft and magic rights to using this software or something | |
// | |
import Foundation | |
import UIKit | |
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
import Foundation | |
class AppInfo { | |
class func appVersion () -> String{ | |
let infoDictionary = NSBundle.mainBundle().infoDictionary | |
if let versionString:AnyObject = infoDictionary["CFBundleShortVersionString"]{ | |
return "\(versionString)" | |
}else{ | |
return "No Version" | |
} |
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
class Array2D<T> { | |
let columns: Int | |
let rows: Int | |
var array: Array<T?> // private | |
init(columns: Int, rows: Int) { | |
self.columns = columns | |
self.rows = rows | |
array = Array<T?>(count: rows*columns, repeatedValue: nil) | |
} |
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
import json | |
from pprint import pprint | |
json_data=open('formatted.json') | |
data = json.load(json_data) | |
# pprint(data['features']) | |
for x in data['features']: | |
print(x["properties"]["headline"]) | |
NewerOlder