Signal-iOS/SignalUI/ViewControllers/OWSViewControllerObjc.h
Harry 520faa95df
Refactor OWSNavigationController
* make shouldCancelNavigationBack a var

* rename OWSNavigationView->OWSNavigationChildController

* forward delegate calls to OWSNavigationController

* apply theme and style to OWSNavigationBar consistently

fix themeing on gif picker controller

* Use topPinned navbar position. Size the blur effect view using the background view

* Use fade animation when hiding the navigation bar

* fix issues with reduced transparency setting

* pr feedback
2022-11-03 16:40:47 -07:00

52 lines
1.9 KiB
Objective-C

//
// Copyright 2014 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSViewControllerObjc : UIViewController
@property (nonatomic) BOOL shouldIgnoreKeyboardChanges;
@property (nonatomic) BOOL shouldUseTheme;
@property (nonatomic, nullable) UIColor *navbarBackgroundColorOverride;
@property (nonatomic) NSInteger preferredNavigationBarStyle;
@property (nonatomic) BOOL prefersNavigationBarHidden;
@property (nonatomic) BOOL shouldCancelNavigationBack;
// We often want to pin one view to the bottom of a view controller
// BUT adjust its location upward if the keyboard appears.
- (NSLayoutConstraint *)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view avoidNotch:(BOOL)avoidNotch;
// Use this variant for view controllers who's view is not full screen (such as sheets)
- (NSLayoutConstraint *)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view
avoidNotch:(BOOL)avoidNotch
adjustmentWithKeyboardPresented:(CGFloat)adjustment;
- (void)removeBottomLayout;
// Override point for any custom handling of keyboard constraint insets
// Invoked while embedded in an appropriate UIAnimationCurve
// Default implementation sets the underlying keyboard constraint offset to `after`
- (void)updateBottomLayoutConstraintFromInset:(CGFloat)before toInset:(CGFloat)after;
// If YES, the bottom view never "reclaims" layout space if the keyboard is dismissed.
// Defaults to NO.
@property (nonatomic) BOOL shouldBottomViewReserveSpaceForKeyboard;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil
bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
- (void)themeDidChange;
- (void)applyTheme;
@end
NS_ASSUME_NONNULL_END