Skip to content

Instantly share code, notes, and snippets.

View Nub's full-sized avatar
🕶️

Zach Thayer Nub

🕶️
View GitHub Profile
(
"<NSLayoutConstraint:0x178296440 V:|-(10)-[spotName] (Names: spotName:0x13fd49790, '|':UIView:0x170187f90 )>",
"<NSLayoutConstraint:0x178296490 V:[spotName]-(10)-[camImage] (Names: camImage:0x13fe30e90, spotName:0x13fd49790 )>",
"<NSLayoutConstraint:0x1782964e0 V:[camImage]-(NSSpace(8))-[lastUpdated] (Names: lastUpdated:0x13fe0efe0, camImage:0x13fe30e90 )>",
"<NSLayoutConstraint:0x178296530 V:[lastUpdated]-(NSSpace(8))-[waveSize] (Names: waveSize:0x13fe19ce0, lastUpdated:0x13fe0efe0 )>",
"<NSLayoutConstraint:0x178296580 V:[waveSize]-(NSSpace(8))-[waveDescription] (Names: waveDescription:0x13fe19e40, waveSize:0x13fe19ce0 )>",
"<NSLayoutConstraint:0x1782965d0 V:[waveDescription]-(NSSpace(8))-[condition] (Names: condition:0x13fe28540, waveDescription:0x13fe19e40 )>",
"<NSLayoutConstraint:0x178296620 V:[condition(30)] (Names: condition:0x13fe28540 )>",
"<NSLayoutConstraint:0x1782966c0 V:[condition]-(NSSpace(8))-[greeting] (Names: greeting:0x13fe286a0, condition:0x
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x178095270 H:|-(0)-[PagedScrollView:0x147e31190] (Names: '|':UIView:0x1701868d0 )>",
"<NSLayoutConstraint:0x1780952c0 H:[PagedScrollView:0x147e31190]-(0)-| (Names: '|':UIView:0x1701868d0 )>",
"<NSAutoresizingMaskLayoutConstraint:0x178098c40 h=--& v=--& H:[UIView:0x1701864c0(320)]>",
"<NSLayoutConstraint:0x17009e3c0 camImage.height == 0.5625*UIView:0x170187f90.width - 180 (Names: camImage:0x147d0d390 )>",
"<NSLayoutConstraint:0x178c8cd00 UIView:0x170187f90.width == VerticalFlowLayout:0x147e7
7> let d = ["test":("a","b")]
d: Dictionary<String, (String, String)> = {
[0] = {
key = "test"
value = {
0 = "a"
1 = "b"
}
}
}
Welcome to Swift! Type :help for assistance.
1> let a = -3
la: Int = -3
2> let b = a.asUnsigned()
b: UInt = {
value = -3
}
3> println(b)
18446744073709551613
4> println(a)
// The following code only needs to be called once, and only requires to be called before user input is expected
// It performs some very basic logic to handle search queries
RACSignal* searchTextChanged = [self rac_signalForSelector:@selector(searchBar:textDidChange:)
fromProtocol:@protocol(UISearchBarDelegate)];
__block NSInteger minimumSearchLength = 3;
[[[[searchTextChanged
map:^id(RACTuple *tuple) {
// Playground - noun: a place where people can play
import Cocoa
func instanceOfClass<T>(aClass: T.Type) -> AnyObject {
return aClass()
}
var a = instanceOfClass(String)
// Playground - noun: a place where people can play
import Cocoa
func foo(done: ((String) -> Void), bar: String = "default"){
done(bar)
}
// It works!, but what if I want to set bar?
foo(){(bar: String) in
//
// NSURL_Networking.swift
// swiftTools
//
// Created by Zachry Thayer on 6/3/14.
// Copyright (c) 2014 Zachry Thayer. All rights reserved.
//
import Foundation
//
// NSURL_Networking.swift
// swiftTools
//
// Created by Zachry Thayer on 6/3/14.
// Copyright (c) 2014 Zachry Thayer. All rights reserved.
//
import Foundation
func fetch(method: String, body: (NSString, NSData)!, completion: (NSData -> Void)) {
let request = self.request()
request.HTTPMethod = method
if body != nil {
let mime = body.0
let data = body.1
request.setValue(mime, forHTTPHeaderField: Networking.mimeHTTPHeaderField)
request.HTTPBody = data;
}