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

Cannot create two CGPathAddArc on the same CGMutablePathRef

I'm trying to understand why i'm seeing only one of mine CGPathAddArc. Code : var r: CGRect = self.myView.bounds var lay: CAShapeLayer = CAShapeLayer() var path: CGMutablePathRef = CGPathCreateMutable() CGPathAddArc(path, nil, 30,…
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
0
votes
1 answer

UIBezierPath not drawing arc

I'm trying to draw a very simple circle. Here is my code: CameraButtonView *buttonView = [[CameraButtonView alloc]initWithFrame:CGRectMake((self.view.frame.size.width / 2) - 45, self.view.frame.size.height * 0.8, 90,…
jjjjjjjj
  • 4,203
  • 11
  • 53
  • 72
0
votes
0 answers

Cant crop exact image inside closed UIBezierPath

I am using JBCroppableView to get the Bezier path of selected area. // built in function to get path of selected area UIBezierPath *path = [self getPath]; Only difference is that JBCroppableView masks the selected area and I am trying to crop the…
Aman
  • 241
  • 2
  • 10
0
votes
1 answer

Displaying image from drawing code

I have the below example code that I want to render as an image in either a UIView or UIImageView. On my storyboard I have a UIView (myUIView) and UIImageView (myUIImageView). What is missing from the code below that allows me to grab the code and…
user4806509
  • 2,925
  • 5
  • 37
  • 72
0
votes
2 answers

How to add a single smooth line with multiple CGPoint Swift 2.0

I have this function that takes an Array[CGPoint] and I am trying to create a single trend. I can't get it to be a smooth line through the array of points, when I use the moveToPoint() function after each point, I get this black line in the…
Tal Zion
  • 6,308
  • 3
  • 50
  • 73
0
votes
2 answers

Drawing a shape

I'm trying to draw an E shaped thingy and as far as I know there are 2 ways to go one of them being path. I could draw with path as the below documentation suggests.…
durazno
  • 559
  • 2
  • 7
  • 25
0
votes
2 answers

'Display Zoom' iPhone 6/6s setting blurs graphics

I'm writing a project in Xcode 7 / Swift 2 that it is optimized for iPhone 6/6s (i.e. the project has a launch screen file and launch screen images for iPhone 6/6s). Fortunately or unfortunately, iPhone 6 users have the ability to turn on the…
user4806509
  • 2,925
  • 5
  • 37
  • 72
0
votes
1 answer

Cut Bezier Path by y coordinate

I have got specific UIBezierPath, example override func drawInContext(ctx: CGContext) { if let slider = slider { // Clip let rect = bounds.insetBy(dx: bounds.width / 10, dy: bounds.height / 2.2) let path =…
Pavel Zagorskyy
  • 443
  • 1
  • 4
  • 20
0
votes
1 answer

Smootly mooving a hole in UIImage?

I have a UIImageView displaing an image. This view's layer is masked with CAShapeLayer in order to create circular "hole" in the image. To create the hole I use UIBezierPath with .usesEvenOddFillRule = true. It works fine when static. But I need…
Rasto
  • 17,204
  • 47
  • 154
  • 245
0
votes
1 answer

Calculate fill percentage in polygon/shape/UIBezierPath

I have a polygon drawn as an UIBezierPath with 5 coordinates. It is correctly shown and the area is calculated, now I want a button that starts filling the shape until the button is released and calculate the percentage of the filled area. How can I…
iDec
  • 707
  • 2
  • 8
  • 16
0
votes
1 answer

gestureRecognizer not working on added subview

I'm adding a subview in a view that holds multiple gesturerecognizer however when this view is being introduced the gesture's won't fire when the user taps inside this newly added view. It's a UIBezierPath that I'm introducing however. I've read…
NoSixties
  • 2,443
  • 2
  • 28
  • 65
0
votes
2 answers

UIBezierPath outline around multiple subviews

I have a view which contains multiple subviews. I need to draw an outline around all the subviews that the user selects and ignore those which are not selected. I have tried creating a convex hull but it does not solve my purpose correctly. Is there…
Rishi
  • 1,987
  • 6
  • 32
  • 49
0
votes
1 answer

How can I apply a gradient blur effect on a view?

I have drawn a path on a view, All I need is to apply a gradient blur effect from the outer edge of the closed drawn path to the view's bounds. My question is mainly about the Gradient blur effect rather than applying it on the path.
Reza.Ab
  • 1,195
  • 1
  • 11
  • 21
0
votes
0 answers

How can I get access to the outer space of a closed path?

Assuming that I have a closed path (either drawn by using UIBezierpath or Core Graphics) and I want to get access to the outer space of it to apply a visual effect to the view in which it has been drawn, How can I get access to that? I don't want to…
Reza.Ab
  • 1,195
  • 1
  • 11
  • 21
0
votes
1 answer

Create a circle with multi coloured segments in Core Graphics

I am trying to draw a pie chart which will be made up of equal sized segments, each with a different colour. I am basing my code off this SO: Draw a circular segment progress in SWIFT let circlePath = UIBezierPath(ovalInRect: CGRect(x: 200, y: 200,…
Dan
  • 1,343
  • 2
  • 9
  • 12