Programming/Swift(93)
-
collectionView cell 이동
버튼을 클릭했을 경우 화면에 해당 collectionViewCell 위치로 이동할 수 있게 한다. @IBAction func time00(sender: AnyObject) { self.collectionview?.scrollToItemAtIndexPath(NSIndexPath(forItem: 0, inSection: 0), atScrollPosition: .Left, animated: true) } forItem 은 이동하는 셀로우 : IndexPath.row 라고 생각하면 될 듯..atScrollPosition 은 화면에 어떤 위치를 기준으로 삼아서 해당 셀을 보여 줄 것인지 : .Top, .Bottom, .Left, .Right
2016.08.04 -
가로모드 일 경우 버튼 사이즈 조정
http://stackoverflow.com/questions/28148843/ios-autolayout-two-buttons-of-equal-width-side-by-side
2016.08.04 -
다른 class에서 struct값 가져올때..
* Send class SendClass { struct sendStruct { var name: String var age: String } var sendArray = [sendStruct]() func SendFunction() -> Array { return sendArray } } * Receiveclass RecevieClass { struct ReceiveStruct { var name: String var age: String } var ReceiveArray: Array = [ReceiveStruct]() let Send = SendClass() ReceiveArray = Send.SendFunction().map { ReceiveStruct(name: $0.name, age: $0.ag..
2016.08.04 -
특정 문자에 대한 분할(componentsSeparatedByString)
let str = "man|17&woman|19" let result = str.componentsSeparatedByString("&")print(result) // ["man|17", "woman|19] let charSet = NSCharacterSet(charactersInString: "|^")let result = str.componentsSeparatedByCharactersInSet(charSet)print(result) // ["man","17","woman","19"] let Array2D = str.componentsSeparatedByString("^").map { $0.componentsSeparatedByString("|")} print(Array2D) // [["man,"17"..
2016.08.03 -
[ERROR] pod install 시 Unable to satisfy the following requirements
$ pod install Analyzing dependencies[!] Unable to satisfy the following requirements: - `SQLite.swift (~> 0.10.1)` required by `Podfile` None of your spec sources contain a spec satisfying the dependency: `SQLite.swift (~> 0.10.1)`. You have either: * out-of-date source repos which you can update with `pod repo update`. * mistyped the name or version. * not added the source repo that hosts the P..
2016.08.01 -
Struct
struct InfoStruct { var NO: String var MenuItemName: String var MenuItemFamily: String var MenuImage: UIImage var PhoneNumber: String } var InfoArray = [InfoStruct]() InfoArray.append(InfoStruct(NO: user[no], MenuItemName: user[firstname], MenuItemFamily: user[lastname], MenuImage: user.get(userimage), PhoneNumber: user[phonenumber])) //let indexNo = NO.indexOf(NumberID) let indexNo = InfoArray...
2016.07.20