Swift 3 and CGContextEOClip

As I convert my code to swift 3, I got this error:

error: 'CGContextEOClip' is unavailable: Use clip(using:)
                                CGContextEOClip(context!);
                                ^~~~~~~~~~~~~~~
CoreGraphics.CGContextEOClip:2:13: note: 'CGContextEOClip' has been explicitly marked unavailable here
public func CGContextEOClip(_ c: CGContext?)

I have no idea how to use the clip (using :), and I do not see any documentation related to it. Any ideas. thanks reza

+4
source share
1 answer

In swift3 CGContextEOClipand CGContextClipnow CGContexttype methods are applied

let context = /*your context*/
context.clip(using: .evenOdd) // for CGContextEOClip
context.clip(using: .winding) // for CGContextClip
+9
source

Source: https://habr.com/ru/post/1655102/


All Articles