{"id":674,"date":"2021-09-17T15:21:20","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/swift.tecc0.com\/?p=674"},"modified":"2021-09-17T15:21:20","modified_gmt":"1970-01-01T00:00:00","slug":"post-674","status":"publish","type":"post","link":"https:\/\/swift.tecc0.com\/?p=674","title":{"rendered":"Swift\u3067UIButton\u306e\u80cc\u666f\u8272\u30fb\u80cc\u666f\u753b\u50cf\u3092\u5909\u66f4\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u4eca\u56de\u306f<strong>UIButton\u3067\u80cc\u666f\u8272\u3068\u80cc\u666f\u753b\u50cf\u3092\u5909\u66f4\u3059\u308b<\/strong>\u65b9\u6cd5\u3060\u3088\u3002<\/p>\n<p>\u9759\u7684\u306a\u3082\u306e\u306fStoryBoard\u3067\u826f\u3044\u3068\u601d\u3046\u3088\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Swift\u3067UIButton\u306e\u80cc\u666f\u8272\u30fb\u80cc\u666f\u753b\u50cf\u3092\u5909\u66f4\u3059\u308b<\/h3>\n<pre class=\"lang:swift decode:true\">import UIKit\r\n\r\nclass ViewController: UIViewController {\r\n\r\n    @IBOutlet weak var button: UIButton!\r\n    \r\n    override func viewDidLoad() {\r\n        super.viewDidLoad()\r\n        \r\n        button.backgroundColor = UIColor.red \/\/ \u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272\u3092\u8d64\u306b\r\n        let image = UIImage(named: \"hogeImage\") \/\/ hogeImage\u3068\u3044\u3046\u540d\u524d\u306e\u753b\u50cf\r\n        button.setBackgroundImage(image, for: .normal) \/\/ \u80cc\u666f\u306b\u753b\u50cf\u3092set\r\n    }\r\n}<\/pre>\n<p>\u3061\u306a\u307f\u306b\u4f59\u8ac7\u3060\u3051\u3069\u3001hogeImage\u306e\u540d\u524d\u304c\u9593\u9055\u3063\u3066\u3066\u3082\u7279\u306b\u30a8\u30e9\u30fc\u843d\u3061\u3068\u304b\u305b\u305a\u3001\u53cd\u6620\u3055\u308c\u306a\u3044\u3060\u3051\u3060\u304b\u3089\u3001\u540d\u524d\u306b\u306f\u6c17\u3092\u3064\u3051\u3088\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306fUIButton\u3067\u80cc\u666f\u8272\u3068\u80cc\u666f\u753b\u50cf\u3092\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u3060\u3088\u3002 \u9759\u7684\u306a\u3082\u306e\u306fStoryBoard\u3067\u826f\u3044\u3068\u601d\u3046\u3088\u3002 &nbsp; Swift\u3067UIButton\u306e\u80cc\u666f\u8272\u30fb\u80cc\u666f\u753b\u50cf\u3092\u5909\u66f4\u3059\u308b import UIKit class&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/674"}],"collection":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=674"}],"version-history":[{"count":2,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/674\/revisions"}],"predecessor-version":[{"id":676,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/674\/revisions\/676"}],"wp:attachment":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}