View AsyncBlockOperation.swift
import Foundation
class AsyncBlockOperation: NSOperation {
typealias Block = (Void -> Void) -> Void
private let block: Block
private var _executing = false
private var _finished = false
init(block: Block) {
View WlascicielBMW_hcsr04.cpp
#define TRIGGER1 2
#define ECHO1 3
#define TRIGGER2 4
#define ECHO2 5
void setup() {
pinMode(TRIGGER1,OUTPUT);
pinMode(ECHO1,INPUT);
pinMode(TRIGGER2,OUTPUT);
pinMode(ECHO2,INPUT);
View Vector.m
#import "Vector.h"
@interface Vector ()
@property (nonatomic, assign) uint count;
@property (nonatomic, assign) size_t size;
@property (nonatomic, assign) void **storage;
@end
@implementation Vector
View error(styling).swift
/*
Erica Sadun, http://ericasadun.com
Basic Errors
*/
import Foundation
/// A basic utility error type that stores the reason for
View refactor.swift
override func viewDidLoad() {
super.viewDidLoad()
configureGestureRecognizer()
RestKitManager.getChannelToken(channel.name) { token in
if let token = token {
let params = "player=twitchweb&token=\(token.token)&sig=\(token.sig)&allow_source=true&type=any&p=3633125"
View searching_for_not_saved_data.swift
import UIKit
import CoreData
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
populateDatabase()
}
View int-is-anyobject.swift
func passAnyObject(param: AnyObject) {
print(param)
}
class MyClass {}
struct MyStruct {}
let a: Int = 1
let b = 2.0
View ugly-center-view-in-superview.swift
let views = ["v1": v1, "super": self.view]
self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[super]-(<=0)-[v1(50)]", options: .AlignAllCenterY, metrics: nil, views: views))
self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[super]-(<=0)-[v1(100)]", options: .AlignAllCenterX, metrics: nil, views: views))
View using-closure.swift
class LetItGoTableViewController: UITableViewController {
private enum SignInField: Int {
case Username
case Password
case RememberMe
case SignInButton
}
// MARK: - Table view data source
View custom-stirng-convertible.swift
struct Position {
var x: Int = 0
var y: Int = 0
func string() -> String {
return "(\(x), \(y))"
}
}
// CustomStringConvertible provides "description" property.