passing streamViewBounds

This commit is contained in:
TrueZhuangjia
2025-03-29 19:43:03 +08:00
committed by TrueZhuanjia
parent bd83af8bf4
commit 94f2e39367
7 changed files with 20 additions and 9 deletions
@@ -112,7 +112,7 @@
- (void) viewDidLoad {
[super viewDidLoad];
profilesManager = [OSCProfilesManager sharedManager];
profilesManager = [OSCProfilesManager sharedManager:self.view.bounds];
self.OnScreenWidgetViews = [[NSMutableSet alloc] init]; // will be revised to read persisted data , somewhere else
[OSCProfilesManager setOnScreenWidgetViewsSet:self.OnScreenWidgetViews]; // pass the keyboard button dict to profiles manager
@@ -811,7 +811,8 @@
storyboard = [UIStoryboard storyboardWithName:@"iPad" bundle:nil];
}
_oscProfilesTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"OSCProfilesTableViewController"] ;
_oscProfilesTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"OSCProfilesTableViewController"];
_oscProfilesTableViewController.streamViewBounds = self.view.bounds;
_oscProfilesTableViewController.needToUpdateOscLayoutTVC = ^() { // a block that will be called when the modally presented 'OSCProfilesTableViewController' VC is dismissed. By the time the 'OSCProfilesTableViewController' VC is dismissed the user would have potentially selected a different OSC ofile with a different layout and they want to see this layout on this 'LayoutOnScreenControlsViewController.' This block of code will load the profile and then hide/show and move each OSC button to their appropriate position
[self.layoutOSC updateControls]; // creates and saves a 'Default' OSC profile or loads the one the user selected on the previous screen
@@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, copy) void (^needToUpdateOscLayoutTVC)(void);
@property (nonatomic, assign) NSMutableArray *currentOSCButtonLayers;
@property (nonatomic, assign) CGRect streamViewBounds;
@end
@@ -49,7 +49,7 @@ const double NAV_BAR_HEIGHT = 50;
[super viewDidLoad];
profilesManager = [OSCProfilesManager sharedManager];
profilesManager = [OSCProfilesManager sharedManager:_streamViewBounds];
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, NAV_BAR_HEIGHT)];