Created
February 27, 2017 11:15
-
-
Save swhitty/12d303a64db0ca72790a7f59fb515123 to your computer and use it in GitHub Desktop.
Bridges CoreGraphics.CGPathApplierFunction with a standard Swift closure
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
extension CGPath { | |
func apply(action: @escaping (CGPathElement)->()) { | |
var action = action | |
apply(info: &action) { | |
let action = $0!.bindMemory(to: ((CGPathElement)->()).self, capacity: 1).pointee | |
action($1.pointee) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment