Skip to content

Instantly share code, notes, and snippets.

@a2
Created July 25, 2014 00:03
Show Gist options
  • Save a2/ffc7a2b146596db58732 to your computer and use it in GitHub Desktop.
Save a2/ffc7a2b146596db58732 to your computer and use it in GitHub Desktop.
CGRectDivide override that returns a tuple.
import CoreGraphics
func CGRectDivide(rect: CGRect, amount: CGFloat, edge: CGRectEdge) -> (slice: CGRect, remainder: CGRect) {
var slice = CGRectZero
var remainder = CGRectZero
CGRectDivide(rect, &slice, &remainder, amount, edge)
return (slice, remainder)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment