Swift - Fix print issue and pass variables to a class to finish drawing

Completed Posted 3 years ago Paid on delivery
Completed

My code needs two fix:

1) It is not printing within the functional call

2) pass the variable so the class can draw correctly

Code sample below

public func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {

print ("my test")

var x1 = 50

let y1 = 100

let x2 = 10

let y2 = 10

let x3 = 200

let y3 = 200

let x4 = 350

let y4 = 100

}

class DrawView: UIView {

override func draw(_ rect: CGRect) {

let context = UIGraphicsGetCurrentContext()

context?.setLineWidth(10.0)

context?.setStrokeColor([login to view URL])

context?.move(to: CGPoint(x: x1, y: y1))

context?.addLine(to: CGPoint(x: x2, y: y2))

context?.strokePath()

let context2 = UIGraphicsGetCurrentContext()

context2?.setLineWidth(10.0)

context2?.setStrokeColor([login to view URL])

context2?.move(to: CGPoint(x: x3, y: y3))

context2?.addLine(to: CGPoint(x: x4, y: y4))

context2?.strokePath()

}

}

Swift iPhone iPad Cocoa

Project ID: #27995771

About the project

2 proposals Remote project Active 3 years ago

Awarded to:

ethanblount1

Hi, there Q:Which data are you capturing now from the camera? Q: Did you use Vision Image? I want to know about capturing data at first Thank you Ethan Blount

$25 USD / hour
(2 Reviews)
2.7

2 freelancers are bidding on average $23/hour for this job

harshthakur23

hello 1) are you sure, below function is being called , so that it can print whatever needed? check with breakpoints. I thik this delegate method you called is wrong. let me check code for this once public func capt More

$20 USD / hour
(3 Reviews)
1.5