//
//  GMPhotoCustomNavigationBar.m
//  GMAlbum
//
//  Created by Q14 on 2018/10/9.
//  Copyright © 2018年 Q14. All rights reserved.
//

#import "GMPhotoCustomNavigationBar.h"
#import "GMPhotoCustomNavigationBar.h"
#import "GMPhotoDefine.h"
#import "UIView+GMExtension.h"

@implementation GMPhotoCustomNavigationBar

- (void)layoutSubviews {
    [super layoutSubviews];
#ifdef __IPHONE_11_0
    if (@available(iOS 11.0, *)) {
        self.gm_h = OCNavigationBar.barHeight;
        for (UIView *view in self.subviews) {
            if([NSStringFromClass([view class]) containsString:@"Background"]) {
                view.frame = self.bounds;
            }
            else if ([NSStringFromClass([view class]) containsString:@"ContentView"]) {
                CGRect frame = view.frame;
                frame.origin.y = OCNavigationBar.barHeight - 44;
                frame.size.height = self.bounds.size.height - frame.origin.y;
                view.frame = frame;
            }
        }
    }
#endif
}
@end
