Image for post
Image for post
Diego Cavalcante Costa | Solutions Specific Knowledge Analyst, Technology | everis Brasil

Um pouco mais sobre UIBezierPath com Swift

Hoje vamos falar um pouco mais sobre UIBezierPath, provavelmente você já deve ter ouvido falar ou mesmo já feito algo com ele. A minha ideia aqui é fazer uma explicação de como funciona a lógica por trás, como criamos os pontos, como um ponto cria uma linha.

Definição

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
UIBezierPath completo
Image for post
Image for post
path.move(to: CGPoint(x: center.x, y: 0)) //4
Image for post
Image for post
path.addLine(to: CGPoint(x: size.width, y: 60)) //5
Image for post
Image for post
path.addLine(to: CGPoint(x: size.width — 20, y: 60)) //6
Image for post
Image for post
path.addLine(to: CGPoint(x: size.width — 20, y: size.height)) //7
Image for post
Image for post
path.addLine(to: CGPoint(x: 20, y: size.height)) //8
Image for post
Image for post
path.addLine(to: CGPoint(x: 20, y: 60)) //9
Image for post
Image for post
path.addLine(to: CGPoint(x: 0, y: 60)) //10
Image for post
Image for post
path.addLine(to: CGPoint(x: center.x, y: 0)) //11

Written by

Exponential intelligence for exponential companies

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store