Created
February 23, 2018 08:06
-
-
Save kbinani/b589d9fdf603e9eaa555f0352b44f637 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum CGContextType : Int { | |
case unknown | |
case pdf | |
case postscript | |
case window | |
case bitmap | |
case gl | |
case displaylist | |
case kseparation | |
case iosurface | |
} | |
extension CGContextType : CustomDebugStringConvertible { | |
var debugDescription: String { | |
switch self { | |
case .unknown: | |
return "unknown" | |
case .pdf: | |
return "pdf" | |
case .postscript: | |
return "postscript" | |
case .window: | |
return "window" | |
case .bitmap: | |
return "bitmap" | |
case .gl: | |
return "gl" | |
case .displaylist: | |
return "displaylist" | |
case .kseparation: | |
return "kseparation" | |
case .iosurface: | |
return "iosurface" | |
} | |
} | |
} | |
@_silgen_name("CGContextGetType") func CGContextGetType(_ ctx: CGContext) -> CGContextType | |
extension CGContext { | |
var type: CGContextType { | |
return CGContextGetType(self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment