Skip to content

Instantly share code, notes, and snippets.

@pxpgraphics
Forked from steipete/gist:6133152
Created September 22, 2016 19:02
Show Gist options
  • Save pxpgraphics/3bee670bb7108e8ce79e5440b77e11bb to your computer and use it in GitHub Desktop.
Save pxpgraphics/3bee670bb7108e8ce79e5440b77e11bb to your computer and use it in GitHub Desktop.
Create a hash from a CGRect
NSUInteger PSPDFHashFromCGRect(CGRect rect) {
return (*(NSUInteger *)&rect.origin.x << 10 ^ *(NSUInteger *)&rect.origin.y) + (*(NSUInteger *)&rect.size.width << 10 ^ *(NSUInteger *)&rect.size.height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment