Swift

SwiftでHashをsortしたい.

var testArr:Array<Dictionary<String,String>> = [ ["id": "001", "name": "aaa", "date": "2013/11/02"], ["id": "005", "name": "bbb", "date": "2013/11/02"], ["id": "002", "name": "ccc", "date": "2013/11/02"], ] sort(&testArr) { (a:Dictionary, b:Dictionary) -> Bool in r</dictionary<string,string>…

Swiftで空のimageViewをadd

//空のImageViewを貼る var frame = CGRectMake(0,0,1000,1000) UIGraphicsBeginImageContext(frame.size) var context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context,UIColor.whiteColor().CGColor); let uiImage:UIImage = UI…

SwiftでViewをaddとremove

//remove self.readCanvas?.removeFromSuperview() self.drawCanvas?.removeFromSuperview() //ReadCanvas self.readCanvas = UIView(frame:self.canvasFrame); self.readCanvas.backgroundColor = UIColor.clearColor() self.baseUiView.addSubview(self.re…