{"id":1383,"date":"2012-09-03T08:00:00","date_gmt":"2012-09-02T23:00:00","guid":{"rendered":"http:\/\/www.hawk-a.com\/exception_code\/?p=1383"},"modified":"2013-09-06T15:29:03","modified_gmt":"2013-09-06T06:29:03","slug":"xcode4-4uiviewcontroller%e2%87%94uisplitviewcontroller-1%e3%81%a4%e3%81%ae%e3%83%93%e3%83%a5%e3%83%bc%e3%81%8b%e3%82%89splitview%e3%81%ab%e9%81%b7%e7%a7%bb%e3%81%95%e3%81%9b%e3%82%8b%e6%96%b9","status":"publish","type":"post","link":"http:\/\/www.hawk-a.com\/exception_code\/archives\/1383","title":{"rendered":"[XCode]UIViewController\u304b\u3089UISplitViewController 1\u3064\u306e\u30d3\u30e5\u30fc\u304b\u3089SplitView\u306b\u9077\u79fb\u3055\u305b\u308b\u65b9\u6cd5"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" title=\"MasterDetail.xcodeproj \u2014 MainStoryboard.storyboard-1.png\" src=\"http:\/\/www.hawk-a.com\/exception_code\/wp-content\/uploads\/2012\/09\/e815de2c8d8cf6adf8bc9318a4a98bef.png\" alt=\"MasterDetail xcodeproj  MainStoryboard storyboard 1\" width=\"500\" height=\"278\" border=\"0\" \/><\/p>\n<p>\u5148\u65e5\u3001\u30a2\u30d7\u30ea\u3092\u521d\u3081\u3066Apple\u306b\u7533\u8acb\u3057\u307e\u3057\u305f\u3002@hawk_a\u3067\u3059\u3002<\/p>\n<p>iOS\u958b\u767a\u306e\u4e03\u4e0d\u601d\u8b70\u306e1\u3064\u3060\u3063\u305f\u300c1\u3064\u306eView\u304b\u3089SplitView\u306b\u9077\u79fb\u3055\u305b\u308b\u300d\u65b9\u6cd5\u304c\u3084\u3063\u3068\u308f\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u30ab\u30b9\u30bf\u30e0Segue\u3092\u4f7f\u3046<\/h2>\n<p>\u3084\u308a\u65b9\u306e\u524d\u306b\u53c2\u8003URL\u3092\u7d39\u4ecb\u3055\u305b\u3066\u304f\u3060\u3055\u3044\u3002\u611f\u8b1d\u3057\u3066\u3082\u3057\u5207\u308c\u307e\u305b\u3093\u3002<\/p>\n<p><a href=\"http:\/\/cheesememo.blog39.fc2.com\/blog-entry-465.html\">\u30c1\u30fc\u30ba\u304f\u3093\u306e\u5099\u5fd8\u9332 [iOS]UIViewController\u304b\u3089UISplitViewController\u3078\u9077\u79fb\u3059\u308b\u305f\u3081\u306e\u306eSegue<\/a><\/p>\n<p>\u304a\u305d\u3089\u304f\u3053\u306e\u8a18\u4e8b\u304c\u306a\u304b\u3063\u305f\u3089\u3001\u5bff\u547d\u3092\u8fce\u3048\u3066\u3044\u305f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307b\u3068\u3093\u3069\u3053\u3061\u3089\u306e\u8a18\u4e8b\u304c\u30d9\u30fc\u30b9\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001UISplitViewController\u304b\u3089UIViewController\u306b\u623b\u308b\u65b9\u6cd5\u3082\u3042\u308f\u305b\u3066\u66f8\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u3069\u3061\u3089\u3082StoryBoard\u306e\u30ab\u30b9\u30bf\u30e0Segue\u3092\u7528\u3044\u3066\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p>\u00a0<\/p>\n<p>\u307e\u305a\u306fUIView\u304b\u3089SplitView\u3078\u9077\u79fb\u3055\u305b\u308b\u65b9\u6cd5\u304b\u3089\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u65b0\u898f\u4f5c\u6210\u304b\u3089[Master-Detail Application]\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>Utilities\u304b\u3089\u521d\u3081\u306b\u8868\u793a\u3055\u305b\u308bViewController\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001StoryBoard\u306b\u5f15\u3063\u5f35\u3063\u3066\u304d\u3066\u3001\u305d\u3044\u3064\u306eAttributes Inspector\u306eIs Initial View Controller\u306b\u30c1\u30a7\u30c3\u30af\u3092\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u521d\u671f\u8d77\u52d5\u3092SplitViewController\u304b\u3089UIViewController\u306b\u5909\u66f4\u3055\u305b\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"MasterDetail.xcodeproj \u2014 MainStoryboard.storyboard-2.png\" src=\"http:\/\/www.hawk-a.com\/exception_code\/wp-content\/uploads\/2012\/09\/ad64e34d7df585a0cad9e939d14c671c.png\" alt=\"MasterDetail xcodeproj  MainStoryboard storyboard 2\" width=\"260\" height=\"208\" border=\"0\" \/><\/p>\n<p>\u00a0<\/p>\n<p>\u3093\u3067\u3001\u9077\u79fb\u3055\u305b\u305f\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089SplitViewController\u306bSegue\u3092\u5f15\u3063\u5f35\u3063\u3066\u3084\u308a\u307e\u3059\u3002Segue\u306fCustom\u3067\u7e4b\u3044\u3067\u3084\u308a\u307e\u3057\u3087\u3046\u3002\u3053\u306e\u72b6\u614b\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"MasterDetail.xcodeproj \u2014 MainStoryboard.storyboard-3-1.png\" src=\"http:\/\/www.hawk-a.com\/exception_code\/wp-content\/uploads\/2012\/09\/e763e59c6ad66b9057e58c12ffb21478.png\" alt=\"MasterDetail xcodeproj  MainStoryboard storyboard 3 1\" width=\"500\" height=\"349\" border=\"0\" \/><\/p>\n<p>UIButton\u304b\u3089SplitViewController\u3078\u7e4b\u3044\u3067\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u3001\u305d\u306e\u5024\u304c\u6b63\u3057\u304b\u3063\u305f\u3089\u9077\u79fb\u3092\u3057\u305f\u3044\u5834\u5408\u306fViewController\u304b\u3089SplitViewController\u306b\u7e4b\u3044\u3067\u3084\u3063\u3066\u3001UIButton\u306eIBAction\u304b\u3089Segue\u306eIdentifier\u3067\u6761\u4ef6\u5206\u5c90\u3057\u3066\u3084\u308b\u3068\u4e0a\u624b\u304f\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u304b\u3001\u305d\u3046\u3044\u3046\u7528\u9014\u306b\u4f7f\u3044\u305f\u3044\u304b\u3089\u521d\u3081\u306bUIViewController\u3092\u4f7f\u3046\u3068\u3044\u3046\u5834\u5408\u304c\u307b\u3068\u3093\u3069\u306a\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u304a\u6b21\u306bCustom\u306b\u8a2d\u5b9a\u3057\u305fSegue\u306e\u8aad\u307f\u5148\u3092\u4f5c\u3063\u3066\u3084\u308a\u307e\u3059\u3002<\/p>\n<p>File\u2192New\u2192File\u2192Objective-C class\u3067UIStoryboardSegue\u3092\u30b5\u30d6\u30af\u30e9\u30b9\u306b\u3057\u3066\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u53c2\u7167\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Xcode.png\" src=\"http:\/\/www.hawk-a.com\/exception_code\/wp-content\/uploads\/2012\/09\/bloggerXcode.png\" alt=\"Xcode\" width=\"500\" height=\"340\" border=\"0\" \/><\/p>\n<p>\u00a0<\/p>\n<p>\u305d\u3057\u3066\u4e0a\u306e\u795e\u8a18\u4e8b\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3002<\/p>\n<p>SplitViewFlipSegue.m<\/p>\n<pre class=\"prettyprint\">\r\n#import &quot;SplitViewFlipSegue.h&quot;\r\n\r\n@implementation SplitViewFlipSegue\r\n\r\n- (void)perform {\r\n    \/\/sourceViewController:\u9077\u79fb\u524d\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\r\n    \/\/destinationViewController:\u9077\u79fb\u5f8c\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\r\n    UIViewController *sourceViewController = (UIViewController *)self.sourceViewController;\r\n    UIViewController *destinationViewController = (UIViewController *)self.destinationViewController;\r\n    \r\n    \/\/ UISplitViewController\u306eDetailViewController\u30af\u30e9\u30b9\u3078Delegate\u3092\u8a2d\u5b9a\r\n    UISplitViewController *splitViewController = (UISplitViewController *)destinationViewController;\r\n    UINavigationController *navigationController = [splitViewController.viewControllers lastObject];\r\n    splitViewController.delegate = (id)navigationController.topViewController;\r\n    \r\n    UIWindow *window = [UIApplication sharedApplication].keyWindow;\r\n    \/\/ \u4e00\u5ea6\u8cbcroot\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u56de\u8ee2\u65b9\u5411\u306e\u4fee\u6b63\r\n    window.rootViewController = destinationViewController;\r\n    window.rootViewController = sourceViewController;\r\n    \r\n    [UIView transitionWithView:sourceViewController.view.window\r\n                      duration:0.5\r\n                       options:UIViewAnimationOptionTransitionFlipFromLeft\r\n                    animations:^{\r\n                        window.rootViewController = destinationViewController;\r\n                    }\r\n                    completion:^(BOOL finished){\r\n                        \/\/\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u7d42\u4e86\u5f8c\u306e\u51e6\u7406\r\n                    }];\r\n}\r\n\r\n@end\r\n<\/pre>\n<p>\u305d\u3057\u3066\u3001AppDelegate.m\u306edidFinishLaunching\u2026\u30e1\u30bd\u30c3\u30c9\u306e3\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u3053\u308c\u3092\u3057\u306a\u3044\u3068\u843d\u3061\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"MasterDetail.xcodeproj \u2014 AppDelegate.m-2.png\" src=\"http:\/\/www.hawk-a.com\/exception_code\/wp-content\/uploads\/2012\/09\/99f8573b1e39e2cea81f1ded4d7e8ee4.png\" alt=\"MasterDetail xcodeproj  AppDelegate m 2\" width=\"500\" height=\"75\" border=\"0\" \/><\/p>\n<p>\u00a0<\/p>\n<p>\u3053\u308c\u3067\u8d77\u52d5\u3057\u3066\u307f\u308b\u3068\u3046\u307e\u3044\u3053\u3068\u9077\u79fb\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u306f\u3058\u3081\u306eUIViewController\u306e\u5411\u304d\u304c\u304a\u304b\u3057\u3044\u5834\u5408\u306fUIViewController\u3092\u30b5\u30d6\u30af\u30e9\u30b9\u306b\u3057\u305f\u30af\u30e9\u30b9\u4f5c\u3063\u3066\u6307\u5b9a\u3057\u3066\u3084\u308c\u3070\u76f4\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u958b\u767a\u306e\u5e45\u304c\u5e83\u304c\u308a\u307e\u3059\u3002<\/p>\n<p>\u00a0UISplitViewController\u304b\u3089UIViewController\u306b\u623b\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u3002<\/p>\n<p><a href=\"http:\/\/www.hawk-a.com\/exception_code\/archives\/1388\">[XCode]UISplitViewController\u2192UIViewController SplitView\u304b\u30891\u3064\u306e\u30d3\u30e5\u30fc\u306b\u9077\u79fb\u3055\u305b\u308b\u65b9\u6cd5 | Exception Code.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u65e5\u3001\u30a2\u30d7\u30ea\u3092\u521d\u3081\u3066Apple\u306b\u7533\u8acb\u3057\u307e\u3057\u305f\u3002@hawk_a\u3067\u3059\u3002 iOS\u958b\u767a\u306e &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2108,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[365],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/posts\/1383"}],"collection":[{"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/comments?post=1383"}],"version-history":[{"count":1,"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/posts\/1383\/revisions"}],"predecessor-version":[{"id":2118,"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/posts\/1383\/revisions\/2118"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/media\/2108"}],"wp:attachment":[{"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/media?parent=1383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/categories?post=1383"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hawk-a.com\/exception_code\/wp-json\/wp\/v2\/tags?post=1383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}