Browse Source

Expose `toolbar` as a public property on FLEXManager

Tanner Bennett 4 years ago
parent
commit
7329fd9272

+ 3 - 1
Classes/ExplorerInterface/FLEXExplorerViewController.h

@@ -6,7 +6,7 @@
 //  Copyright (c) 2014 Flipboard. All rights reserved.
 //
 
-#import <UIKit/UIKit.h>
+#import "FLEXExplorerToolbar.h"
 
 @class FLEXWindow;
 @protocol FLEXExplorerViewControllerDelegate;
@@ -17,6 +17,8 @@
 @property (nonatomic, weak) id <FLEXExplorerViewControllerDelegate> delegate;
 @property (nonatomic, readonly) BOOL wantsWindowToBecomeKey;
 
+@property (nonatomic, readonly) FLEXExplorerToolbar *explorerToolbar;
+
 - (BOOL)shouldReceiveTouchAtWindowPoint:(CGPoint)pointInWindowCoordinates;
 
 /// @brief Used to present (or dismiss) a modal view controller ("tool"), typically triggered by pressing a button in the toolbar.

+ 1 - 4
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -7,7 +7,6 @@
 //
 
 #import "FLEXExplorerViewController.h"
-#import "FLEXExplorerToolbar.h"
 #import "FLEXToolbarItem.h"
 #import "FLEXUtility.h"
 #import "FLEXWindow.h"
@@ -31,8 +30,6 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 @interface FLEXExplorerViewController () <FLEXHierarchyDelegate, UIAdaptivePresentationControllerDelegate>
 
-@property (nonatomic) FLEXExplorerToolbar *explorerToolbar;
-
 /// Tracks the currently active tool/mode
 @property (nonatomic) FLEXExplorerMode currentMode;
 
@@ -92,7 +89,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [super viewDidLoad];
 
     // Toolbar
-    self.explorerToolbar = [FLEXExplorerToolbar new];
+    _explorerToolbar = [FLEXExplorerToolbar new];
 
     // Start the toolbar off below any bars that may be at the top of the view.
     CGFloat toolbarOriginY = NSUserDefaults.standardUserDefaults.flex_toolbarTopMargin;

+ 2 - 1
Classes/FLEXManager.h

@@ -6,7 +6,7 @@
 //  Copyright (c) 2014 Flipboard. All rights reserved.
 //
 
-#import <UIKit/UIKit.h>
+#import "FLEXExplorerToolbar.h"
 
 #if !FLEX_AT_LEAST_IOS13_SDK
 @class UIWindowScene;
@@ -17,6 +17,7 @@
 @property (nonatomic, readonly, class) FLEXManager *sharedManager;
 
 @property (nonatomic, readonly) BOOL isHidden;
+@property (nonatomic, readonly) FLEXExplorerToolbar *toolbar;
 
 - (void)showExplorer;
 - (void)hideExplorer;

+ 4 - 0
Classes/Manager/FLEXManager.m

@@ -104,6 +104,10 @@
     return self.explorerWindow.isHidden;
 }
 
+- (FLEXExplorerToolbar *)toolbar {
+    return self.explorerViewController.explorerToolbar;
+}
+
 
 #pragma mark - FLEXWindowEventDelegate
 

+ 1 - 1
FLEX.xcodeproj/project.pbxproj

@@ -134,7 +134,7 @@
 		94A5151E1C4CA1F10063292F /* FLEXExplorerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 94A5151A1C4CA1F10063292F /* FLEXExplorerViewController.m */; };
 		94A5151F1C4CA1F10063292F /* FLEXWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 94A5151B1C4CA1F10063292F /* FLEXWindow.h */; };
 		94A515201C4CA1F10063292F /* FLEXWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 94A5151C1C4CA1F10063292F /* FLEXWindow.m */; };
-		94A515251C4CA2080063292F /* FLEXExplorerToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 94A515211C4CA2080063292F /* FLEXExplorerToolbar.h */; };
+		94A515251C4CA2080063292F /* FLEXExplorerToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 94A515211C4CA2080063292F /* FLEXExplorerToolbar.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		94A515261C4CA2080063292F /* FLEXExplorerToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 94A515221C4CA2080063292F /* FLEXExplorerToolbar.m */; };
 		94A515271C4CA2080063292F /* FLEXToolbarItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 94A515231C4CA2080063292F /* FLEXToolbarItem.h */; };
 		94A515281C4CA2080063292F /* FLEXToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 94A515241C4CA2080063292F /* FLEXToolbarItem.m */; };