{"id":1471,"date":"2022-03-15T23:38:07","date_gmt":"2022-03-15T14:38:07","guid":{"rendered":"https:\/\/www.typea.info\/blog\/?p=1471"},"modified":"2022-03-15T23:44:32","modified_gmt":"2022-03-15T14:44:32","slug":"storyboard_segue_connect_screen","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2022\/03\/15\/storyboard_segue_connect_screen\/","title":{"rendered":"storyboard segue(\u30bb\u30b0\u30a8)\u3067\u753b\u9762\u9077\u79fb\u3092\u3064\u306a\u3050(macos)"},"content":{"rendered":"<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2022\/03\/13\/storyboard_childwindow_macos\/\">storyboard \u3092\u4f7f\u7528\u3057\u3066\u753b\u9762\u9077\u79fb\u304c\u3067\u304d\u305f<\/a>\u306e\u3067\u3001\u5f15\u304d\u7d9a\u304d\u4ee5\u4e0b\u306e\u52d5\u753b\u3092\u53c2\u8003\u306b\u3001\u9077\u79fb\u5143\u753b\u9762\u304b\u3089\u5148\u753b\u9762\u3078\u5024\u3092\u53d7\u3051\u308f\u305f\u3059\u3002<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/HY5uiTfjs8M\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><a href=\"https:\/\/www.youtube.com\/channel\/UCDg-YmnNehm3KB0BpytkUJg\">(135) AppleProgramming &#8211; YouTube<\/a><\/p>\n<h2>1.\u3067\u304d\u3042\u304c\u308a\u753b\u9762<\/h2>\n<p>\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306b\u5024\u3092\u5165\u308c\u3066\u3001Popover\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u3001\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u5185\u5bb9\u304c\u753b\u9762\u8868\u793a\u3055\u308c\u308b<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboardy_segue.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboardy_segue.gif\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboardy_segue.gif\" alt=\"Storyboardy segue\" width=\"497\" height=\"331\" border=\"0\" \/><\/a><\/p>\n<h2>2.ViewController\u306e\u8ffd\u52a0<\/h2>\n<p>\u4e0a\u8a18\u306f\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u3060\u3051\u306b\u898b\u3048\u308b\u304c\u3001\u5143\u306e\u753b\u9762\u3068\u5225\u306eViewController\u3092\u7528\u610f\u3057\u3001Segue(\u30bb\u30b0\u30a8)\u3068\u3084\u3089\u3092\u5229\u7528\u3057\u3066\u753b\u9762\u9077\u79fb\u3092\u304a\u3053\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u307e\u305a\u3001File ~New-File\u3067Cocoa\u30af\u30e9\u30b9\u3092\u8ffd\u52a0<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00001.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00001.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00001.png\" alt=\"Storyboard segue00001\" width=\"599\" height=\"294\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00002.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00002.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00002.png\" alt=\"Storyboard segue00002\" width=\"599\" height=\"427\" border=\"0\" \/><\/a><\/p>\n<p>\u547c\u3073\u51fa\u3057\u3082\u3068\u753b\u9762\u7528\u306b\u3001FirstViewController\u3001\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u753b\u9762\u7528\u306bSecondViewController\u3000\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00009.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00009.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00009.png\" alt=\"Storyboard segue00009\" width=\"599\" height=\"428\" border=\"0\" \/><\/a><\/p>\n<p>\u8ffd\u52a0\u3055\u308c\u305f\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00010.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00010.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00010.png\" alt=\"Storyboard segue00010\" width=\"746\" height=\"337\" border=\"0\" \/><\/a><\/p>\n<p>\u547c\u3073\u51fa\u3057\u5143\u753b\u9762\u4e0a\u90e8\u306e\u3001\u9752\u3044\u30a2\u30a4\u30b3\u30f3\u3092\u9078\u629e\u3001Identity Inspector \u306e Custom Class \u3067\u3001\u4e0a\u8a18\u3067\u4f5c\u6210\u3057\u305f\u3001FirstViewController\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00011.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00011.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00011.png\" alt=\"Storyboard segue00011\" width=\"698\" height=\"300\" border=\"0\" \/><\/a><\/p>\n<p>\u547c\u3073\u51fa\u3057\u3055\u304d\u753b\u9762(\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7)\u753b\u9762\u4e0a\u90e8\u306e\u9752\u3044\u30a2\u30a4\u30b3\u30f3\u3092\u9078\u629e\u3001\u3053\u3061\u3089\u3082Identity Inspector \u306eCustom Class \u3067\u4e0a\u8a18\u3067\u8ffd\u52a0\u3057\u305fSecondViewController\u3092\u6307\u5b9a\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00005.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00005.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00005.png\" alt=\"Storyboard segue00005\" width=\"599\" height=\"392\" border=\"0\" \/><\/a><\/p>\n<h2>3.\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u8ffd\u52a0<\/h2>\n<p>\u547c\u3073\u51fa\u3057\u5143\u753b\u9762\u306b\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c9\u30ed\u30c3\u30d7<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00006.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00006.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00006.png\" alt=\"Storyboard segue00006\" width=\"524\" height=\"300\" border=\"0\" \/><\/a><\/p>\n<p>\u547c\u3073\u51fa\u3057\u5148\u753b\u9762\u306b\u3001\u30e9\u30d9\u30eb\u3092\u30c9\u30ed\u30c3\u30d7<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00007.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00007.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00007.png\" alt=\"Storyboard segue00007\" width=\"523\" height=\"305\" border=\"0\" \/><\/a><\/p>\n<p>\u30e9\u30d9\u30eb\u306e\u753b\u9762\u5236\u7d04(Add New Constraints)\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00008.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00008.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00008.png\" alt=\"Storyboard segue00008\" width=\"541\" height=\"480\" border=\"0\" \/><\/a><\/p>\n<h2>4.<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2022\/03\/08\/xamarin_mac_app_storyboard\/\">Outlet<\/a>\u306e\u8ffd\u52a0<\/h2>\n<p>\u8ffd\u52a0\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092Control\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u306a\u304c\u3089\u3001FirstViewController\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u30c9\u30ed\u30c3\u30d7\u3059\u308b\u3001<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00013.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00013.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00013.png\" alt=\"Storyboard segue00013\" width=\"673\" height=\"346\" border=\"0\" \/><\/a><\/p>\n<p>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2022\/03\/08\/xamarin_mac_app_storyboard\/\">Outlet<\/a>\u306b\u540d\u524d\u3092\u3064\u3051\u3001Connect<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"storyboard_segue00014.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00014.png\" alt=\"Storyboard segue00014\" width=\"598\" height=\"247\" border=\"0\" \/><\/p>\n<p>\u540c\u69d8\u306b\u3001\u30e9\u30d9\u30eb\u3092Cntrol\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u306a\u304c\u3089\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u30c9\u30ed\u30c3\u30d7<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00015.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00015.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00015.png\" alt=\"Storyboard segue00015\" width=\"598\" height=\"304\" border=\"0\" \/><\/a><\/p>\n<p>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc\u3067\u3001<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2022\/03\/08\/xamarin_mac_app_storyboard\/\">Outlet<\/a>\u306b\u540d\u524d\u3092\u3064\u3051\u308b<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00016.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00016.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00016.png\" alt=\"Storyboard segue00016\" width=\"453\" height=\"260\" border=\"0\" \/><\/a><\/p>\n<h2>5.Segue(\u30bb\u30b0\u30a8)\u306e\u8ffd\u52a0<\/h2>\n<p>\u547c\u3073\u51fa\u3057\u5143\u753b\u9762\u304b\u3089\u547c\u3073\u51fa\u3057\u5148\u753b\u9762\u306b\u4f38\u3073\u308b\u77e2\u5370\u3001\u3053\u308c\u304cSegue(\u30bb\u30b0\u30a8)\uff1f\u3092\u9078\u629e\u3057\u3066\u3001Attributes Inspector \u306e Identifier \u3067\u540d\u524d\u3092\u3064\u3051\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00017.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00017.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00017.png\" alt=\"Storyboard segue00017\" width=\"600\" height=\"352\" border=\"0\" \/><\/a><\/p>\n<p>\u547c\u3073\u51fa\u3057\u5143\u753b\u9762\u306b\u3066\u3001prepare\u3000\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00018.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"storyboard_segue00018.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2022\/03\/storyboard_segue00018.png\" alt=\"Storyboard segue00018\" width=\"599\" height=\"214\" border=\"0\" \/><\/a><\/p>\n<h2>6.\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0<\/h2>\n<p>\u3088\u3046\u3084\u304f\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u51fa\u3066\u304d\u305f\u3002<\/p>\n<p>prepare \u30e1\u30bd\u30c3\u30c9\u306b\u3066\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u30bb\u30b0\u30a8\u306e\u30c7\u30b9\u30c6\u30a3\u30cd\u30fc\u30b7\u30e7\u30f3\u306e\u5024\u306b\u8a2d\u5b9a<\/p>\n<pre class=\"prettyprint\">import Cocoa\n\nclass FirstViewController: NSViewController {\n\n    @IBOutlet weak var nameFiled: NSTextField!\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \/\/ Do view setup here.\n    }\n    \n    override func prepare(for segue: NSStoryboardSegue, sender: Any?) {\n        if segue.identifier == \"DetailSegue\" {\n            (segue.destinationController as! NSViewController).representedObject = nameFiled.stringValue\n        }\n    }\n}<\/pre>\n<p>}<\/p>\n<p>\u547c\u3073\u51fa\u3057\u5148\u306eView\u30ed\u30fc\u30c9\u3067\u3001\u547c\u3073\u51fa\u3057\u5143\u753b\u9762\u3067\u8a2d\u5b9a\u3055\u308c\u305f\u5024\u3092\u53d6\u308a\u51fa\u3057\u3001\u30e9\u30d9\u30eb\u306b\u8a2d\u5b9a<\/p>\n<pre class=\"prettyprint\">import Cocoa\n\nclass SecondViewController: NSViewController {\n\n    @IBOutlet weak var nameLabel: NSTextField!\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \/\/ Do view setup here.\n        nameLabel.stringValue = representedObject as! String\n    }\n}<\/pre>\n<p>\u3053\u308c\u3067\u3001\u5b9f\u884c\u3059\u308b\u3068\u3001\u672c\u8a18\u4e8b\u306e\u5148\u982d\u306e\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u305f\uff01\u3081\u3067\u305f\u3057\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>storyboard \u3092\u4f7f\u7528\u3057\u3066\u753b\u9762\u9077\u79fb\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u5f15\u304d\u7d9a\u304d\u4ee5\u4e0b\u306e\u52d5\u753b\u3092\u53c2\u8003\u306b\u3001\u9077\u79fb\u5143\u753b\u9762\u304b\u3089\u5148\u753b\u9762\u3078\u5024\u3092\u53d7\u3051\u308f\u305f\u3059\u3002 (135) AppleProgramming &#8211; YouTube 1.\u3067\u304d\u3042\u304c\u308a\u753b\u9762  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1470,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[170,127,126],"tags":[169,172,171,130,129],"class_list":["post-1471","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cocoa","category-swift","category-xcode","tag-cocoa","tag-segue","tag-storyboard","tag-swift","tag-xcode"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1471"}],"version-history":[{"count":3,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1471\/revisions"}],"predecessor-version":[{"id":1475,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1471\/revisions\/1475"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media\/1470"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}