From 7635f5f34c3e7927fea743659d5679e9e145ff21 Mon Sep 17 00:00:00 2001 From: Seil Oh Date: Mon, 14 Aug 2017 15:14:45 +0900 Subject: [PATCH] conform to macOS api changes in swift 3.2 --- Source/Charts/Utils/Platform.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Charts/Utils/Platform.swift b/Source/Charts/Utils/Platform.swift index ec3963b6f6..3f81ea8171 100644 --- a/Source/Charts/Utils/Platform.swift +++ b/Source/Charts/Utils/Platform.swift @@ -550,7 +550,7 @@ types are aliased to either their UI* implementation (on iOS) or their NS* imple image.lockFocus() let rep = NSBitmapImageRep(focusedViewRect: NSMakeRect(0, 0, image.size.width, image.size.height)) image.unlockFocus() - return rep?.representation(using: NSPNGFileType, properties: [:]) + return rep?.representation(using: .PNG, properties: [:]) } func NSUIImageJPEGRepresentation(_ image: NSUIImage, _ quality: CGFloat = 0.9) -> Data? @@ -558,7 +558,7 @@ types are aliased to either their UI* implementation (on iOS) or their NS* imple image.lockFocus() let rep = NSBitmapImageRep(focusedViewRect: NSMakeRect(0, 0, image.size.width, image.size.height)) image.unlockFocus() - return rep?.representation(using: NSJPEGFileType, properties: [NSImageCompressionFactor: quality]) + return rep?.representation(using: .JPEG, properties: [NSImageCompressionFactor: quality]) } private var imageContextStack: [CGFloat] = []