{"id":316,"date":"2016-10-02T08:37:05","date_gmt":"2016-10-01T23:37:05","guid":{"rendered":"http:\/\/blue-bear.jp\/kb\/?p=316"},"modified":"2016-10-02T08:37:05","modified_gmt":"2016-10-01T23:37:05","slug":"swift-tableview%e3%81%ab%e5%89%8a%e9%99%a4%e6%a9%9f%e8%83%bd%e3%82%92%e5%ae%9f%e8%a3%85","status":"publish","type":"post","link":"https:\/\/blue-bear.jp\/kb\/swift-tableview%e3%81%ab%e5%89%8a%e9%99%a4%e6%a9%9f%e8%83%bd%e3%82%92%e5%ae%9f%e8%a3%85\/","title":{"rendered":"[swift] tableView\u306b\u524a\u9664\u6a5f\u80fd\u3092\u5b9f\u88c5"},"content":{"rendered":"<h2>tableView\u306b\u524a\u9664\u6a5f\u80fd\u3092\u5b9f\u88c5<\/h2>\n<h3>\u524a\u9664\u30dc\u30bf\u30f3\u3092\u914d\u7f6e<\/h3>\n<p>StoryBoard\u3067NavigationBar\u4e0a\u306bBarButtonItem\u3092\u914d\u7f6e<\/p>\n<h3>IBAction\u3092\u5b9a\u7fa9<\/h3>\n<pre>\r\n@IBAction func tapEdit(sender: AnyObject) {\r\n        if editing {\r\n            super.setEditing(false, animated: true)\r\n            tableView.setEditing(false, animated: true)\r\n        } else {\r\n            super.setEditing(true, animated: true)\r\n            tableView.setEditing(true, animated: true)\r\n        }\r\n    }\r\n<\/pre>\n<p>\uff0a\u3053\u308c\u3067\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068TableView\u306e\u30bb\u30eb\u304c\u524a\u9664\u3067\u304d\u308b\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b<br \/>\n\uff0a\u524a\u9664\u30e2\u30fc\u30c9\u3092\u89e3\u9664\u3059\u308b\u306b\u306f\u3082\u3046\u4e00\u5ea6\u30dc\u30bf\u30f3\u3092\u62bc\u305b\u3070\u3088\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b<\/p>\n<h3>\u524a\u9664\u30dc\u30bf\u30f3Push\u6642\u306e\u6319\u52d5<\/h3>\n<pre>\r\nfunc tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {\r\n        \/\/ \u524a\u9664\u306e\u3068\u304d.\r\n        if editingStyle == UITableViewCellEditingStyle.Delete {\r\n            \/\/ \u6307\u5b9a\u3055\u308c\u305f\u30bb\u30eb\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092myItems\u304b\u3089\u524a\u9664\u3059\u308b.\r\n            myItems.removeAtIndex(indexPath.row)\r\n            \/\/ TableView\u3092\u518d\u8aad\u307f\u8fbc\u307f.\r\n            tableView.reloadData()\r\n        }\r\n    }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>tableView\u306b\u524a\u9664\u6a5f\u80fd\u3092\u5b9f\u88c5 \u524a\u9664<\/p>\n","protected":false},"author":1,"featured_media":88,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/316"}],"collection":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/comments?post=316"}],"version-history":[{"count":1,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":317,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/316\/revisions\/317"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media\/88"}],"wp:attachment":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/categories?post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/tags?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}