mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 00:52:43 +02:00
Load correct instance of RoomViewController from the storyboard
This commit is contained in:
@@ -284,11 +284,22 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||
+ (instancetype)instantiateWithConfiguration:(RoomDisplayConfiguration *)configuration
|
||||
{
|
||||
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
|
||||
RoomViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"RoomViewControllerStoryboardId"];
|
||||
NSString *storyboardId = [NSString stringWithFormat:@"%@StoryboardId", self.className];
|
||||
RoomViewController *controller = [storyboard instantiateViewControllerWithIdentifier:storyboardId];
|
||||
controller.displayConfiguration = configuration;
|
||||
return controller;
|
||||
}
|
||||
|
||||
+ (NSString *)className
|
||||
{
|
||||
NSString *result = NSStringFromClass(self.class);
|
||||
if ([result containsString:@"."])
|
||||
{
|
||||
result = [result componentsSeparatedByString:@"."].lastObject;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil
|
||||
|
||||
Reference in New Issue
Block a user