mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Move attachment registration to RoomViewController
This commit is contained in:
@@ -276,10 +276,23 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Register provider for Pills.
|
||||
+ (void)registerPillAttachmentViewProviderIfNeeded
|
||||
{
|
||||
if (@available(iOS 15.0, *))
|
||||
{
|
||||
if (![NSTextAttachment textAttachmentViewProviderClassForFileType:StringPillsUtils.pillUTType])
|
||||
{
|
||||
[NSTextAttachment registerTextAttachmentViewProviderClass:PillAttachmentViewProvider.class forFileType:StringPillsUtils.pillUTType];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil
|
||||
{
|
||||
[RoomViewController registerPillAttachmentViewProviderIfNeeded];
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self)
|
||||
{
|
||||
@@ -295,6 +308,7 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
|
||||
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
[RoomViewController registerPillAttachmentViewProviderIfNeeded];
|
||||
self = [super initWithCoder:aDecoder];
|
||||
if (self)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user