なんとかするから、なんとかなる

エンジニア関係のことを書きます

2018-08-22から1日間の記事一覧

iOS How to scale an image in UIButton.

Introduction This article shows how to scale an image in UIButton. When UIButton will be a large scale or small scale by Autolayout engine, an image it was contained in the UIButton is not correspond to the scale normally. This article wil…

iOS How to get a monospace font for digits in UIFont.

Intoduction This article shows how to set a monospace font for digits. A monospace font has same width in each character. Sometimes, a font which isn't monospace make the design baddly. Solution To get the monospace font for digits, Apple …

iOS UITextField How to dismiss the keyboard when user tap a retrun key.

Introduction This article show you that how to dismiss the keyboard when user tap a return key on UITextField of iOS. In fact, this way shows on the iOS SDK document. I've never knew it. Solution Adapt the UITextFieldDelegate on your ViewC…

iOS UITableView deleteRows(at:with:) was crashed

Introdution UITableView is one of the most popular UI system in iOS developer. But, sometimes this UI system make us annoying. In this time, when I try to delete the UITableViewCell from swipe or delete button, it would be crashed. So, thi…

iOS It’s difficult to animate UIView by themselves when it appeared.

Introduction This article explains its difficult to animate an UIView by themselves when it appeared. Conclusion There two solution for the problem. • Call some animation start method by UIViewController • Observe the didBecomeActive event…

iOS How to detect the instance is inheritance of some class or not.

Intoroduction This are article shows how to detect the instance is inheritance of some class or not. Solution if someInstane is SomeClass { // The Instance is inheritance of some class. } else { // Instance is not inheritance of some class.…

iOS How to detect an user interacion while animating

Introduction This article shows how to detect an user interaction while animating on UIView or UIbutton or etc. Solution Set the ".allowUserIntercation" properties in option at UIView.animate method. UIView.animate(withDuration: 1.0, delay…

iOS UITableViewCellで選択されたCellをもとに戻す

English version below. https://hopita.hatenablog.com/entry/2018/08/22/225145 はじめに 選択されたCellをもとに戻す。よくやることですが、恥ずかしながら勘違いして覚えていたので備忘録。 解決方法 override func tableView(_ tableView: UITableView,…

iOS How to deselect a cell which was tapped by user.

Introduction This article shows how to deselect an cell when user tapped it. Solution It's a easy way to do it. override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { //Change the selected background view …