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
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() |
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
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 |
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
//: 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() | |
NewerOlder