{"id":715,"date":"2016-01-21T10:16:36","date_gmt":"2016-01-21T01:16:36","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=715"},"modified":"2017-02-13T14:23:15","modified_gmt":"2017-02-13T05:23:15","slug":"swift%e3%81%ab%e3%82%88%e3%82%8b%e3%82%aa%e3%83%bc%e3%83%88%e3%83%ac%e3%82%a4%e3%82%a2%e3%82%a6%e3%83%88","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/715","title":{"rendered":"Swift\u306b\u3088\u308b\u30aa\u30fc\u30c8\u30ec\u30a4\u30a2\u30a6\u30c8"},"content":{"rendered":"<p>Swift\u306b\u3088\u308bVisualFormat\u5f62\u5f0f\u306e\u30aa\u30fc\u30c8\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u30b3\u30fc\u30c9\u4f8b<\/p>\n<p>UINavigationController\u306b\u304a\u3051\u308b\u5b9f\u88c5<\/p>\n<pre class=\"lang:swift decode:true \" >\/\/ VisualFormat\u304b\u3089\u53c2\u7167\u3059\u308b\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u8f9e\u66f8\r\nlet viewDictionary:Dictionary = [\"MyContent\": self.myContentView]\r\n\r\nlet constraintFormatH:[NSLayoutConstraint]\r\n    = NSLayoutConstraint.constraintsWithVisualFormat(\r\n            \"H:|-[MyContent]-|\",\r\n            options: NSLayoutFormatOptions(rawValue: 0),\r\n            metrics:nil,\r\n            views:viewDictionary)\r\nself.view.addConstraints(constraintFormatH)\r\n\r\n\/\/ NavigationBar\u306e\u9ad8\u3055:20\r\n\/\/ ToolBar\u306e\u9ad8\u3055:64\r\nlet constraintFormatV:[NSLayoutConstraint]\r\n    = NSLayoutConstraint.constraintsWithVisualFormat(\r\n            \"V:|-(20)-[MyContent]-(64)-|\",\r\n            options: NSLayoutFormatOptions(rawValue: 0),\r\n            metrics:nil,\r\n            views:viewDictionary)\r\nself.view.addConstraints(constraintFormatV)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Swift\u306b\u3088\u308bVisualFormat\u5f62\u5f0f\u306e\u30aa\u30fc\u30c8\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u30b3\u30fc\u30c9\u4f8b UINavigationController\u306b\u304a\u3051\u308b\u5b9f\u88c5 \/\/ VisualFormat\u304b\u3089\u53c2\u7167\u3059\u308b\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u8f9e\u66f8 let viewDictio [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[7,22],"class_list":["post-715","post","type-post","status-publish","format-standard","hentry","category-memo","tag-ios","tag-swift"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":7,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"predecessor-version":[{"id":722,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/715\/revisions\/722"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}