{"id":622,"date":"2015-08-01T17:01:33","date_gmt":"2015-08-01T17:01:33","guid":{"rendered":"http:\/\/phyline.com\/blog\/?p=622"},"modified":"2016-02-28T11:56:39","modified_gmt":"2016-02-28T11:56:39","slug":"setting-shadows-button-in-swift","status":"publish","type":"post","link":"http:\/\/sophyonline.com\/blog\/2015\/08\/setting-shadows-button-in-swift\/","title":{"rendered":"Configurar la sombra de un UIButton en Swift"},"content":{"rendered":"<p><a href=\"http:\/\/sophyonline.com\/blog\/wp-content\/uploads\/2015\/08\/swift-e1456593526993.png\" rel=\"attachment wp-att-685\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-685\" src=\"http:\/\/sophyonline.com\/blog\/wp-content\/uploads\/2015\/08\/swift-e1456593526993.png\" alt=\"swift\" width=\"900\" height=\"230\" \/><\/a><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\">No es nada complicado, ni muy diferente de Objective-c \u00a0realizar el sombreado de un bot\u00f3n en Swift. Solo hay que tener en cuenta el offset y radio de la sombra para que quede chulito. Tambi\u00e9n podr\u00e1s sustituir por cualquier otro objeto que permita aplicar sombra a s\u00ed mismo en el par\u00e1metro.<\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/cloud.githubusercontent.com\/assets\/724536\/8717600\/475e1f5e-2b9d-11e5-9828-1d1678dd8b41.png\" alt=\"\" width=\"110\" height=\"112\" \/><\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\"><!--more--><\/span><\/p>\n<pre lang=\"swift\"><span style=\"font-family: helvetica, arial, sans-serif;\"> \r\n func setShadowButton(button: UIButton){\r\n    button.layer.shadowColor = UIColor.blackColor().CGColor\r\n    button.layer.shadowOffset = CGSizeMake(0.0, 2.0)\r\n    button.layer.masksToBounds = false\r\n    button.layer.shadowRadius = 1.0\r\n    button.layer.shadowOpacity = 0.5\r\n  }<\/span><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>No es nada complicado, ni muy diferente de Objective-c \u00a0realizar el sombreado de un bot\u00f3n en Swift. Solo hay que tener en cuenta el offset y radio de la sombra para que quede chulito. Tambi\u00e9n podr\u00e1s sustituir por cualquier otro objeto que permita aplicar sombra a s\u00ed mismo en el par\u00e1metro.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-622","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts\/622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/comments?post=622"}],"version-history":[{"count":15,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts\/622\/revisions"}],"predecessor-version":[{"id":840,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts\/622\/revisions\/840"}],"wp:attachment":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/media?parent=622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/categories?post=622"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/tags?post=622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}