{"id":283231,"date":"2016-12-29T12:25:03","date_gmt":"2016-12-29T09:25:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283231"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283231","title":{"rendered":"\u0410\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u041b\u0438\u043d\u0438\u0438 \u0432 iOS"},"content":{"rendered":"<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438 \u0438\u043c \u0441\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435! \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0432\u044c\u044e\u0445 \u043d\u0430 iOS. \u0414\u0443\u043c\u0430\u044e, \u043a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043c\u0435\u043b\u044c\u043a\u043e\u043c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 CALayer \u0438 Core Animation \u0432\u043e\u043e\u0431\u0449\u0435, \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445, \u0430 \u0432\u043e\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0435\u0442 \u043d\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e Core Animation.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u0442\u0440\u0430\u0432\u043a\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/efd\/89e\/a17\/efd89ea17eac4e948f98f827eb2cc1a2.gif\" \/><\/div>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u0447\u0438\u0442\u0430\u0442\u044c, \u0430 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u2014 <a href=\"https:\/\/github.com\/DimasSup\/AnimatedLines\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/a>. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0436\u0435 \u2014 \u041d\u0430\u0447\u043d\u0435\u043c!<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 Single View Application. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 View Controller \u043d\u043e\u0432\u0443\u044e View.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/786\/79e\/795\/78679e79509344129cdc5402482a1501.jpeg\"\/>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c Referencing Outlet \u0441 \u0438\u043c\u0435\u043d\u0435\u043c &#8216;panel&#8217; \u0432 \u043a\u043b\u0430\u0441\u0441 ViewController. \u0412 viewDidLoad ViewController&#8217;\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"objectivec\">_panel.layer.cornerRadius = 5;<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043a\u0440\u0443\u0433\u043b\u0438\u0442\u044c \u0443\u0433\u043b\u044b \u0443 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u2014 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d82\/80a\/a83\/d8280aa836b74172bc250b090ddd6916.jpeg\" \/><\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0441 Interface Builder \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438. \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u043e \u0440\u0430\u0434\u0438 \u0447\u0435\u0433\u043e \u043c\u044b \u0437\u0434\u0435\u0441\u044c \u2014 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f!<\/p>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043a\u0441\u043a\u0443\u0440\u0441 \u0432 Core Animation. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0432 iOS \u044d\u0442\u043e CALayer, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u2014 \u043a\u0430\u043a \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0412 \u043e\u0431\u0449\u0435\u043c \u044d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 Core Graphics \u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0432 \u0432\u0438\u0434\u0435 UIView. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a CALayer \u2014 CAShapeLayer, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 CGPath, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0442\u043e \u0437\u0430\u043b\u0438\u0432\u043a\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e stroke (\u0447\u0435\u0440\u0442\u0430?).<\/p>\n<p>  \u0418\u0442\u0430\u043a. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0443\u044e \u043a\u043b\u0430\u0441\u0441 UIView \u2014 <i>UIView+AnimatedLines<\/i>. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043e\u0439 \u043e\u0431\u0432\u043e\u0434\u043a\u0438 \u0434\u043b\u044f VIew \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f CAShapeLayer.<\/p>\n<pre><code class=\"objectivec\">-(void)animateLinesWithColor:(CGColorRef)lineColor andLineWidth:(CGFloat)lineWidth animationDuration:(CGFloat)duration { \t }<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c CAShapeLayer:<\/p>\n<pre><code class=\"objectivec\">CAShapeLayer* animateLayer = [CAShapeLayer layer]; \tanimateLayer.lineCap = kCALineCapRound;\/\/ \u041a\u043e\u043d\u0435\u0446 \u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u043b\u0438\u043d\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \tanimateLayer.lineJoin = kCALineJoinBevel;\/\/\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043e\u043a\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0439 \tanimateLayer.fillColor   = [[UIColor clearColor] CGColor];\/\/\u0441\u0430\u043c \u0441\u043b\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \tanimateLayer.lineWidth   = lineWidth; \tanimateLayer.strokeEnd   = 0.0;<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c UIBezierPath, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0432\u043e\u0434\u043a\u0443.<\/p>\n<pre><code class=\"objectivec\">UIBezierPath* path = [UIBezierPath new]; \t[path setLineWidth:1.0]; \t[path setLineCapStyle:kCGLineCapRound]; \t[path setLineJoinStyle:kCGLineJoinRound]; <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044f \u2014 \u0440\u0438\u0441\u0443\u0435\u043c \u043b\u0438\u043d\u0438\u0438 \u0432\u0434\u043e\u043b\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430\u0448\u0435\u0439 \u0432\u044c\u044e\u0448\u043a\u0438 (\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438 \u0431\u0435\u0441\u043f\u043e\u0449\u0430\u0434\u043d\u043e\u0433\u043e): <\/p>\n<pre><code class=\"objectivec\">CGRect bounds = self.layer.bounds;\/\/\u0413\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430\u0448\u0435\u0439 \u0432\u044c\u044e \tCGFloat radius = self.layer.cornerRadius;\/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u0432\u044c\u044e\u0448\u043a\u0438 \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u0440\u0430\u044f \tCGPoint zeroPoint = bounds.origin; \/\/\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \t \tBOOL isRounded = radius&gt;0; \t \tif(isRounded) \t{ \t\tzeroPoint.x = bounds.origin.x+radius; \/\/\u0415\u0441\u0442\u044c \u043a\u0440\u0430\u044f \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0435 -  \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043d\u0435 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u0443\u0433\u043b\u0430, \u0430 \u0441 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0439 \u0443\u0433\u043e\u043b. \t} \t \t[path moveToPoint:zeroPoint];\/\/\u041f\u0435\u0440\u0435\u0434\u0432\u0438\u0433\u0430\u0435\u043c \u043a\u0443\u0440\u0441\u043e\u0440 \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \t\/\/\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c 4 \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c. \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0432\u0435\u0440\u0445\u0443 \tCGPoint nextPoint = CGPointMake(bounds.size.width, 0); \tif(isRounded) \t{ \t\tnextPoint.x-=radius; \t} \t[path addLineToPoint:nextPoint]; \tif(isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x, nextPoint.y+radius) radius:radius startAngle:-M_PI_2 endAngle:0 clockwise:YES];\/\/\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f - \u0440\u0438\u0441\u0443\u0435\u043c \u0434\u0443\u0433\u0443. \t} \t\/\/\u041f\u0440\u0430\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u044c \tnextPoint = CGPointMake(bounds.size.width, bounds.size.height); \tif(isRounded) \t{ \t\tnextPoint.y-=radius; \t} \t[path addLineToPoint:nextPoint]; \tif (isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x-radius, nextPoint.y) radius:radius startAngle:0 endAngle:M_PI_2 clockwise:YES]; \t} \t\/\/\u041d\u0438\u0436\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u044c \tnextPoint = CGPointMake(0, bounds.size.height); \tif(isRounded) \t{ \t\tnextPoint.x +=radius; \t} \t[path addLineToPoint:nextPoint]; \tif (isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x, nextPoint.y-radius) radius:radius startAngle:M_PI_2 endAngle:M_PI clockwise:YES]; \t} \t\/\/\u041b\u0435\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u044c \tnextPoint = CGPointMake(0, 0); \tif(isRounded) \t{ \t\tnextPoint.y +=radius; \t} \t[path addLineToPoint:nextPoint]; \tif (isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x+radius, nextPoint.y) radius:radius startAngle:M_PI endAngle:-M_PI_2 clockwise:YES]; \t}<\/code><\/pre>\n<p>  \u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u043d\u0438\u0439 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Path \u0432 CAShapeLayer:<\/p>\n<pre><code class=\"objectivec\"> animateLayer.path = path.CGPath; animateLayer.strokeColor = lineColor; <\/code><\/pre>\n<p>  \u0410 \u0441\u0430\u043c \u0441\u043b\u043e\u0439 \u043d\u0430 \u043d\u0430\u0448\u0443 \u0432\u044c\u044e:<\/p>\n<pre><code class=\"objectivec\">[self.layer addSublayer:animateLayer];<\/code><\/pre>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u0448\u0438\u0445 \u0442\u0440\u0443\u0434\u043e\u0432, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 ViewController \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code class=\"objectivec\"> _panel.layer.cornerRadius = 5; [_panel animateLinesWithColor:[UIColor redColor].CGColor andLineWidth:2 animationDuration:5]; <\/code><\/pre>\n<p>  \u0418 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/091\/ecc\/e48\/091ecce488504cbd95d3ef7dbbe1fd99.jpeg\" \/><\/div>\n<p>  \u041d\u0443, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u0430\u043a \u0441\u0435\u0431\u0435, \u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u0432\u044b? \u0418 \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0430\u0432\u044b, \u0432\u0435\u0434\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0432 layer.borderWidth=2.<\/p>\n<blockquote><p>\u0422\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0440\u0438\u0441\u0443\u0435\u0442\u0435 \u0432 Path (UIPath, CGPath) \u043e\u0442\u0440\u0435\u0437\u043a\u0438, \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b \u2014 \u043e\u043d\u0438 \u0432\u0441\u0435 \u0438\u043c\u0435\u044e\u0442 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446. StrokeEnd \u0443 CAShapeLayer \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0434\u043e \u043a\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0441\u0442\u043e\u0438\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043b\u0438\u043d\u0438\u044e.<\/p>\n<p>  StrokeStart \u0436\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441 \u043a\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u043d\u0438\u044e. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 0.0 \u2014 1.0<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/1f5\/21c\/4e1\/1f521c4e1890430493e465be10c45fd7.png\" \/><\/div>\n<\/blockquote>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439? \u0412\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0412 \u043c\u0435\u0441\u0442\u0435 \u0433\u0434\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c CAShapeLayer \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"objectivec\"> animateLayer.strokeEnd   = 0.0; <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 strokeEnd:<\/p>\n<pre><code class=\"objectivec\"> \tCABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@&quot;strokeEnd&quot;]; \tpathAnimation.duration = duration; \tpathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; \tpathAnimation.fromValue = [NSNumber numberWithFloat:0.0f]; \tpathAnimation.toValue = [NSNumber numberWithFloat:1.0f]; \tpathAnimation.autoreverses = NO; \t[animateLayer addAnimation:pathAnimation forKey:@&quot;strokeEndAnimation&quot;]; \t \tanimateLayer.strokeEnd = 1.0; <\/code><\/pre>\n<p>  (\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 CABasicAnimation \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/developer.apple.com\/reference\/quartzcore\/cabasicanimation?language=objc\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u044d\u043f\u043b<\/a>)<\/p>\n<p>  3. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c! <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6dc\/ff0\/2ba\/6dcff02badcd4748a30acedf343735ac.gif\" \/><\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u043b\u0438\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043e\u0433\u0438\u0431\u0430\u0435\u0442 \u043d\u0430\u0448 UIView. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043a\u0430\u043a \u043d\u0430 \u041a\u0414\u041f\u0412.<\/p>\n<p>  \u041a\u0430\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e: \u0442\u043e\u0447\u043a\u0430, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0438\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043a \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043b\u0438\u043d\u0438\u044f \u0432\u0438\u043b\u044f\u043b\u0430 \u2014 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u043e\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u0430 \u043d\u0430 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u043c \u043b\u0438\u043d\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e:<\/p>\n<pre><code class=\"objectivec\">[path addCurveToPoint:controlPoint1:controlPoint2:];<\/code><\/pre>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u043a\u0440\u0438\u0432\u044b\u0445 \u0411\u0435\u0437\u044c\u0435:<\/p>\n<pre><code class=\"objectivec\">@interface LinesCurvePoints : NSObject @property(nonatomic,assign)CGPoint controlPoint1; @property(nonatomic,assign)CGPoint controlPoint2; +(instancetype)curvePoints:(CGPoint)point1 point2:(CGPoint)point2; @end @implementation LinesCurvePoints  +(instancetype)curvePoints:(CGPoint)point1 point2:(CGPoint)point2 { \tLinesCurvePoints* point = [LinesCurvePoints new]; \tpoint.controlPoint1 = point1; \tpoint.controlPoint1 = point2; \treturn point; }  @end<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0432 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"objectivec\">-(void)animateLinesWithColor:(CGColorRef)lineColor andLineWidth:(CGFloat)lineWidth startPoint:(CGPoint)startFromPoint rollToStroke:(CGFloat)rollToStroke curveControlPoints:(NSArray&lt;LinesCurvePoints*&gt;*)curvePoints animationDuration:(CGFloat)duration <\/code><\/pre>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435, \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f zeroPoint \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"objectivec\"> [path moveToPoint:startFromPoint]; long c = curvePoints.count; \tfor (long i =1; i&lt;=c; i++) \t{ \t\tfloat nX = startFromPoint.x + (zeroPoint.x - startFromPoint.x)\/(c)*i; \t\tfloat nY = startFromPoint.y +(zeroPoint.y - startFromPoint.y)\/(c)*i; \t\t \t\t \t\tLinesCurvePoints* point = curvePoints[i-1]; \t\t \t\t \t\t[path addCurveToPoint:CGPointMake(nX, nY) controlPoint1:CGPointMake(nX+point.controlPoint1.x,nY+point.controlPoint1.y) controlPoint2:CGPointMake(nX+ point.controlPoint2.y,nY+ point.controlPoint2.y)]; \t\t \t} <\/code><\/pre>\n<p>  \u041e\u043d \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043e\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u0430 \u043d\u0430 \u0440\u0430\u0432\u043d\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u0438 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u0442 \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u0438\u0432\u044b\u0445, \u0441 \u043a\u043e\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 curveControlPoints. \u0418 \u0432\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u2014 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 strokeStart:<\/p>\n<pre><code class=\"objectivec\"> \tpathAnimation = [CABasicAnimation animationWithKeyPath:@&quot;strokeStart&quot;]; \tpathAnimation.duration = duration*1.2;  \tpathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; \tpathAnimation.fromValue = [NSNumber numberWithFloat:0.0f]; \tpathAnimation.toValue = [NSNumber numberWithFloat:rollToStroke]; \tpathAnimation.autoreverses = NO;  \t[animateLayer  addAnimation:pathAnimation forKey:@&quot;strokeStartAnimation&quot;]; animateLayer.strokeStart = rollToStroke; <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 strokeEnd. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f strokeStart \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438, \u043c\u043d\u0435 \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0434\u043b\u0438\u043d\u043d\u0443 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0435\u0441\u043b\u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e c \u043a\u0440\u0438\u0432\u044b\u043c\u0438 \u0411\u0435\u0437\u044c\u0435.<\/p>\n<p>  \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"objectivec\"> -(void)animateLinesWithColor:(CGColorRef)lineColor andLineWidth:(CGFloat)lineWidth startPoint:(CGPoint)startFromPoint rollToStroke:(CGFloat)rollToStroke curveControlPoints:(NSArray&lt;LinesCurvePoints*&gt;*)curvePoints animationDuration:(CGFloat)duration  { \t \tCAShapeLayer* animateLayer = [CAShapeLayer layer]; \tanimateLayer.lineCap = kCALineCapRound; \tanimateLayer.lineJoin = kCALineJoinBevel; \tanimateLayer.fillColor   = [[UIColor clearColor] CGColor]; \tanimateLayer.lineWidth   = lineWidth; \tanimateLayer.strokeEnd   = 0.0; \t \tUIBezierPath* path = [UIBezierPath new]; \t[path setLineWidth:1.0]; \t[path setLineCapStyle:kCGLineCapRound]; \t[path setLineJoinStyle:kCGLineJoinRound]; \t \t \t \tCGRect bounds = self.layer.bounds; \tCGFloat radius = self.layer.cornerRadius; \tCGPoint zeroPoint = bounds.origin; \t \t \t \t \tBOOL isRounded = radius&gt;0; \t \tif(isRounded) \t{ \t\tzeroPoint.x = bounds.origin.x+radius; \t} \t \t[path moveToPoint:startFromPoint]; \t \tlong c = curvePoints.count; \tfor (long i =1; i&lt;=c; i++) \t{ \t\tfloat nX = startFromPoint.x + (zeroPoint.x - startFromPoint.x)\/(c)*i; \t\tfloat nY = startFromPoint.y +(zeroPoint.y - startFromPoint.y)\/(c)*i; \t\t \t\t \t\tLinesCurvePoints* point = curvePoints[i-1]; \t\t \t\t \t\t[path addCurveToPoint:CGPointMake(nX, nY) controlPoint1:CGPointMake(nX+point.controlPoint1.x,nY+point.controlPoint1.y) controlPoint2:CGPointMake(nX+ point.controlPoint2.y,nY+ point.controlPoint2.y)]; \t\t \t} \t \t[path moveToPoint:zeroPoint]; \t \tCGPoint nextPoint = CGPointMake(bounds.size.width, 0); \tif(isRounded) \t{ \t\tnextPoint.x-=radius; \t} \t[path addLineToPoint:nextPoint]; \tif(isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x, nextPoint.y+radius) radius:radius startAngle:-M_PI_2 endAngle:0 clockwise:YES]; \t} \t \tnextPoint = CGPointMake(bounds.size.width, bounds.size.height); \tif(isRounded) \t{ \t\tnextPoint.y-=radius; \t} \t[path addLineToPoint:nextPoint]; \tif (isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x-radius, nextPoint.y) radius:radius startAngle:0 endAngle:M_PI_2 clockwise:YES]; \t} \t \tnextPoint = CGPointMake(0, bounds.size.height); \tif(isRounded) \t{ \t\tnextPoint.x +=radius; \t} \t[path addLineToPoint:nextPoint]; \tif (isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x, nextPoint.y-radius) radius:radius startAngle:M_PI_2 endAngle:M_PI clockwise:YES]; \t} \t \tnextPoint = CGPointMake(0, 0); \tif(isRounded) \t{ \t\tnextPoint.y +=radius; \t} \t[path addLineToPoint:nextPoint]; \tif (isRounded) \t{ \t\t[path addArcWithCenter:CGPointMake(nextPoint.x+radius, nextPoint.y) radius:radius startAngle:M_PI endAngle:-M_PI_2 clockwise:YES]; \t} \t \tanimateLayer.path = path.CGPath; \tanimateLayer.strokeColor = lineColor; \t \t[self.layer addSublayer:animateLayer]; \t \t \t \tCABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@&quot;strokeEnd&quot;]; \tpathAnimation.duration = duration; \tpathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; \tpathAnimation.fromValue = [NSNumber numberWithFloat:0.0f]; \tpathAnimation.toValue = [NSNumber numberWithFloat:1.0f]; \tpathAnimation.autoreverses = NO; \t[animateLayer addAnimation:pathAnimation forKey:@&quot;strokeEndAnimation&quot;]; \t \tanimateLayer.strokeEnd = 1.0; \t \tpathAnimation = [CABasicAnimation animationWithKeyPath:@&quot;strokeStart&quot;]; \tpathAnimation.duration = duration*1.2; \t \t \t \tpathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; \tpathAnimation.fromValue = [NSNumber numberWithFloat:0.0f]; \tpathAnimation.toValue = [NSNumber numberWithFloat:rollToStroke]; \tpathAnimation.autoreverses = NO; \t \t \t[animateLayer addAnimation:pathAnimation forKey:@&quot;strokeStartAnimation&quot;]; \tanimateLayer.strokeStart = rollToStroke;  \t } <\/code><\/pre>\n<p>  \u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 ViewController:<\/p>\n<pre><code class=\"objectivec\"> [_panel\tanimateLinesWithColor:[UIColor redColor].CGColor andLineWidth:2 startPoint:CGPointMake(100, -200) rollToStroke:0.25 \t curveControlPoints:@[ [LinesCurvePoints curvePoints:CGPointMake(-50, -2) point2:CGPointMake(60, 5)], [LinesCurvePoints curvePoints:CGPointMake(-60, 10) point2:CGPointMake(100, 5)] ]  animationDuration:2 ]; <\/code><\/pre>\n<p>  rollToStroke \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0435\u0441\u043b\u0438 _panel \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 240 \u043d\u0430 128 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d67\/37a\/c26\/d6737ac267a9436f8b3bbcb2ea8cbff6.gif\" \/><\/div>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7e2\/a3a\/fa0\/7e2a3afa04f241acb8e1bb0fe236c22a.gif\" \/><\/div>\n<p>  \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0433\u0440 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u044d\u0442\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u043c\u043e\u044f \u043b\u044e\u0431\u0438\u043c\u0430\u044f:<\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/SYT8dd_idfA?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/318716\/\"> https:\/\/habrahabr.ru\/post\/318716\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438 \u0438\u043c \u0441\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435! \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0432\u044c\u044e\u0445 \u043d\u0430 iOS. \u0414\u0443\u043c\u0430\u044e, \u043a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043c\u0435\u043b\u044c\u043a\u043e\u043c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 CALayer \u0438 Core Animation \u0432\u043e\u043e\u0431\u0449\u0435, \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445, \u0430 \u0432\u043e\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0435\u0442 \u043d\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e Core Animation.  <\/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-283231","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283231","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=283231"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283231\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}