CodingMeSwiftly / UIBezierPath-Superpowers

MIT License
78 stars 16 forks source link

Code update #12

Closed maulikm235 closed 3 months ago

maulikm235 commented 3 months ago

Please update this code to your file, your code is old and will not run,

fileprivate extension CGPath {
  func apply(closure: CGPathApplierClosure) {
    self.apply(info: unsafeBitCast(closure, to: UnsafeMutableRawPointer.self)) { (info, element) in
      let block = unsafeBitCast(info, to: CGPathApplierClosure.self)
      block(element.pointee)
    }
  }
}

replace above function with

fileprivate extension CGPath {
    func apply(closure: CGPathApplierClosure) {
        withoutActuallyEscaping(closure) { escapedClosure in
            self.apply(info: unsafeBitCast(escapedClosure, to: UnsafeMutableRawPointer.self)) { (info, element) in
                let block = unsafeBitCast(info, to: CGPathApplierClosure.self)
                block(element.pointee)
            }
        }
    }
}

also, there are few warnings, please check and update it, if possible give cocoa pods support for this feature. i want to thank you for creating this file, this helps me so much that i can not able to get any kind of solution on internet.

CodingMeSwiftly commented 3 months ago

Should be fixed by #11