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
extension NSManagedObject { | |
public class var entityName:String { | |
get { | |
return NSStringFromClass(self).componentsSeparatedByString(".").last! | |
} | |
} | |
public var entityNameOfThisObject:String { | |
get { |
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 | |
import CoreData | |
class Document : NSManagedObject { | |
class func newDocument() -> Document { | |
return self.documentForID("1") | |
} | |
class func documentForID(documentID: String) -> Document { | |
let predicate = NSPredicate(format: "documentID = %@", documentID) |
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
{"aps" : {"content-available" : 1, "sound" : ""}} |
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
{"aps" : {"content-available" : 1}} |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
id target = [self.navigationController valueForKey:@"_cachedInteractionController"]; | |
UIGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)]; | |
[self.view addGestureRecognizer:recognizer]; | |
// Add a dependency between your recognizer and the interactivePopGestureRecognizer | |
// to prevent multiple recognition, if needed. |
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 | |
import CoreLocation | |
class LocationManager : NSObject, CLLocationManagerDelegate { | |
class var sharedInstance : LocationManager { | |
get { | |
struct Static { | |
static let instance : LocationManager = LocationManager() |
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
* *************************************************************** | |
* プログラムID SSCD01 | |
* 機能名 S社詳細帳票出力01 | |
* 開発担当者 株式会社akisute | |
* あきすてさま | |
* 初版 2004/06/28 | |
* | |
* 変更履歴 | |
* 2004/06/28 変更者 あきすてさま | |
* 初版作成。 |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// Create a pasteboard, and pass some data to it | |
// the created pasteboard can be specified as persistent as well | |
UIPasteboard *pasteboard = [UIPasteboard pasteboardWithName:@"Widget" create:YES]; | |
pasteboard.persistent = YES; | |
pasteboard.string = @"やっほー!"; | |
return YES; | |
} |
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 UIKit | |
// How to make singleton classes in Swift: http://stackoverflow.com/questions/24024549/dispatch-once-singleton-model-in-swift | |
// Basically using global constants is the most easy and safe way to go | |
class APIClient: NSObject { | |
let functionSessionManager:AFHTTPSessionManager | |
class var sharedInstance:APIClient { |
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 | |
enum PromiseState:Int { | |
case Incomplete = 0 | |
case Rejected = 1 | |
case Resolved = 2 | |
} | |
class Promise : Hashable { | |