{"id":1510,"date":"2018-01-05T12:30:38","date_gmt":"2018-01-05T03:30:38","guid":{"rendered":"http:\/\/blue-bear.jp\/kb\/?p=1510"},"modified":"2018-01-05T12:30:38","modified_gmt":"2018-01-05T03:30:38","slug":"swift4-%e8%b5%b7%e5%8b%95%e6%99%82%e3%81%ab%e6%9c%80%e5%88%9d%e3%81%ab%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%82%8bviewcontroller%e3%82%92%e6%8c%af%e3%82%8a%e5%88%86%e3%81%91%e3%82%8b%e6%96%b9","status":"publish","type":"post","link":"https:\/\/blue-bear.jp\/kb\/swift4-%e8%b5%b7%e5%8b%95%e6%99%82%e3%81%ab%e6%9c%80%e5%88%9d%e3%81%ab%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%82%8bviewcontroller%e3%82%92%e6%8c%af%e3%82%8a%e5%88%86%e3%81%91%e3%82%8b%e6%96%b9\/","title":{"rendered":"[swift4] \u8d77\u52d5\u6642\u306b\u6700\u521d\u306b\u8868\u793a\u3055\u305b\u308bViewController\u3092\u632f\u308a\u5206\u3051\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u8d77\u52d5\u6642\u306b\u6700\u521d\u306b\u8868\u793a\u3055\u305b\u308bViewController\u3092\u632f\u308a\u5206\u3051\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u901a\u308a<\/p>\n<p>Main.Storyboard\u306e\u305d\u308c\u305e\u308c\u306eViewController\u306b&#8221;main&#8221;\u3068&#8221;tutorial&#8221;\u3068\u3044\u3046\u540d\u524d\u3092\u4ed8\u3051\u3066\u304a\u304f\u3002<\/p>\n<p>\u95a2\u6570\u3092\u4f5c\u6210<\/p>\n<pre class=\"lang:default decode:true\">func gotoMainStoryBoard(){\r\n let flg = false\/\/\u5206\u5c90\u6761\u4ef6\r\n \r\n let storyboard:UIStoryboard = UIStoryboard(name: \"Main\",bundle:nil)\r\n let viewController:UIViewController\r\n \r\n \/\/\u8868\u793a\u3059\u308b\u30d3\u30e5\u30fc\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u6307\u5b9a\r\n if flg {\r\n  viewController = storyboard.instantiateViewController(withIdentifier: \"main\") as UIViewController\r\n } else {\r\n  viewController = storyboard.instantiateViewController(withIdentifier: \"tutorial\") as UIViewController\r\n }\r\n \r\n window?.rootViewController = viewController\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>AppDelegate.swift\u306edidFinishLaunchingWithOptions\u306b\u5b9f\u88c5<\/p>\n<pre class=\"lang:default decode:true\">func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {\r\n \/\/ Override point for customization after application launch.\r\n \r\n gotoMainStoryBoard()\r\n \r\n return true\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8d77\u52d5\u6642\u306b\u6700\u521d\u306b\u8868\u793a\u3055\u305b\u308bViewCont<\/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\/1510"}],"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=1510"}],"version-history":[{"count":1,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/1510\/revisions"}],"predecessor-version":[{"id":1511,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/1510\/revisions\/1511"}],"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=1510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/categories?post=1510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/tags?post=1510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}