This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import UIKit | |
import XCPlayground | |
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | |
var container = UIView(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) | |
container.backgroundColor = UIColor.greenColor() | |
XCPlaygroundPage.currentPage.liveView = container |
This file contains hidden or 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
// | |
// How can intrinsic content size help make my layouts cleaner? | |
// More on http://candycode.io/how-can-intrinsic-content-size-help-make-my-layouts-cleaner/ | |
import UIKit | |
import XCPlayground | |
var view = UIView(frame: CGRect(x: 0, y: 0, width: 600, height: 600)) | |
view.backgroundColor = .whiteColor() |
This file contains hidden or 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
// Code: | |
ZDKLogger.enable(true) | |
ZDKConfig.instance().initializeWithAppId(OTConstants.Services.ZendeskAppID, zendeskUrl: OTConstants.Services.ZendeskURL, clientId: OTConstants.Services.ZendeskClientID, onSuccess: { () -> Void in | |
if let user = OTKApplication.session.currentUser { | |
Zendesk.identifyUser(user) | |
ZDKHelpCenter.showHelpCenterWithNavController(self.navigationController) | |
} | |
}) { (error: NSError!) -> Void in | |
debugPrint("Error initializing ZenDesk: \(error)") | |
} |
This file contains hidden or 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
// Init in application:didFinishLaunchingWithOptions | |
ZDKConfig.instance().initializeWithAppId(OTConstants.Services.ZendeskAppID, zendeskUrl: OTConstants.Services.ZendeskURL, clientId: OTConstants.Services.ZendeskClientID, onSuccess: { () -> Void in | |
}) { (error: NSError!) -> Void in | |
debugPrint("Error initializing ZenDesk: \(error)") | |
} | |
// Identifying or re-identifying the user | |
class func identifyUser(user: OTKUser) { |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
extension NSString { | |
private static let unicodeTransform: NSString = "Any-Hex/Java" | |
func decodeUnicode() -> NSString? { |
This file contains hidden or 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
# Engine stuff | |
class Engine;end | |
class MotorcycleEngine < Engine | |
def start | |
"Wroom!" | |
end | |
end |
This file contains hidden or 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
#define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate]) | |
#define UserDefaults [NSUserDefaults standardUserDefaults] | |
#define NotificationCenter [NSNotificationCenter defaultCenter] | |
#define SharedApplication [UIApplication sharedApplication] | |
#define Bundle [NSBundle mainBundle] | |
#define MainScreen [UIScreen mainScreen] | |
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES | |
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO | |
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x | |
#define NavBar self.navigationController.navigationBar |