Skip to content

Instantly share code, notes, and snippets.

@ddonovan
Created December 3, 2014 06:17
Show Gist options
  • Save ddonovan/f6862ef4e4e14e6c234c to your computer and use it in GitHub Desktop.
Save ddonovan/f6862ef4e4e14e6c234c to your computer and use it in GitHub Desktop.
sample of detecting device orientation iOS and changing cell item size in flow layout.
if (UIDeviceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
flowLayout.itemSize = CGSizeMake(115.f, 115.f);
} else {
flowLayout.itemSize = CGSizeMake(105.f, 105.f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment