Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hfossli/AGWindowView
Add as many UIView's to UIWindow as you want. Specify the orientation or just follow the status bar.
https://github.com/hfossli/AGWindowView
Last synced: 3 months ago
JSON representation
Add as many UIView's to UIWindow as you want. Specify the orientation or just follow the status bar.
- Host: GitHub
- URL: https://github.com/hfossli/AGWindowView
- Owner: hfossli
- License: other
- Created: 2013-03-11T18:39:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T06:53:45.000Z (almost 9 years ago)
- Last Synced: 2024-07-23T01:50:44.485Z (4 months ago)
- Language: Objective-C
- Homepage:
- Size: 230 KB
- Stars: 230
- Watchers: 16
- Forks: 31
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AGWindowView
============Add as many UIView's to UIWindow as you want. Specify the orientation or just follow the status bar. Status bar height is taken into account and you don't have to worry about a thing.
We're using it in Agens for custom alerts, but it can be used for anything. Should not be used as the first view on window.
The AGWindowView is filling the entire screen while your subviews may fill parts of the AGWindowView.
iOS 5 ~ iOS 8 and SDK's
-----------------------
AGWindowView is compatible with modern combinations of build SDK's and iOS system versions (iOS 5 ~ iOS 8). Make sure you use the latest tag/version.Usage
------It can be used in a number of different situations.
- display something fullscreen
- your app is in portrait and you want to play video in fullscreen landscape
- show custom modals in specific orientations
- display custom alerts on top of UI
- should not be used as the first view on window.Code examples
-------Support the current orientation the status bar might have
AGWindowView *windowView = [[AGWindowView alloc] initAndAddToKeyWindow];
windowView.supportedInterfaceOrientations = AGInterfaceOrientationMaskAll;
[windowView addSubview:view];
Slide up say a video player in landscape even though your app is in portraitAGWindowView *windowView = [[AGWindowView alloc] initAndAddToKeyWindow];
windowView.supportedInterfaceOrientations = AGInterfaceOrientationMaskLandscapeLeft;
[windowView addSubviewAndFillBounds:player.view withSlideUpAnimationOnDone:nil];
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];Note: this won't actually rotate the statusbar, just the AGWindow.
Debug - Notes
-----Please note that we are using `AGInterfaceOrientationMask` and not `UIInterfaceOrientation` for the property `supportedInterfaceOrientations`.
I highly encourage either to set `supportedInterfaceOrientations = AGInterfaceOrientationMaskAll` or only use one of the orientations e.g. `supportedInterfaceOrientations = AGInterfaceOrientationMaskPortrait`. Mixing will be supported, but currently undergoes unexpected results.
Cocoa pods
-------
It is added to the public CocoaPods spec repository under the name `AGWindowView`.
[![Agens | Digital craftsmanship](http://static.agens.no/images/agens_logo_w_slogan_avenir_small.png)](http://agens.no/)