###前提・実現したいこと
デフォルトでよくある編集モード移行時のアニメーションを実装したい。
###発生している問題・エラーメッセージ
setEditing
のanimated
はtrueになっているが、アニメーションされない。
※あれって実は自前で実装しないといけないなどありますか?
###該当のソースコード
swift
1import UIKit 2 3class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { 4 5 @IBOutlet weak var tableView: UITableView! 6 7 override func viewDidLoad() { 8 super.viewDidLoad() 9 // Do any additional setup after loading the view, typically from a nib. 10 navigationItem.rightBarButtonItem = editButtonItem() 11 } 12 13 override func setEditing(editing: Bool, animated: Bool) { 14 print(animated) 15 super.setEditing(editing, animated: animated) 16 tableView.editing = editing 17 } 18 19 func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 20 return 5 21 } 22 23 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 24 let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) 25 return cell 26 } 27 28}
###試したこと
setEditing
のanimated
をprintで出力してみたがtrueになっていたため、問題はないと思われる。
###補足情報(言語/FW/ツール等のバージョンなど)
・Xcode7.3.1
・Swift2.2
回答1件
あなたの回答
tips
プレビュー