{"id":2258,"date":"2020-12-07T10:30:00","date_gmt":"2020-12-07T09:30:00","guid":{"rendered":"https:\/\/www.albertopasca.it\/whiletrue\/?p=2258"},"modified":"2023-06-26T15:48:22","modified_gmt":"2023-06-26T13:48:22","slug":"swift-uiview-gradient-extension","status":"publish","type":"post","link":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/","title":{"rendered":"Swift &#8211; UIView gradient extension"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Sometimes can be useful to add a gradient on a <strong>UIView.<\/strong> This simple <em>UIView extension<\/em> helps you &#8220;coloryze&#8221; your screen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51-552x1024.png?resize=318%2C590&#038;ssl=1\" alt=\"\" class=\"wp-image-2744\" width=\"318\" height=\"590\" srcset=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51.png?resize=552%2C1024&amp;ssl=1 552w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51.png?resize=162%2C300&amp;ssl=1 162w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51.png?resize=768%2C1425&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51.png?resize=828%2C1536&amp;ssl=1 828w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51.png?w=1090&amp;ssl=1 1090w\" sizes=\"auto, (max-width: 318px) 100vw, 318px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let see how to use and how is implemented.<\/p>\n\n\n\n<!--more-->\n\n\n\n<hr class=\"wp-block-separator has-text-color has-vivid-green-cyan-color has-css-opacity has-vivid-green-cyan-background-color has-background\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"swift\" class=\"language-swift\">import UIKit\nclass ViewController: UIViewController {\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        self.view.applyGradient( colors: [\n            UIColor.systemRed,\n            UIColor.systemGreen,\n            UIColor.systemBlue\n        ], locations: [0.0, 0.8, 1.0])\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The result of the code snippet above is shown in the screenshot on top.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We have three colors, &#8220;<strong>red<\/strong>&#8220;, &#8220;<strong>green<\/strong>&#8221; and &#8220;<strong>blue<\/strong>&#8221; as gradient, positioned starting from <strong>0.0<\/strong> (red) to <strong>0.8<\/strong> (green) to <strong>1.0<\/strong> (blue).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why between 0.0 and 1.0?<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">The gradient stops are specified as values between&nbsp;<code>0<\/code>&nbsp;and&nbsp;<code>1<\/code>. The values must be monotonically increasing. If&nbsp;<code>nil<\/code>, the stops are spread uniformly across the range. Defaults to&nbsp;<code>nil<\/code>.<\/p>\n<cite>https:\/\/developer.apple.com\/documentation\/quartzcore\/cagradientlayer\/1462410-locations?changes=_9<\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The location is calculated in a range from 0 and 1. All doubles inside are considered valid.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">UIView Extension<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The extension take as parameter an array of <strong>UIColors<\/strong> and optionally an array of <strong>NSNumber?<\/strong> that are the locations explained above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If locations are <strong>null<\/strong>, the locations are automatically divided in equal parts, like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"swift\" class=\"language-swift\">self.view.applyGradient( colors: [\n    UIColor.systemRed,\n    UIColor.systemGreen,\n    UIColor.systemBlue\n], locations: nil)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.48.18-552x1024.png?resize=219%2C406&#038;ssl=1\" alt=\"\" class=\"wp-image-2749\" width=\"219\" height=\"406\" srcset=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.48.18.png?resize=552%2C1024&amp;ssl=1 552w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.48.18.png?resize=162%2C300&amp;ssl=1 162w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.48.18.png?resize=768%2C1425&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.48.18.png?resize=828%2C1536&amp;ssl=1 828w, https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.48.18.png?w=1090&amp;ssl=1 1090w\" sizes=\"auto, (max-width: 219px) 100vw, 219px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-vivid-green-cyan-color has-css-opacity has-vivid-green-cyan-background-color has-background\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Add in your code this <strong>UIView extension<\/strong> and the game is done:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"swift\" class=\"language-swift\">extension UIView {\n    func applyGradient( colors: [UIColor], locations: [NSNumber]? ) {\n        assert(colors.count &gt;= 2, \"Colors must be at least 2.\")\n        if locations != nil {\n            assert(colors.count == locations?.count, \"Locations must have the same size of color array.\")\n        }\n        let gradient = CAGradientLayer()\n        gradient.colors = colors.map { $0.cgColor }\n        gradient.locations = locations\n        gradient.frame = self.bounds\n        self.layer.insertSublayer(gradient, at: 0)\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Have fun.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes can be useful to add a gradient on a UIView. This simple UIView extension helps you &#8220;coloryze&#8221; your screen. Let see how to use and how is implemented.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[966,968,197,967,602,46,252],"class_list":["post-2258","post","type-post","status-publish","format-standard","hentry","category-generic","tag-cagradientlayer","tag-cgcolor","tag-color","tag-gradient","tag-map","tag-swift","tag-uiview"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swift - UIView gradient extension - while (true) {\u00a0}<\/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.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift - UIView gradient extension - while (true) {\u00a0}\" \/>\n<meta property=\"og:description\" content=\"Sometimes can be useful to add a gradient on a UIView. This simple UIView extension helps you &#8220;coloryze&#8221; your screen. Let see how to use and how is implemented.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/\" \/>\n<meta property=\"og:site_name\" content=\"while (true) {\u00a0}\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-07T09:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-26T13:48:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51-552x1024.png\" \/>\n<meta name=\"author\" content=\"Alberto Pasca\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@lupasca\" \/>\n<meta name=\"twitter:site\" content=\"@lupasca\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alberto Pasca\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/\"},\"author\":{\"name\":\"Alberto Pasca\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\"},\"headline\":\"Swift &#8211; UIView gradient extension\",\"datePublished\":\"2020-12-07T09:30:00+00:00\",\"dateModified\":\"2023-06-26T13:48:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/\"},\"wordCount\":175,\"publisher\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\"},\"image\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Schermata-2020-10-13-alle-15.34.51-552x1024.png\",\"keywords\":[\"CAGradientLayer\",\"cgcolor\",\"color\",\"gradient\",\"map\",\"swift\",\"uiview\"],\"articleSection\":[\"generic\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/\",\"url\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/\",\"name\":\"Swift - UIView gradient extension - while (true) {\u00a0}\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Schermata-2020-10-13-alle-15.34.51-552x1024.png\",\"datePublished\":\"2020-12-07T09:30:00+00:00\",\"dateModified\":\"2023-06-26T13:48:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Schermata-2020-10-13-alle-15.34.51-552x1024.png\",\"contentUrl\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Schermata-2020-10-13-alle-15.34.51-552x1024.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/swift-uiview-gradient-extension\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Swift &#8211; UIView gradient extension\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#website\",\"url\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/\",\"name\":\"while (true) {\u00a0}\",\"description\":\"notes from a developer, tutorials, how-to, ideas\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\",\"name\":\"Alberto Pasca\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\",\"caption\":\"Alberto Pasca\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\"},\"description\":\"Software engineer @ Pirelli &amp; C. S.p.A. with a strong passion for mobile \uf8ff development, security, and connected things.\",\"sameAs\":[\"https:\\\/\\\/www.albertopasca.it\",\"albertopasca\",\"https:\\\/\\\/x.com\\\/lupasca\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swift - UIView gradient extension - while (true) {\u00a0}","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.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/","og_locale":"en_US","og_type":"article","og_title":"Swift - UIView gradient extension - while (true) {\u00a0}","og_description":"Sometimes can be useful to add a gradient on a UIView. This simple UIView extension helps you &#8220;coloryze&#8221; your screen. Let see how to use and how is implemented.","og_url":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/","og_site_name":"while (true) {\u00a0}","article_published_time":"2020-12-07T09:30:00+00:00","article_modified_time":"2023-06-26T13:48:22+00:00","og_image":[{"url":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51-552x1024.png","type":"","width":"","height":""}],"author":"Alberto Pasca","twitter_card":"summary_large_image","twitter_creator":"@lupasca","twitter_site":"@lupasca","twitter_misc":{"Written by":"Alberto Pasca","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/#article","isPartOf":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/"},"author":{"name":"Alberto Pasca","@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac"},"headline":"Swift &#8211; UIView gradient extension","datePublished":"2020-12-07T09:30:00+00:00","dateModified":"2023-06-26T13:48:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/"},"wordCount":175,"publisher":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac"},"image":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/#primaryimage"},"thumbnailUrl":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51-552x1024.png","keywords":["CAGradientLayer","cgcolor","color","gradient","map","swift","uiview"],"articleSection":["generic"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/","url":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/","name":"Swift - UIView gradient extension - while (true) {\u00a0}","isPartOf":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/#primaryimage"},"image":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/#primaryimage"},"thumbnailUrl":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51-552x1024.png","datePublished":"2020-12-07T09:30:00+00:00","dateModified":"2023-06-26T13:48:22+00:00","breadcrumb":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/#primaryimage","url":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51-552x1024.png","contentUrl":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2020\/10\/Schermata-2020-10-13-alle-15.34.51-552x1024.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.albertopasca.it\/whiletrue\/swift-uiview-gradient-extension\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.albertopasca.it\/whiletrue\/"},{"@type":"ListItem","position":2,"name":"Swift &#8211; UIView gradient extension"}]},{"@type":"WebSite","@id":"https:\/\/www.albertopasca.it\/whiletrue\/#website","url":"https:\/\/www.albertopasca.it\/whiletrue\/","name":"while (true) {\u00a0}","description":"notes from a developer, tutorials, how-to, ideas","publisher":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.albertopasca.it\/whiletrue\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac","name":"Alberto Pasca","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g","caption":"Alberto Pasca"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g"},"description":"Software engineer @ Pirelli &amp; C. S.p.A. with a strong passion for mobile \uf8ff development, security, and connected things.","sameAs":["https:\/\/www.albertopasca.it","albertopasca","https:\/\/x.com\/lupasca"]}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts\/2258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/comments?post=2258"}],"version-history":[{"count":14,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts\/2258\/revisions"}],"predecessor-version":[{"id":3377,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts\/2258\/revisions\/3377"}],"wp:attachment":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/media?parent=2258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/categories?post=2258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/tags?post=2258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}