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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
class EdgeInsetLabel: UILabel { | |
private let textInsets: UIEdgeInsets | |
init(inset: UIEdgeInsets) { | |
textInsets = inset |
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 SceneKit | |
import PlaygroundSupport | |
var sceneView = SCNView() | |
PlaygroundPage.current.liveView = sceneView | |
sceneView.backgroundColor = .black | |
var scene = SCNScene() | |
sceneView.scene = scene | |
var universe = scene.rootNode |
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 Notification<T> { | |
let name: NSNotification.Name | |
} | |
private let notificationData = "_notificationData" | |
extension NotificationCenter { | |
func post<T>(_ notification: Notification<T>, object: Any? = nil, data: T) { | |
post(name: notification.name, object: object, userInfo: [notificationData: data]) | |
} |
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 SharedApplication [UIApplication sharedApplication] | |
// open tel call | |
[SharedApplication openURL:[NSURL URLWithString:@"tel:1-408-555-5555"]]; | |
// open itunes application | |
[SharedApplication openURL:[NSURL URLWithString:@"https://itunes.apple.com/cn/app/numbers/id361304891?mt=8"]]; | |
// open map | |
[SharedApplication openURL:[NSURL URLWithString:@"http://maps.apple.com/?q=cupertino"]]; |
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
// | |
// GradientView.swift | |
// Notion | |
// | |
// Created by Cody Robertson on 3/16/16. | |
// Copyright © 2016 Lift, Inc. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
//Swift 2.0 | |
import UIKit | |
protocol SomethingDelegate { | |
func didUpdateSomething(SomethingHelper:SomethingHelper) | |
} | |
class SomethingHelper { | |
private var timer : dispatch_source_t! = nil | |
private var currentIntervalInSec = 0; | |
var delegate: SomethingDelegate? |
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
// | |
// Model.swift | |
// KidSpace | |
// | |
// Created by October Hammer on 4/19/17. | |
// Copyright © 2017 Ocotober Hammer. All rights reserved. | |
// | |
import Foundation | |
import Parse |
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 AVFoundation | |
import UIKit | |
class ScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { | |
var captureSession: AVCaptureSession! | |
var previewLayer: AVCaptureVideoPreviewLayer! | |
override func viewDidLoad() { | |
super.viewDidLoad() |
NewerOlder