{"id":1895,"date":"2011-09-20T21:40:06","date_gmt":"2011-09-20T19:40:06","guid":{"rendered":"http:\/\/www.iprog.it\/blog\/?p=1895"},"modified":"2012-04-30T18:36:37","modified_gmt":"2012-04-30T17:36:37","slug":"xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore","status":"publish","type":"post","link":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/","title":{"rendered":"Xcode Tip #1 &#8211; Impostare un SegmentedControl come quello dell&#8217;AppStore"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" title=\"appstore_categorie.png\" src=\"http:\/\/www.iprog.it\/blog\/wp-content\/uploads\/2011\/09\/appstore_categorie.png\" alt=\"appstore catogorie\" width=\"320\" height=\"480\" border=\"0\" \/><\/p>\n<p>Oggi andiamo ad inaugurare una nuova rubrica che spero sia ben accettata dagli utenti che desiderano conoscere tutti i trucchetti e le chicche presenti in Xcode per una migliore, e pi\u00f9 professionale programmazione di iOS e Mac OS.<\/p>\n<h3>UISegmentControl classico<\/h3>\n<p>Un segment control mostra una <strong>lista<\/strong> <strong>di<\/strong> <strong>opzioni<\/strong> tra cui l&#8217;utente pu\u00f2 scegliere. Ogni &#8220;segmento&#8221; ha l&#8217;aspetto di un pulsante, che rimane &#8220;premuto&#8221; persino dopo che l&#8217;utente ha tolto il dito.<\/p>\n<p>Se configuriamo l&#8217;UISegmentedControl attraverso <em>interface builder <\/em>possiamo notare che abbiamo una scelta limitata di stili da poter usare, che sono esattamente quelli riportati dalla documentazione Apple ufficiale:<\/p>\n<p>[code lang=&#8221;obj-c&#8221;]typedef enum {<br \/>\n   UISegmentedControlStylePlain,<br \/>\n   UISegmentedControlStyleBordered,<br \/>\n   UISegmentedControlStyleBar,<br \/>\n   UISegmentedControlStyleBezeled,<br \/>\n} UISegmentedControlStyle;[\/code]<\/p>\n<p>Se invece vogliamo inserire il componente che fosse uguale a quello presente nell&#8217;applicazione App Store dobbiamo lavorare nel codice, ci baster\u00e0 infatti inserire il valore 7 nella propriet\u00e0 segmentedControlStyle e si ottiene proprio il risultato desiderato.<\/p>\n<p>[code lang=&#8221;obj-c&#8221;]nomeSegmento.segmentedControlStyle = 7;[\/code]<\/p>\n<p>Spero vi possa essere utile questo trucchetto, ricordatevi per\u00f2 che si tratta di una funzione non documentata, quindi potrebbe causare un rifiuto della vostra applicazione!<\/p>\n<p>[Fonte: <a href=\"http:\/\/stackoverflow.com\/questions\/3172794\/scope-bar-for-uitableview-like-app-store\/3172818#3172818\">StackOverflow<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oggi andiamo ad inaugurare una nuova rubrica che spero sia ben accettata dagli utenti che desiderano conoscere tutti i trucchetti e le chicche presenti in Xcode per una migliore, e pi\u00f9 professionale programmazione di iOS e Mac OS. UISegmentControl classico Un segment control mostra una lista di opzioni tra cui&#8230; <a href=\"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":5,"featured_media":1897,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[920],"tags":[921,28,1219,1319,1318,859],"class_list":["post-1895","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-xcode-tiptricks","tag-appstore","tag-ios","tag-rubrica","tag-trucchetti","tag-utenti","tag-xcode"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Xcode Tip #1 - Impostare un SegmentedControl come quello dell&#039;AppStore - iProg<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Xcode Tip #1 - Impostare un SegmentedControl come quello dell&#039;AppStore - iProg\" \/>\n<meta name=\"twitter:description\" content=\"Oggi andiamo ad inaugurare una nuova rubrica che spero sia ben accettata dagli utenti che desiderano conoscere tutti i trucchetti e le chicche presenti in Xcode per una migliore, e pi\u00f9 professionale programmazione di iOS e Mac OS. UISegmentControl classico Un segment control mostra una lista di opzioni tra cui... Read more &raquo;\" \/>\n<meta name=\"twitter:creator\" content=\"@iprogblog\" \/>\n<meta name=\"twitter:site\" content=\"@iprogblog\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fabio\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/\"},\"author\":{\"name\":\"Fabio\",\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/#\\\/schema\\\/person\\\/5f7d1474b2b5e8fe635f84906efc8c51\"},\"headline\":\"Xcode Tip #1 &#8211; Impostare un SegmentedControl come quello dell&#8217;AppStore\",\"datePublished\":\"2011-09-20T19:40:06+00:00\",\"dateModified\":\"2012-04-30T17:36:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/\"},\"wordCount\":192,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/#primaryimage\"},\"thumbnailUrl\":\"\",\"keywords\":[\"appstore\",\"ios\",\"Rubrica\",\"trucchetti\",\"utenti\",\"xcode\"],\"articleSection\":[\"Xcode Tip&amp;Tricks\"],\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/\",\"url\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/\",\"name\":\"Xcode Tip #1 - Impostare un SegmentedControl come quello dell'AppStore - iProg\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2011-09-20T19:40:06+00:00\",\"dateModified\":\"2012-04-30T17:36:37+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/#\\\/schema\\\/person\\\/5f7d1474b2b5e8fe635f84906efc8c51\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/xcode-tiptricks\\\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\\\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/\",\"name\":\"iProg\",\"description\":\"perch\u00e9 reinventare la ruota?\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/#\\\/schema\\\/person\\\/5f7d1474b2b5e8fe635f84906efc8c51\",\"name\":\"Fabio\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/03f928dca7330002301d292e5dc1b2fca35722d24a0628eaf129fd52acfc0a99?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/03f928dca7330002301d292e5dc1b2fca35722d24a0628eaf129fd52acfc0a99?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/03f928dca7330002301d292e5dc1b2fca35722d24a0628eaf129fd52acfc0a99?s=96&r=g\",\"caption\":\"Fabio\"},\"description\":\"Esperienza nella progettazione e sviluppo di Applicazioni mobili. Integro le conoscenze acquisite in ambito accademico con un continuo studio di nuove tecnologie che mi permettano di creare applicazioni sempre pi\u00f9 affidabili sicure ed efficienti. Venite a trovarmi sul blog Fabiosoft Google+\",\"sameAs\":[\"http:\\\/\\\/www.fabiosoft.com\",\"https:\\\/\\\/www.facebook.com\\\/devfabionisci\\\/\",\"http:\\\/\\\/it.linkedin.com\\\/in\\\/fabionisci\"],\"url\":\"https:\\\/\\\/www.iprog.it\\\/blog\\\/author\\\/fabiosoft\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Xcode Tip #1 - Impostare un SegmentedControl come quello dell'AppStore - iProg","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/","twitter_card":"summary_large_image","twitter_title":"Xcode Tip #1 - Impostare un SegmentedControl come quello dell'AppStore - iProg","twitter_description":"Oggi andiamo ad inaugurare una nuova rubrica che spero sia ben accettata dagli utenti che desiderano conoscere tutti i trucchetti e le chicche presenti in Xcode per una migliore, e pi\u00f9 professionale programmazione di iOS e Mac OS. UISegmentControl classico Un segment control mostra una lista di opzioni tra cui... Read more &raquo;","twitter_creator":"@iprogblog","twitter_site":"@iprogblog","twitter_misc":{"Scritto da":"Fabio","Tempo di lettura stimato":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/#article","isPartOf":{"@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/"},"author":{"name":"Fabio","@id":"https:\/\/www.iprog.it\/blog\/#\/schema\/person\/5f7d1474b2b5e8fe635f84906efc8c51"},"headline":"Xcode Tip #1 &#8211; Impostare un SegmentedControl come quello dell&#8217;AppStore","datePublished":"2011-09-20T19:40:06+00:00","dateModified":"2012-04-30T17:36:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/"},"wordCount":192,"commentCount":0,"image":{"@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/#primaryimage"},"thumbnailUrl":"","keywords":["appstore","ios","Rubrica","trucchetti","utenti","xcode"],"articleSection":["Xcode Tip&amp;Tricks"],"inLanguage":"it-IT","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/","url":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/","name":"Xcode Tip #1 - Impostare un SegmentedControl come quello dell'AppStore - iProg","isPartOf":{"@id":"https:\/\/www.iprog.it\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/#primaryimage"},"image":{"@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/#primaryimage"},"thumbnailUrl":"","datePublished":"2011-09-20T19:40:06+00:00","dateModified":"2012-04-30T17:36:37+00:00","author":{"@id":"https:\/\/www.iprog.it\/blog\/#\/schema\/person\/5f7d1474b2b5e8fe635f84906efc8c51"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.iprog.it\/blog\/xcode-tiptricks\/xcode-tip-1-impostare-un-segmentedcontrol-come-quello-dellappstore\/#primaryimage","url":"","contentUrl":""},{"@type":"WebSite","@id":"https:\/\/www.iprog.it\/blog\/#website","url":"https:\/\/www.iprog.it\/blog\/","name":"iProg","description":"perch\u00e9 reinventare la ruota?","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.iprog.it\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Person","@id":"https:\/\/www.iprog.it\/blog\/#\/schema\/person\/5f7d1474b2b5e8fe635f84906efc8c51","name":"Fabio","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/secure.gravatar.com\/avatar\/03f928dca7330002301d292e5dc1b2fca35722d24a0628eaf129fd52acfc0a99?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/03f928dca7330002301d292e5dc1b2fca35722d24a0628eaf129fd52acfc0a99?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/03f928dca7330002301d292e5dc1b2fca35722d24a0628eaf129fd52acfc0a99?s=96&r=g","caption":"Fabio"},"description":"Esperienza nella progettazione e sviluppo di Applicazioni mobili. Integro le conoscenze acquisite in ambito accademico con un continuo studio di nuove tecnologie che mi permettano di creare applicazioni sempre pi\u00f9 affidabili sicure ed efficienti. Venite a trovarmi sul blog Fabiosoft Google+","sameAs":["http:\/\/www.fabiosoft.com","https:\/\/www.facebook.com\/devfabionisci\/","http:\/\/it.linkedin.com\/in\/fabionisci"],"url":"https:\/\/www.iprog.it\/blog\/author\/fabiosoft\/"}]}},"views":2163,"_links":{"self":[{"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/posts\/1895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/comments?post=1895"}],"version-history":[{"count":0,"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/posts\/1895\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/media\/1897"}],"wp:attachment":[{"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/media?parent=1895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/categories?post=1895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iprog.it\/blog\/wp-json\/wp\/v2\/tags?post=1895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}