Questions tagged [uibezierpath]

The UIBezierPath class lets you define a path consisting of straight and curved line segments and render that path in your custom views.

The UIBezierPath class lets you define a path consisting of straight and curved line segments and render that path in your custom views. You use this class initially to specify just the geometry for your path. Paths can define simple shapes such as rectangles, ovals, and arcs or they can define complex polygons that incorporate a mixture of straight and curved line segments. After defining the shape, you can use additional methods of this class to render the path in the current drawing context.

Its counterpart in OS X is .

Resources:

1777 questions
0
votes
2 answers

Which is a better option for displaying irregular shapes in Swift?

let me start off by showing that I have this UIImageView set up in my ViewController: Each one of the lines contains a UIButton for a body part. If I select a particular button, it will segue me appropriately. What'd I like to do is, when the user…
Pangu
  • 3,721
  • 11
  • 53
  • 120
0
votes
1 answer

How to edit high resolution images with Core Graphics?

I'm trying to draw a path on a high resolution image, that's nothing complicated for an iPhone but if I add shadow to my path everything lags. It lags only when I work on images with a certain resolution (2000 x 3000) even less. The Storyboard vies…
DanielZanchi
  • 2,708
  • 1
  • 25
  • 37
0
votes
0 answers

Create custom shape using Bezier Curve in iOS

I have one requirement to show the a shape (like Home or Car etc) and depending upon the percentage of the condition will be filled with animation I was trying with image but when I googled, I found this can be achieved by drawing image using…
Soniya
  • 600
  • 7
  • 34
0
votes
1 answer

How to add path to UIImage which will remove pixels?

I have UIImage with some image. And i have UIBezierPath (user signature). How to make what path erase pixels in UIImage for alpha. Simply like scratch some uiimage? i try UIGraphicsBeginImageContextWithOptions(self.bounds.size, YES, 0.0); …
Dmitry Nelepov
  • 7,246
  • 8
  • 53
  • 74
0
votes
0 answers

How to draw a single UIBezierPath with multiple colors?

I have a draw board project that needs to draw a UIBezierPath with multiple color. I use method addLineToPoint() to append my path and resultColor.set() path.stroke() to draw the path every time after addLineToPoint is called.All I want is…
onefolder
  • 1
  • 1
0
votes
1 answer

Add image, which drawing with UIBezier or CGContextRef into UIView sublayer

In this code I use CGContextRef to create next picture on my UIView: CGMutablePathRef arc = CGPathCreateMutable(); CGFloat lineWidth = 16.0; CGContextRef cont =…
0
votes
1 answer

Connect points with line & pan gesture

I have 4 circles created on the same way: var circleText1 = UIBezierPath(arcCenter: CGPoint(x: labelOrigin.frame.origin.x - 10,y: labelOrigin.frame.origin.y + labelOrigin.frame.height/2), radius: 5, startAngle: CGFloat(0), endAngle:CGFloat(M_PI *…
Sergio
  • 82
  • 7
0
votes
0 answers

Can't draw a circle with correct radius UIBezierPath ios / swift

When i compute the radius with the width of the UIImageView divide by 2 i obtain that. In the storyboard the size of my UIImageView is 64x64 with a radius computed with a width / 2 Here s my code (Image is my custom class used with the library…
0
votes
1 answer

UIImage Inside Custom Shape and animation

I need to draw a shape like that one: And animate the color path when you are scrolling. I have been for 2 hours trying several things but don't reach the final way to overcome that. I have tried creating a custom UIView, create a CShapeLayer and…
Sergio
  • 82
  • 7
0
votes
1 answer

How to connect two SCNSpheres in 3D space using Bezier path in Swift?

I have the following code: func createScene(){ count += 1 let sphereGeom = SCNSphere(radius: 1.5) sphereGeom.firstMaterial?.diffuse.contents = UIColor.redColor() let path = UIBezierPath() path.moveToPoint(CGPoint(x: 0, y:…
ap524
  • 61
  • 8
0
votes
2 answers

iOS - Custom UIView doesn't show up on device

I have a custom UIView subclass, that I want to add as a subview on my UIViewController. The problem is, that the view doesn't show up, when I run the app, even though everything is set correctly (in viewDidLoad the view has a correct frame and is…
smeshko
  • 1,184
  • 13
  • 27
0
votes
1 answer

Why this 2nd circle didn't show?

if i Commented the shapeShadow code,it will show the 2nd circle. what happened in -(void)shapeShadow:(UIBezierPath *)shape ? -(void)shapeShadow:(UIBezierPath *)shape This code is add line in circle. #import "SetCard.h" @implementation…
yangOne
  • 79
  • 2
  • 9
0
votes
1 answer

Bezier drawRect subview not visible when constraints are added in relation to other elements in the superview

I have added a subview with its own UIView class LogoLineView.swift to the superview ViewController.swift. Inside my superview in my storyboard I have 3 UI elements: a label with some colored text to simulate a logo "Hello World" then, I have my…
Jace
  • 397
  • 5
  • 15
0
votes
1 answer

iOS - UIBezierPath making start angle always vertical

Hi I'm currently trying to make random angles of a circle but id like the startangle to always be vertical. In the image above its shows 180 degrees of a circle but the start angle is horizontal and it changes depending on the angle i specify. So…
0
votes
1 answer

Drawing circle outline with small gap Sprite Kit Swift

I am currently creating a game in SpriteKit. In this game, I am trying to draw an outline of a circle with a small gap(s) in the outline of this circle (possibly about 1/8 the entire circumference of the circle). Here is a drawn picture of what I am…
Aidan Kaiser
  • 501
  • 5
  • 17