Programming(132)
-
특정 문자에 대한 분할(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 -
How to kill your app when it enters background mode
http://pinkstone.co.uk/how-to-kill-your-app-when-it-enters-background-mode/ 홈버튼을 눌러 백그라운드로 갔을 경우 앱을 실행시키지 않는다. 다시 실행하면 앱은 사용했던 화면을 보여주지 않고 새로 시작된다.
2016.07.15 -
navigation bar 배경색상 조절
let nav = self.navigationController?.navigationBar nav?.barTintColor = UIColor(red: 237.0/255.0, green: 237.0/255.0, blue: 242.0/255.0, alpha: 1.0) nav?.tintColor = UIColor(red: 0/255.0, green: 123.0/255.0, blue: 255.0/255.0, alpha: 1.0) nav?.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.blackColor()]
2016.07.06 -
tableView의 cell 안에 2줄이상 사용할 때
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { // you can also programmatically calculate a desired if(indexPath.section==0) { //첫번째 섹션 일때 return 80 // 셀 크기를 80으로 지정 } else { return 44 } return 0 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { cell.HomeMenuItemLabel.numberOfLines = 4;..
2016.07.06