Skip to content

Instantly share code, notes, and snippets.

View bgayman's full-sized avatar

Brad Gayman bgayman

View GitHub Profile
let label = UILabel(frame: CGRect(x: 0.0, y: 0.0, width: 300.0, height: 100.0))
label.numberOfLines = 0
label.backgroundColor = UIColor.yellowColor()
label.lineBreakMode = .ByWordWrapping
label.text = "Hello 😇\n🤑蠓蝾"
let fontSize:CGFloat = 54.0
label.font = UIFont.systemFontOfSize(fontSize)
let size = label.sizeThatFits(CGSize(width: 100.0, height: CGFloat.max))
label
label.sizeToFit()
let objects:Array<Dictionary<String, AnyObject>> = [["id": NSNull(), "born": 1964, "name": "Keanu Reeves"], ["id": NSNull(), "born": 1967, "name": "Carrie-Anne Moss"], ["id": NSNull(), "born": 1961, "name": "Laurence Fishburne"], ["id": NSNull(), "born": 1960, "name": "Hugo Weaving"], ["id": NSNull(), "born": 1967, "name": "Andy Wachowski"], ["id": NSNull(), "born": 1965, "name": "Lana Wachowski"], ["id": NSNull(), "born": 1952, "name": "Joel Silver"], ["id": NSNull(), "born": NSNull(), "name": "Ann"], ["id": NSNull(), "born": NSNull(), "name": "Dan"]]
let object = objects[1]
print("Object is: \(objects)")
print("Hello")
print(object["name"]?.classForCoder)
let text = object["name"] as! String
print(object["born"]?.classForCoder)
let text2 = object["born"] as! Int
//: Playground - noun: a place where people can play
import UIKit
import XCPlayground
var str = "Hello, playground"
private let reuseIdentifier = "Cell"
class NumberCell: UICollectionViewCell {
let numberLabel = UILabel()