{"id":435,"date":"2016-10-31T07:36:46","date_gmt":"2016-10-30T22:36:46","guid":{"rendered":"http:\/\/blue-bear.jp\/kb\/?p=435"},"modified":"2016-10-31T07:36:46","modified_gmt":"2016-10-30T22:36:46","slug":"swift-tableview-%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%82%bb%e3%83%ab%e3%81%ae%e4%bd%9c%e6%88%90","status":"publish","type":"post","link":"https:\/\/blue-bear.jp\/kb\/swift-tableview-%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%82%bb%e3%83%ab%e3%81%ae%e4%bd%9c%e6%88%90\/","title":{"rendered":"[swift] tableView \u30ab\u30b9\u30bf\u30e0\u30bb\u30eb\u306e\u4f5c\u6210"},"content":{"rendered":"<h2>tableView \u30ab\u30b9\u30bf\u30e0\u30bb\u30eb\u306e\u4f5c\u6210<\/h2>\n<h3>StoryBoard<\/h3>\n<p>StoryBoard\u306bTableViewCell\u3092\u65b0\u305f\u306b\u914d\u7f6e<br \/>\nidentifer\u306b\u597d\u304d\u306a\u540d\u524d\u3092\u3064\u3051\u308b\u3002\u4f8b\uff1anewCell<\/p>\n<h3>UITableViewCell.swift\u3092\u65b0\u898f\u4f5c\u6210<\/h3>\n<p>UITableViewCell\u3092\u7d99\u627f\u3057\u305fswift\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210<br \/>\n\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\uff1a<\/p>\n<pre>\r\nclass customTableViewCell: UITableViewCell {\r\n    \r\n    @IBOutlet weak var profileView: UIImageView!\r\n    @IBOutlet weak var titleLabel: UILabel!\r\n    @IBOutlet weak var detailLabel: UILabel!    \r\n    \r\n    override func awakeFromNib() {\r\n        super.awakeFromNib()\r\n        \/\/ Initialization code\r\n    }\r\n    \r\n    override func setSelected(selected: Bool, animated: Bool) {\r\n        super.setSelected(selected, animated: animated)\r\n        \r\n        \/\/ Configure the view for the selected state\r\n    }\r\n    \r\n    \/\/\/ \u753b\u50cf\u30fb\u30bf\u30a4\u30c8\u30eb\u30fb\u8aac\u660e\u6587\u3092\u8a2d\u5b9a\u3059\u308b\u30e1\u30bd\u30c3\u30c9\r\n    func setCell(str: String,detail:String) {\r\n        titleLabel.text = str\r\n        detailLabel.text = detail\r\n    }\r\n    \r\n    func setCell(img: UIImage) {\r\n        profileView.image = img\r\n    }\r\n    \r\n}\r\n<\/pre>\n<h3>StoryBoard\u3068customTableViewCell\u3092\u95a2\u9023\u4ed8\u3051<\/h3>\n<p>StoryBoard\u306e\u30ab\u30b9\u30bf\u30e0\u30bb\u30eb\u306b<br \/>\n@IBOutlet weak var profileView: UIImageView!<br \/>\n@IBOutlet weak var titleLabel: UILabel!<br \/>\n@IBOutlet weak var detailLabel: UILabel!<br \/>\n\u306b\u5bfe\u5fdc\u3059\u308b\u30a2\u30a4\u30c6\u30e0\u3092\u914d\u7f6e\u3002<br \/>\n\u305d\u308c\u305e\u308c\u306e\u7d10\u4ed8\u3051\u3092\u884c\u3046<\/p>\n<p>\u307e\u305f<br \/>\nStoryBoard\u306e\u30ab\u30b9\u30bf\u30e0\u30bb\u30eb\u306b\u306f\u300ccustomTableViewCell\u300d\u3092\u6307\u5b9a\u3057\u3066\u304a\u304f\u3053\u3068\u3002<\/p>\n<h3>tableView<\/h3>\n<p>tableView\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u88c5<\/p>\n<pre>\r\nfunc tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {\r\n        \r\n        let cell = tableView.dequeueReusableCellWithIdentifier(\"newCell\") as! customTableViewCell\r\n                \r\n        cell.setCell(UIImage(named: \"clubList_user_icon.png\")!)\r\n        cell.setCell(\"titleString\",detail:\"detailString\")\r\n        return cell\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>tableView \u30ab\u30b9\u30bf\u30e0\u30bb\u30eb\u306e\u4f5c\u6210 <\/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\/435"}],"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=435"}],"version-history":[{"count":1,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/435\/revisions"}],"predecessor-version":[{"id":436,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/435\/revisions\/436"}],"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=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/categories?post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/tags?post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}