{"id":198792,"date":"2013-10-24T16:16:02","date_gmt":"2013-10-24T12:16:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=198792"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=198792","title":{"rendered":"<span class=\"post_title\">Blur \u0432 iOS7<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0421 7-\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 iOS \u043c\u043d\u043e\u0433\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b UI \u0441\u0442\u0430\u043b\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 (\u0441\u043c. <a href=\"https:\/\/www.google.com\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=2&amp;ved=0CD8QFjAB&amp;url=http%3A%2F%2Fdevstreaming.apple.com%2Fvideos%2Fwwdc%2F2013%2F226xbx5xinmlvbdabxux9k3kt%2F226%2F226.pdf&amp;ei=NS1oUvOLOaWu4ASM34GwDA&amp;usg=AFQjCNFoAqrc8iGAJ8h1OAYMplaEe_cW4w&amp;sig2=qG01J03tADQbPb9DWIHUeg&amp;bvm=bv.55123115,d.bGE&amp;cad=rja\">Session 226, Implementing Engaging UI on iOS<\/a>). <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u043e\u0432\u0435\u0440\u044b, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0431\u0430\u0440\u043e\u0432 \u0438 \u0430\u043b\u0435\u0440\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043c\u044b\u0442\u044b\u0439 \u0444\u043e\u043d. <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/191\/e4d\/65c\/191e4d65c4dce671f4cc47c30e49989f.png\"\/><\/p>\n<p>  \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043b\u044e\u0440 \u0432 \u0441\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h1>\u0411\u043b\u044e\u0440 \u0431\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0439<\/h1>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u0431\u043b\u044e\u0440\u0430: \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439. \u041a\u0430\u043a \u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/p>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043b\u044e\u0440 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e. \u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0442\u0430\u043a\u0430\u044f: \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u0444\u043e\u043d\u0430 \u0437\u0430 view, (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/graphicsimaging\/reference\/CALayer_class\/Introduction\/Introduction.html#\/\/apple_ref\/occ\/instm\/CALayer\/renderInContext:\">renderInContext<\/a>), \u0440\u0430\u0437\u043c\u044b\u0442\u044c \u0435\u0433\u043e \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430 view. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0431\u043b\u044e\u0440\u0430 \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443. \u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"https:\/\/github.com\/nicklockwood\/FXBlurView\">FXBlurView<\/a>.<\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u043b\u044e\u0441\u043e\u043c 7-\u0438 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0431\u043b\u044e\u0440\u0430, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0438\u0434\u0435\u043e \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0430\u043d\u0435\u043b\u044c \u0441 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u044e\u0440\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043b\u0430\u0433\u043e\u0432. <\/p>\n<p>  \u0418 \u0442\u0430\u043a, \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0431\u043b\u044e\u0440 \u0432 iOS 7.<\/p>\n<h1>\u041a\u0440\u0430\u0436\u0430 \u043b\u0435\u0439\u0435\u0440\u0430.<\/h1>\n<p>  \u0418\u0434\u0435\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430. \u0420\u0430\u0437 \u0443 UIToolbar \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043b\u0435\u0439\u0435\u0440 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430.<\/p>\n<pre><code class=\"objectivec\">UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:[self bounds]]]; [toolbar setBarTintColor:[UIColor greenColor]]; [self.layer insertSublayer:[self.toolbar layer] atIndex:0]; <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0445\u043e\u0434 \u0445\u043e\u0440\u043e\u0448, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442.<br \/>  \u0423\u0436\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/github.com\/JagCesar\/iOS-blur?source=cc\">iOS-blur<\/a> (\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437 CocoaPods).<\/p>\n<h1>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 drawViewHierarchyInRect:afterScreenUpdates<\/h1>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u0432\u043e\u0440\u043e\u0442\u0438\u0442\u044c \u0445\u0438\u0442\u0440\u044b\u0439 \u0431\u043b\u044e\u0440, \u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u0438\u043c \u0431\u0440\u0430\u0442\u044c \u0444\u043e\u043d \u0438 \u0440\u0430\u0437\u043c\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<br \/>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0432 iOS 7 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043d\u0438\u043c\u043a\u043e\u0432 view <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/uikit\/reference\/uiview_class\/UIView\/UIView.html#\/\/apple_ref\/occ\/instm\/UIView\/drawViewHierarchyInRect:afterScreenUpdates:\">drawViewHierarchyInRect:afterScreenUpdates<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/8e9\/14a\/291\/8e914a291a3d96d27f04d505cc7ba123.png\"\/><br \/>  \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0438\u0437 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043d\u0438\u043c\u043a\u0430 view \u0432\u043e\u0437\u0440\u043e\u0441\u043b\u0430 \u0432 15 \u0440\u0430\u0437!<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e (<a href=\"https:\/\/github.com\/muukii0803\/iOS7-Blur\">\u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/a>)<\/p>\n<pre><code class=\"objectivec\">-(UIImage *)blurredSnapshot {     UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, self.window.screen.scale);     [self drawViewHierarchyInRect:self.frame afterScreenUpdates:NO];     UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext();     UIImage *blurredSnapshotImage = [snapshotImage applyLightEffect];     UIGraphicsEndImageContext();     return blurredSnapshotImage; } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0431\u043b\u044e\u0440\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"https:\/\/github.com\/justinmfischer\/7blur\">7blur<\/a>.<\/p>\n<h1>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  \u0411\u043b\u044e\u0440 \u043d\u0430 iOS7 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c. \u0422\u0430\u043a \u0447\u0442\u043e, \u0441\u043c\u0435\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u043d\u0435 \u0431\u043e\u044f\u0441\u044c \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/e-Legion\/blog\/198792\/\"> http:\/\/habrahabr.ru\/company\/e-Legion\/blog\/198792\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0421 7-\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 iOS \u043c\u043d\u043e\u0433\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b UI \u0441\u0442\u0430\u043b\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 (\u0441\u043c. <a href=\"https:\/\/www.google.com\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=2&amp;ved=0CD8QFjAB&amp;url=http%3A%2F%2Fdevstreaming.apple.com%2Fvideos%2Fwwdc%2F2013%2F226xbx5xinmlvbdabxux9k3kt%2F226%2F226.pdf&amp;ei=NS1oUvOLOaWu4ASM34GwDA&amp;usg=AFQjCNFoAqrc8iGAJ8h1OAYMplaEe_cW4w&amp;sig2=qG01J03tADQbPb9DWIHUeg&amp;bvm=bv.55123115,d.bGE&amp;cad=rja\">Session 226, Implementing Engaging UI on iOS<\/a>). <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u043e\u0432\u0435\u0440\u044b, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0431\u0430\u0440\u043e\u0432 \u0438 \u0430\u043b\u0435\u0440\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043c\u044b\u0442\u044b\u0439 \u0444\u043e\u043d. <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/191\/e4d\/65c\/191e4d65c4dce671f4cc47c30e49989f.png\"\/><\/p>\n<p>  \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043b\u044e\u0440 \u0432 \u0441\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-198792","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198792"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198792\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}