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 ViewController : UIViewController { | |
override func decodeRestorableState(with coder: NSCoder) { | |
super.decodeRestorableState(with: coder) | |
// force class initialization for the sake of state restoration | |
ViewModel.classInit | |
viewModel = coder.decodeObject(of: ViewModel.self, forKey: "viewModel") | |
} | |
} | |
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
// | |
// BSGLView.h | |
// AirKill | |
// | |
// Created by Sasmito Adibowo on 07-06-14. | |
// Basil Salad Software, http://basilsalad.com | |
// | |
// This code is in the public domain. | |
#import "CCGLView.h" |
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
// | |
// BSAlertViewDelegateBlock.h | |
// SpeechTimer2 | |
// | |
// Created by Sasmito Adibowo on 25-12-13. | |
// Copyright (c) 2013-2014 Basil Salad Software. All rights reserved. | |
// | |
// Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license> | |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY | |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
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
// | |
// BSHTTPCookieStorage.h | |
// | |
// Created by Sasmito Adibowo on 02-07-12. | |
// Copyright (c) 2012 Basil Salad Software. All rights reserved. | |
// http://basilsalad.com | |
// | |
// Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license> | |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY | |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
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
// JSONSupport.m | |
// Created by Sasmito Adibowo on 29-08-12. | |
// Copyright (c) 2012 Basil Salad Software. . | |
// http://basilsalad.com | |
// | |
// Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license> | |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY | |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT | |
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
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) refreshFeedWithType:(BSYammerFeedType) feedType | |
threadType:(BSYammerFeedThreadType) threadType | |
olderThan:(BSYammerMessage*) oldestMessage | |
newerThan:(BSYammerMessage*) latestMessage | |
associatedWith:(NSManagedObject<BSYammerEntity>*) associatedEntity | |
fromAccount:(BSYammerContext*) accountContext | |
limit:(int) maxMessages | |
toManagedObjectContext:(NSManagedObjectContext*) objectContext | |
completionHandler:(void(^)(NSArray* objectIDs,NSError* errorOrNil)) completionHandler | |
{ |
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
// | |
// BSManagedDocument.h | |
// | |
// Created by Sasmito Adibowo on 29-08-12. | |
// Copyright (c) 2012 Basil Salad Software. All rights reserved. | |
// http://basilsalad.com | |
// | |
// Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license> | |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY | |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
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
// | |
// BSManagedDocument.h | |
// Scuttlebutt | |
// | |
// Created by Sasmito Adibowo on 29-08-12. | |
// Copyright (c) 2012 Basil Salad Software. All rights reserved. | |
// | |
#import <Cocoa/Cocoa.h> |
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
@implementation NSArray (FoundationAdditions) | |
-(id) objectAtCheckedIndex:(NSUInteger) index { | |
if(index >= self.count) { | |
return nil; | |
} else { | |
id result = [self objectAtIndex:index]; | |
return result == [NSNull null] ? nil : result; | |
} | |
} |
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
[[NSOperationQueue mainQueue] performSelector:@selector(addOperation:) withObject:^{ | |
// do your stuff here | |
} afterDelay:3.0]; |