Skip to content

Commit

Permalink
Merge pull request #2717 from ohbargain/apply_macOS_change
Browse files Browse the repository at this point in the history
Conform to macOS api changes in swift 3.2
  • Loading branch information
pmairoldi authored Sep 3, 2017
2 parents 765b88e + 7635f5f commit d7dc8f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Charts/Utils/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,15 @@ 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?
{
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] = []
Expand Down

0 comments on commit d7dc8f0

Please sign in to comment.