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
import Cocoa | |
class Plane | |
{ | |
init() | |
{ | |
readyToTakeOff(); | |
} | |
func readyToTakeOff(){ |
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
// | |
// AppDelegate.swift | |
// Keychain | |
// | |
// Created by Markos Charatzas on 07/09/2014. | |
// Copyright (c) 2014 qnoid.com. All rights reserved. | |
// | |
import Cocoa |
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
class FooViewController: UIViewController | |
{ | |
} | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
let fooViewController = FooViewController() | |
let view = self.window!.snapshotViewAfterScreenUpdates(false) | |
let viewController = UIViewController() |
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
class ViewController : UIViewController | |
{ | |
var foo = "foo" | |
func hello() | |
{ | |
let closure = { [foo = self.foo] in | |
print("Hello \(foo)!") | |
} | |
} |
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
struct Imager | |
{ | |
unowned let session: Session | |
unowned let avatar: Avatar | |
func image(imageView: UIImageView) { | |
let download = self.session.download(self.avatar.image) { [weak imageView = imageView] (data, response, _) in | |
guard let _imageView = imageView else { |
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
// MARK: - guard without Optional Pattern | |
extension LocalAuthentication { | |
convenience init?(authenticationLevel: AuthenticationLevel?){ | |
guard let authenticationLevel = authenticationLevel else { | |
return nil | |
} | |
switch authenticationLevel { |
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
guard let foo = foo else { | |
assertionFailure("This shouldn't happen") | |
return | |
} |
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
// 1 | |
let process = Process() | |
process.launch() | |
process.waitUntilExit() | |
// 2. | |
let process = Process() | |
let queue = DispatchQueue() | |
queue.async { |
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
*{box-sizing:border-box;margin:0;padding:0} | |
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%} | |
address,caption,code,figcaption,pre,th{font-size:1em;font-weight:400;font-style:normal} | |
fieldset,iframe,img{border:0} | |
caption,th{text-align:left} | |
table{border-collapse:collapse;border-spacing:0} | |
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block} | |
audio,canvas,progress,video{display:inline-block;vertical-align:baseline} | |
button{background:0 0;border:0;box-sizing:content-box;color:inherit;cursor:pointer;font:inherit;line-height:inherit;overflow:visible;vertical-align:inherit} | |
button:disabled{cursor:default} |
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
var APP_VERSION = '1.0.21'; | |
! function e(t, n, r) { | |
function i(a, l) { | |
if (!n[a]) { | |
if (!t[a]) { | |
var s = "function" == typeof require && require; | |
if (!l && s) return s(a, !0); | |
if (o) return o(a, !0); | |
var c = new Error("Cannot find module '" + a + "'"); | |
throw c.code = "MODULE_NOT_FOUND", c |