mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 08:32:53 +02:00
Move NSTextAttachment view provider registration to finalizeInit
This commit is contained in:
@@ -276,23 +276,10 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Register provider for Pills.
|
||||
+ (void)registerPillAttachmentViewProviderIfNeeded
|
||||
{
|
||||
if (@available(iOS 15.0, *))
|
||||
{
|
||||
if (![NSTextAttachment textAttachmentViewProviderClassForFileType:PillsFormatter.pillUTType])
|
||||
{
|
||||
[NSTextAttachment registerTextAttachmentViewProviderClass:PillAttachmentViewProvider.class forFileType:PillsFormatter.pillUTType];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil
|
||||
{
|
||||
[RoomViewController registerPillAttachmentViewProviderIfNeeded];
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self)
|
||||
{
|
||||
@@ -308,7 +295,6 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
|
||||
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
[RoomViewController registerPillAttachmentViewProviderIfNeeded];
|
||||
self = [super initWithCoder:aDecoder];
|
||||
if (self)
|
||||
{
|
||||
@@ -327,7 +313,8 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
- (void)finalizeInit
|
||||
{
|
||||
[super finalizeInit];
|
||||
|
||||
|
||||
[self registerPillAttachmentViewProviderIfNeeded];
|
||||
self.resizeComposerAnimationDuration = kResizeComposerAnimationDuration;
|
||||
|
||||
// Setup `MXKViewControllerHandling` properties
|
||||
@@ -7569,4 +7556,17 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
[self stopActivityIndicator];
|
||||
}
|
||||
|
||||
#pragma mark - Pills
|
||||
/// Register provider for Pills.
|
||||
- (void)registerPillAttachmentViewProviderIfNeeded
|
||||
{
|
||||
if (@available(iOS 15.0, *))
|
||||
{
|
||||
if (![NSTextAttachment textAttachmentViewProviderClassForFileType:PillsFormatter.pillUTType])
|
||||
{
|
||||
[NSTextAttachment registerTextAttachmentViewProviderClass:PillAttachmentViewProvider.class forFileType:PillsFormatter.pillUTType];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user