明日も楽をするために

めんどくさがりなITエンジニアが書くメモ帳

swift2.0

UITableViewでUITableViewCellの高さを自動で可変する

今回はUILabelとUITextViewを使用した場合にUITableViewCellの高さを自動で可変する方法を書きます。UITableViewは予め設定し終わった状態と過程して話を進めます。StoryBoard上の設定は以下のようにmarginをセットしてます。 画像はUILabelですが、UITextVi…

StoryBoardでEmbed inで追加したNavigationControllerをModalViewで開く場合の値の渡し方

StoryBoardでEmbed inで追加したViewControllerにModalViewで開いて値を渡す方法FirstViewController ↓ NavigationController(SecondViewControllerにEmbed inで追加したもの) ↓ SecondViewController let modalView = storyboard!.instantiateViewControlle…

iOSでTabbarのテキストの色を変更する

選択後の色に関しては別の方法もあるが、選択前の色も変える方法 let font:UIFont! = UIFont(name:"HiraKakuProN-W3",size:10) let selectedAttributes = [NSFontAttributeName : font, NSForegroundColorAttributeName : UIColor.whiteColor()] UITabBarIte…