Сообщения

Сообщения за август, 2016

Fr 05/09/16

1) How to start application in Xcode for different languages while testing.      In order to change default order of languages only for your XCode project, you can go to the Product > Scheme > Edit scheme, and add argument to "Run" scheme, for example: -AppleLanguages "(English,Russian)". 2) Go through all strings and take them to localizable.strings Type “cd ”, then drag in your project folder, then press enter to navigate to your project: find ./ -name "*.m" -print0 | xargs -0 genstrings -o en.lproj 3)  Git steps to create pull request Fork it! Create your feature branch:  git checkout -b my-new-feature Commit your changes:  git commit -am 'Add some feature' Push to the branch:  git push origin my-new-feature Submit a pull request :D

Mon 01/08/16

1) Disadvantage in using delegate of UITextField due to changing values in Cell's text fields.       If you have UITableView with UITextField in it's cells, you need to update it. There are some ways, and one of them to use UITextFieldDelegate like in example: func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { if string == " " { return false } let indexPathForCellWhereTextFieldIs = self.tableView.indexPathForCell(textField.superview?.superview as! UITableViewCell) if indexPathForCellWhereTextFieldIs != nil { textFieldValues[(indexPathForCellWhereTextFieldIs?.section)!] = (textField.text! as NSString).stringByReplacingCharactersInRange(range, withString: string) as NSString as String } return true } So you have to check if  indexPathForCellWhereTextFieldIs  is'n nil.