All Projects → wicharek → Uinavigationbar Fixedheightwhenstatusbarhidden

wicharek / Uinavigationbar Fixedheightwhenstatusbarhidden

Licence: mit
Category for iOS 7 navigation bar, allowing it to keep its height even if status bar was hidden

Labels

Projects that are alternatives of or similar to Uinavigationbar Fixedheightwhenstatusbarhidden

Cards
Awesome iOS 11 appstore cards in swift 5.
Stars: ✭ 4,017 (+6825.86%)
Mutual labels:  ios11
Swiftmessages
A very flexible message bar for iOS written in Swift.
Stars: ✭ 6,363 (+10870.69%)
Mutual labels:  ios11
Ios Vision Example
Using iOS 11 SDKs with pre-trained neural networks to allow your iOS 11 devices to see.
Stars: ✭ 44 (-24.14%)
Mutual labels:  ios11
Ios Nfc Example
📱 Example showing how to use the Core NFC API in iOS
Stars: ✭ 480 (+727.59%)
Mutual labels:  ios11
Awesome Coreml Models
Largest list of models for Core ML (for iOS 11+)
Stars: ✭ 5,192 (+8851.72%)
Mutual labels:  ios11
Arshooter
A demo Augmented Reality shooter made with ARKit in Swift (iOS 11)
Stars: ✭ 794 (+1268.97%)
Mutual labels:  ios11
Easynavigation
一款超级简单的导航条管理工具。完全自定义导航条。没有UINavigationBar 和 UINavigationItem 这两个类。完全是对UIView的操作。
Stars: ✭ 393 (+577.59%)
Mutual labels:  ios11
Evncustomsearchbar
🔍Born for iOS 11 and iPhone X SearchBar
Stars: ✭ 52 (-10.34%)
Mutual labels:  ios11
Arpaint
Draw with bare fingers in the air using ARKit
Stars: ✭ 672 (+1058.62%)
Mutual labels:  ios11
Chineseidcardocr
[Deprecated] 🇨🇳中国二代身份证光学识别
Stars: ✭ 1,015 (+1650%)
Mutual labels:  ios11
Safariautologintest
A demo showing how you can auto-login users to an iOS app using SafariViewController (on iOS 9) and SFAuthenticationSession (on iOS 11)
Stars: ✭ 480 (+727.59%)
Mutual labels:  ios11
Hapticbutton
A button that is triggered based on the 3D Touch pressure, similar to the iOS 11 control center.
Stars: ✭ 501 (+763.79%)
Mutual labels:  ios11
Pdfdrawingview
PDFDrawingView is a lightweight PDF Viewer that has built in functionality for drawing.
Stars: ✭ 17 (-70.69%)
Mutual labels:  ios11
Facecropper
✂️ Crop faces, inside of your image, with iOS 11 Vision api.
Stars: ✭ 479 (+725.86%)
Mutual labels:  ios11
Cardkit
iOS 11 cards in Swift
Stars: ✭ 47 (-18.97%)
Mutual labels:  ios11
Ios 11.1.2 15b202 Jailbreak
iOS 11.1.2 (15B202) Jailbreak
Stars: ✭ 413 (+612.07%)
Mutual labels:  ios11
Awesome Ios Interview
📲 The curated list of iOS Developer interview questions and answers, Swift & Objective-C
Stars: ✭ 753 (+1198.28%)
Mutual labels:  ios11
Ios Imessage Stickers Icon Sketch Template
🎈 iOS iMessage stickers icon template for Sketch
Stars: ✭ 56 (-3.45%)
Mutual labels:  ios11
Facevision
iOS11 Vision framework example. Detection of face landmarks
Stars: ✭ 47 (-18.97%)
Mutual labels:  ios11
Basketballarkit
Hello Everyone, This project talks about basics of ARKit introduced by Apple in iOS11. Please note that ARKit is only capable wih devices which use A9, A10, A11 chips .It shows how to build a basic BasketBall app using ARKit. All written in Swift4.
Stars: ✭ 42 (-27.59%)
Mutual labels:  ios11

UINavigationBar-FixedHeightWhenStatusBarHidden

Version License Platform

Normally on iOS 7+ navigation bar height equals to 64 px, when status bar is shown. After it is hidden, the height is changed to 44 px by default.

This category adds property fixedHeightWhenStatusBarHidden to UINavigationBar class. If set to YES navigation bar will keep its size even if status bar was hidden.

This is especially useful in case of "drawer"-styled side panel, when you want status bar to be hidden when this panel is shown.

Installation

Manual:
Copy source files from UINavigationBar-FixedHeightWhenStatusBarHidden folder to your Xcode project.

CocoaPods:
UINavigationBar-FixedHeightWhenStatusBarHidden is available through CocoaPods. To install it, add the following line to your Podfile:

pod 'UINavigationBar-FixedHeightWhenStatusBarHidden'

How to Use

Add #import "UINavigationBar+FixedHeightWhenStatusBarHidden.h".

Enable fixed height with:

self.navigationController.navigationBar.fixedHeightWhenStatusBarHidden = YES;

On iOS 11+ you should also set correct additional safe area insets on each view controller presented inside UINavigationController with fixed height enabled. This can be done by overriding viewWillLayoutSubviews of UIViewController. Then you can install the required insets automatically:

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    [self.navigationController.navigationBar setAdditionalSafeAreaInsetsForViewController:self];	
}

Or in case you need to customize insets, use [UINavigationBar additionalSafeAreaInsets] selector to get insets required for fixed height to work and modify them according to your needs:

- (void)viewWillLayoutSubviews {
   [super viewWillLayoutSubviews];

    if (@available(iOS 11.0, *)) {
        UIEdgeInsets navigationBarSafeAreaInsets = [self.navigationController.navigationBar additionalSafeAreaInsets];
        self.additionalSafeAreaInsets = UIEdgeInsetsMake(navigationBarSafeAreaInsets.top + 20, 0, 0, 0);
    }
}

License

UINavigationBar-FixedHeightWhenStatusBarHidden is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].