{"id":465,"date":"2015-07-14T14:52:45","date_gmt":"2015-07-14T05:52:45","guid":{"rendered":"http:\/\/www.nukoneko.info\/blog\/?p=465"},"modified":"2015-07-14T15:44:20","modified_gmt":"2015-07-14T06:44:20","slug":"swift-%e3%81%a7%e3%81%ae%e7%94%bb%e9%9d%a2%e9%81%b7%e7%a7%bb%e3%83%a1%e3%83%a2","status":"publish","type":"post","link":"https:\/\/www.nukoneko.info\/blog\/?p=465","title":{"rendered":"Swift \u3067\u306e\u753b\u9762\u9077\u79fb\u30e1\u30e2"},"content":{"rendered":"<p>Storyboard\u4f7f\u3063\u305f\u308a\u4f7f\u308f\u306a\u304b\u3063\u305f\u308a\u3001\u30b3\u30fc\u30c9\u306e\u4e2d\u304b\u3089\u9077\u79fb\u3059\u308b\u65b9\u6cd5\u3082\u3044\u308d\u3044\u308d\u3042\u3063\u3066??\u3063\u3066\u306a\u3063\u305f\u306e\u3067\u30e1\u30e2<\/p>\n<p><!--more--><\/p>\n<p>SecondViewController \u3078\u306e\u9077\u79fb\u304c\u3057\u305f\u3044\u3002<\/p>\n<p>\u203b $~~ \u306f\u9069\u5f53\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<br \/>\n\u307e\u305a\u3001swift\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u9077\u79fb\u30e1\u30bd\u30c3\u30c9<br \/>\n<strong><em>self.performSegueWithIdentifier(\u201cView name\u201d, sender: $AnyObject);<\/em><\/strong><br \/>\n<strong><em>self.presentViewController( $ViewController, animated: $bool, completion: $AnyClosure);<\/em><\/strong><\/p>\n<p>\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30d0\u30fc\u4ed8\u304d\u306e\u6642<br \/>\n<strong><em>self.navigationController?.pushViewController($ViewController, animated: $bool);<\/em><\/strong><\/p>\n<p>\u307e\u305a\u4e0a\u306e\u4e8c\u3064<\/p>\n<h2><em>self.performSegueWithIdentifier(\u201cView name\u201d, sender: $AnyObject);<\/em><\/h2>\n<p>\u3000\u7b2c\u4e00\u5f15\u6570\u306e \u201cView Name\u201d \u306f Segue\u306eidentifier<br \/>\n\u3053\u308c\u3067\u3059\u3002<br \/>\n<a href=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/07\/d77b5864ca6e0df7e9ec5b147154e2da.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/07\/d77b5864ca6e0df7e9ec5b147154e2da-150x150.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2015-07-14 14.04.54\" width=\"150\" height=\"150\" class=\"aligncenter size-thumbnail wp-image-466\" \/><\/a><br \/>\n\u591a\u5206\u3053\u3046\u3084\u3063\u3066\u7e4b\u304c\u3063\u3066\u3044\u306a\u3044View\u306b\u306f\u9077\u79fb\u3067\u304d\u307e\u305b\u3093\u3002(\u3057\u3089\u306a\u3044<\/p>\n<p>\u3064\u304e<\/p>\n<h2><em>self.presentViewController($ViewController, animated: $bool, completion: $AnyClosure);<\/em><\/h2>\n<p> \u7b2c\u4e00\u5f15\u6570\u306f\u9077\u79fb\u5148\u306eViewController\u30af\u30e9\u30b9<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n\u9077\u79fb\u5148ViewController\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u65b9\u6cd5\u306f<\/p>\n<p>1. var vc = <em>SecontViewController()<\/em>;<br \/>\n2. var vc = <em>UIStoryboard(name:\u201c\u6240\u5c5eStoryBoard\u540d\u201d, bundle: nil).instantiateViewControllerWithIdentifier(\u201cView\u306eStoryboardID\u201d)<\/em> as! UIViewController;<br \/>\n3. var vc = <em>self.storyboard?.instantiateViewControllerWithIdentifier(\u201cView\u306eStoryboardID\u201d)<\/em> as! UIViewController;<\/p>\n<p>\u3068\u304b\u304c\u3042\u308b\u3002<\/p>\n<p>\u307e\u305a \u3088\u304f\u4ed6\u306e\u8a00\u8a9e\u3067\u898b\u308b <\/p>\n<h3>1. ViewController();<\/h3>\n<p>\u3082\u3057Storyboard\u4e0a\u3067 \u3044\u308d\u3044\u308d\u306aView\u3092\u30bb\u30c3\u30c8\u3057\u3066\u30ec\u30a4\u30a2\u30a6\u30c8\u4f5c\u3063\u3066\u308b\u306a\u3089\u3053\u308c\u3092\u4f7f\u3063\u3066\u306f\u3044\u3051\u306a\u3044<br \/>\nOutlet\u304cnil\u306b\u306a\u3063\u3066\u3001\u9ed2\u3044\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059..\u3002<\/p>\n<p>Storyboard\u3092\u4f7f\u308f\u305a\u306baddSubView\u3068\u304b\u4f7f\u3063\u3066\u914d\u7f6e\u3057\u3066\u308b\u306a\u3089\u3053\u308c\u3067\u3082\u3044\u3044\u3002<\/p>\n<p>\u6b21 Storyboard\u304b\u3089ViewController\u3092\u8aad\u307f\u8fbc\u3080\u3002<\/p>\n<h3>2. UIStoryboard(~).instantiateViewControllerWithIdentifier(~)<\/h3>\n<h3>3. self.storyboard?.instantiateViewControllerWithIdentifier(~)<\/h3>\n<p>\u30ec\u30a4\u30a2\u30a6\u30c8\u306bStoryboard\u3092\u4f7f\u3063\u3066\u308b\u4eba\u306f\u3053\u308c\u3092\u4f7f\u3048\u3070\u5b89\u6cf0\u3067\u3059\u306d\u3002<br \/>\nSegue \u3067\u7e4b\u304c\u3063\u3066\u306a\u304f\u3066\u3082\u554f\u984c\u306a\u3044\u3067\u3059\u3002<\/p>\n<p>2. \u3092\u4f7f\u3048\u3070\u3001\u5225\u306eStoryBoard\u306eView\u3082\u547c\u3073\u51fa\u305b\u307e\u3059\u3002<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001<br \/>\nperformSegueWithIdentifier \u3068 presentViewController<br \/>\n\u306f\u597d\u304d\u306a\u65b9\u3092\u4f7f\u3048\u3070\u3044\u3044\u3067\u3059\u3002<\/p>\n<p>\u3082\u3057NavigationController\u3092\u4f7f\u3063\u3066\u3044\u3066\u3001\u9077\u79fb\u5148\u3067\u4e0a\u90e8\u30d0\u30fc\u3092\u8868\u793a\u3055\u305b\u305f\u304b\u3063\u305f\u3089<br \/>\n\u4e09\u3064\u76ee\u306e<br \/>\n<strong>self.navigationController?.pushViewController($ViewController, animated: $bool);<\/strong><\/p>\n<p>\u3092\u4f7f\u304a\u3046<\/p>\n<p><em>navigationController \u306b\u3082\u3082\u3061\u308d\u3093\u3001<br \/>\npresentViewController \u3068<br \/>\nperformSegueWithIdentifier<br \/>\n\u304c\u5b9f\u88c5\u3055\u308c\u3066\u308b\u304b\u3089\u3001 pushViewController \u304c\u4f7f\u3044\u305f\u3044\u6642\u306f\u9593\u9055\u308f\u306a\u3044\u3088\u3046\u306b<\/em><\/p>\n<p>\u308f\u304b\u308a\u3084\u3059\u304f\u307e\u3068\u307e\u3089\u306a\u304b\u3063\u305f\u3051\u3069\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u306d<\/p>\n<p>\u3067\u306f\u3067\u306f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Storyboard\u4f7f\u3063\u305f\u308a\u4f7f\u308f\u306a\u304b\u3063\u305f\u308a\u3001\u30b3\u30fc\u30c9\u306e\u4e2d\u304b\u3089\u9077\u79fb\u3059\u308b\u65b9\u6cd5\u3082\u3044\u308d\u3044\u308d\u3042\u3063\u3066??\u3063\u3066\u306a\u3063\u305f\u306e\u3067\u30e1\u30e2<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-465","post","type-post","status-publish","format-standard","hentry","category-swift"],"_links":{"self":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=465"}],"version-history":[{"count":10,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/465\/revisions"}],"predecessor-version":[{"id":476,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/465\/revisions\/476"}],"wp:attachment":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}