- iOS UICollecionViewFlowLayout でカスタムレイアウトを作ろう 〜 Swift版
- UITableView・UICollectionView攻略
- 【iOS】UITableViewでCardUIを実装してみる
参考: https://ideacloud.co.jp/dev/addsubview_index.html
self.view.sendSubviewToBack(subview)
subview.removeFromSuperview()
よくわからないメソッド
willRemoveSubview(subview)
- UICollectionViewのDataSourceとDelegateをControllerと別のファイルに記述する
- swiftでDelegate/DataSourceを分離したいときに気をつけること
原因
- AutoLayoutとの共存ができない。
対処方法
xibファイルに分離して読みだす。
参考: http://studio.beatnix.co.jp/develop/swift/delay/
let delay = 1.0 * Double(NSEC_PER_SEC) let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay)) dispatch_after(time, dispatch_get_main_queue(), { // 処理 })