-1

Starting iOS 10, Apple documents this class function in UIKit:

class func prepare(_ context: CGContext, with rendererContext: UIGraphicsRendererContext)

However, I was not able to access prepare in Xcode 8.3.3:

// error: Type 'UIGraphicsRenderer' has no member 'prepare'
UIGraphicsRenderer.prepare(UIGraphicsGetCurrentContext()!, with: UIGraphicsRendererContext())

// error: Type 'UIGraphicsImageRenderer' has no member 'prepare'
UIGraphicsImageRenderer.prepare(UIGraphicsGetCurrentContext()!, with: UIGraphicsRendererContext())
Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

1

The function prepare is defined in UIGraphicsRendererSubclass You can import this class with callingimport UIKit.UIGraphicsRendererSubclass

Fabio Berger
  • 1,921
  • 2
  • 24
  • 29