mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 13:16:58 +02:00
Fixed various project warnings. Completely disabled nullability checks, went down from ~20k to 195.
This commit is contained in:
committed by
Stefan Ceriu
parent
e0437b0124
commit
bc60512101
@@ -175,7 +175,11 @@
|
||||
_attachmentsCollection.hidden = YES;
|
||||
|
||||
// Display collection cell in full screen
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (BOOL)prefersStatusBarHidden
|
||||
|
||||
@@ -215,6 +215,8 @@
|
||||
// and report the inputAccessoryView.superview of the firstResponder in self.keyboardView.
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom inset for the scroll view (Don't forget the potential tabBar)
|
||||
@@ -229,6 +231,7 @@
|
||||
insets.bottom = scrollViewInsetBottom;
|
||||
self.authenticationScrollView.contentInset = insets;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
|
||||
@@ -152,7 +152,7 @@ NSString* const kMXKCountryPickerViewControllerCountryCellId = @"kMXKCountryPick
|
||||
{
|
||||
UISearchController *searchController = [[UISearchController alloc]
|
||||
initWithSearchResultsController:nil];
|
||||
searchController.dimsBackgroundDuringPresentation = NO;
|
||||
searchController.obscuresBackgroundDuringPresentation = NO;
|
||||
searchController.hidesNavigationBarDuringPresentation = NO;
|
||||
searchController.searchResultsUpdater = self;
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@
|
||||
[[[self class] nib] instantiateWithOwner:self options:nil];
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
// Adjust search bar Top constraint to take into account potential navBar.
|
||||
if (_groupsSearchBarTopConstraint)
|
||||
{
|
||||
@@ -123,6 +125,7 @@
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[_groupsTableViewBottomConstraint]];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Hide search bar by default
|
||||
[self hideSearchBar:YES];
|
||||
@@ -209,6 +212,8 @@
|
||||
self.keyboardView = _groupsSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -225,6 +230,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ NSString* const kMXKLanguagePickerCellDataKeyLanguage = @"language";
|
||||
{
|
||||
UISearchController *searchController = [[UISearchController alloc]
|
||||
initWithSearchResultsController:nil];
|
||||
searchController.dimsBackgroundDuringPresentation = NO;
|
||||
searchController.obscuresBackgroundDuringPresentation = NO;
|
||||
searchController.hidesNavigationBarDuringPresentation = NO;
|
||||
searchController.searchResultsUpdater = self;
|
||||
|
||||
|
||||
@@ -97,6 +97,8 @@
|
||||
[[[self class] nib] instantiateWithOwner:self options:nil];
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
// Adjust search bar Top constraint to take into account potential navBar.
|
||||
if (_recentsSearchBarTopConstraint)
|
||||
{
|
||||
@@ -126,6 +128,7 @@
|
||||
|
||||
_recentsTableViewBottomConstraint.active = YES;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Hide search bar by default
|
||||
[self hideSearchBar:YES];
|
||||
@@ -229,6 +232,8 @@
|
||||
self.keyboardView = _recentsSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -245,6 +250,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
// Adjust Top and Bottom constraints to take into account potential navBar and tabBar.
|
||||
[NSLayoutConstraint deactivateConstraints:@[_membersSearchBarTopConstraint, _membersTableViewBottomConstraint]];
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
_membersSearchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide
|
||||
attribute:NSLayoutAttributeBottom
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -120,6 +122,7 @@
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1.0f
|
||||
constant:0.0f];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[_membersSearchBarTopConstraint, _membersTableViewBottomConstraint]];
|
||||
|
||||
@@ -225,6 +228,8 @@
|
||||
self.keyboardView = _membersSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -241,6 +246,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
// Adjust Top and Bottom constraints to take into account potential navBar and tabBar.
|
||||
[NSLayoutConstraint deactivateConstraints:@[_searchSearchBarTopConstraint, _searchTableViewBottomConstraint]];
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
_searchSearchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide
|
||||
attribute:NSLayoutAttributeBottom
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -91,6 +93,7 @@
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1.0f
|
||||
constant:0.0f];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[_searchSearchBarTopConstraint, _searchTableViewBottomConstraint]];
|
||||
|
||||
@@ -140,6 +143,8 @@
|
||||
self.keyboardView = _searchSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -156,6 +161,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
|
||||
@@ -133,6 +133,9 @@ NSString *const kMXKWebViewViewControllerJavaScriptEnableLog =
|
||||
multiplier:1.0
|
||||
constant:0];
|
||||
// Force webview in full height
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:webView
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -147,6 +150,7 @@ NSString *const kMXKWebViewViewControllerJavaScriptEnableLog =
|
||||
attribute:NSLayoutAttributeTop
|
||||
multiplier:1.0
|
||||
constant:0];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[leftConstraint, rightConstraint, topConstraint, bottomConstraint]];
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ public class UTI: RawRepresentable, Equatable {
|
||||
// UTTypeCreatePreferredIdentifierForTag only returns nil if the tag class is unknwown, which can't happen to us since we use an
|
||||
// enum of known values. Hence we can force-cast the result.
|
||||
|
||||
// swiftlint:disable force_unwrapping
|
||||
let identifier = (unmanagedIdentifier?.takeRetainedValue() as String?)!
|
||||
// swiftlint:enable force_unwrapping
|
||||
|
||||
self.init(rawValue: identifier)
|
||||
}
|
||||
@@ -122,7 +124,7 @@ public class UTI: RawRepresentable, Equatable {
|
||||
|
||||
public convenience init(withExtension fileExtension: String, conformingTo conforming: UTI? = nil) {
|
||||
|
||||
self.init(withTagClass:.fileExtension, value: fileExtension, conformingTo: conforming)
|
||||
self.init(withTagClass: .fileExtension, value: fileExtension, conformingTo: conforming)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +140,7 @@ public class UTI: RawRepresentable, Equatable {
|
||||
|
||||
public convenience init(withMimeType mimeType: String, conformingTo conforming: UTI? = nil) {
|
||||
|
||||
self.init(withTagClass:.mimeType, value: mimeType, conformingTo: conforming)
|
||||
self.init(withTagClass: .mimeType, value: mimeType, conformingTo: conforming)
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
@@ -146,7 +148,9 @@ public class UTI: RawRepresentable, Equatable {
|
||||
/**
|
||||
|
||||
Initialize an UTI with a pasteboard type.
|
||||
- Important: **This function is de-facto deprecated!** The old cocoa pasteboard types ( `NSStringPboardType`, `NSPDFPboardType`, etc) have been deprecated in favour of actual UTIs, and the constants are not available anymore in Swift. This function only works correctly with the values of these old constants, but _not_ with the replacement values (like `NSPasteboardTypeString` etc), since these already are UTIs.
|
||||
- Important: **This function is de-facto deprecated!** The old cocoa pasteboard types ( `NSStringPboardType`, `NSPDFPboardType`, etc) have been deprecated in favour of actual UTIs, and the
|
||||
constants are not available anymore in Swift. This function only works correctly with the values of these old constants, but _not_ with the replacement values (like `NSPasteboardTypeString` etc), since these
|
||||
already are UTIs.
|
||||
- Parameters:
|
||||
- pbType: The pasteboard type (e.g. NSPDFPboardType).
|
||||
- conformingTo: If specified, the returned UTI must conform to this UTI. If nil is specified, this parameter is ignored. The default is nil.
|
||||
@@ -155,7 +159,7 @@ public class UTI: RawRepresentable, Equatable {
|
||||
*/
|
||||
public convenience init(withPBType pbType: String, conformingTo conforming: UTI? = nil) {
|
||||
|
||||
self.init(withTagClass:.pbType, value: pbType, conformingTo: conforming)
|
||||
self.init(withTagClass: .pbType, value: pbType, conformingTo: conforming)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,7 +176,7 @@ public class UTI: RawRepresentable, Equatable {
|
||||
|
||||
public convenience init(withOSType osType: String, conformingTo conforming: UTI? = nil) {
|
||||
|
||||
self.init(withTagClass:.osType, value: osType, conformingTo: conforming)
|
||||
self.init(withTagClass: .osType, value: osType, conformingTo: conforming)
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -297,7 +301,7 @@ public class UTI: RawRepresentable, Equatable {
|
||||
return UTTypeConformsTo(self.rawCFValue, otherUTI.rawCFValue) as Bool
|
||||
}
|
||||
|
||||
public static func ==(lhs: UTI, rhs: UTI) -> Bool {
|
||||
public static func == (lhs: UTI, rhs: UTI) -> Bool {
|
||||
|
||||
return UTTypeEqual(lhs.rawCFValue, rhs.rawCFValue) as Bool
|
||||
}
|
||||
@@ -319,11 +323,11 @@ public class UTI: RawRepresentable, Equatable {
|
||||
|
||||
/// Returns a uniform type’s declaration as a Dictionary, or nil if if no declaration for that type can be found.
|
||||
|
||||
public var declaration: [AnyHashable:Any]? {
|
||||
public var declaration: [AnyHashable: Any]? {
|
||||
|
||||
let unmanagedDeclaration = UTTypeCopyDeclaration(self.rawCFValue)
|
||||
|
||||
guard let declaration = unmanagedDeclaration?.takeRetainedValue() as? [AnyHashable:Any] else {
|
||||
guard let declaration = unmanagedDeclaration?.takeRetainedValue() as? [AnyHashable: Any] else {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -356,137 +360,137 @@ public class UTI: RawRepresentable, Equatable {
|
||||
|
||||
public extension UTI {
|
||||
|
||||
static let item = UTI(rawValue: kUTTypeItem as String)
|
||||
static let content = UTI(rawValue: kUTTypeContent as String)
|
||||
static let compositeContent = UTI(rawValue: kUTTypeCompositeContent as String)
|
||||
static let message = UTI(rawValue: kUTTypeMessage as String)
|
||||
static let contact = UTI(rawValue: kUTTypeContact as String)
|
||||
static let archive = UTI(rawValue: kUTTypeArchive as String)
|
||||
static let diskImage = UTI(rawValue: kUTTypeDiskImage as String)
|
||||
static let data = UTI(rawValue: kUTTypeData as String)
|
||||
static let directory = UTI(rawValue: kUTTypeDirectory as String)
|
||||
static let resolvable = UTI(rawValue: kUTTypeResolvable as String)
|
||||
static let symLink = UTI(rawValue: kUTTypeSymLink as String)
|
||||
static let executable = UTI(rawValue: kUTTypeExecutable as String)
|
||||
static let mountPoint = UTI(rawValue: kUTTypeMountPoint as String)
|
||||
static let aliasFile = UTI(rawValue: kUTTypeAliasFile as String)
|
||||
static let aliasRecord = UTI(rawValue: kUTTypeAliasRecord as String)
|
||||
static let urlBookmarkData = UTI(rawValue: kUTTypeURLBookmarkData as String)
|
||||
static let url = UTI(rawValue: kUTTypeURL as String)
|
||||
static let fileURL = UTI(rawValue: kUTTypeFileURL as String)
|
||||
static let text = UTI(rawValue: kUTTypeText as String)
|
||||
static let plainText = UTI(rawValue: kUTTypePlainText as String)
|
||||
static let utf8PlainText = UTI(rawValue: kUTTypeUTF8PlainText as String)
|
||||
static let utf16ExternalPlainText = UTI(rawValue: kUTTypeUTF16ExternalPlainText as String)
|
||||
static let utf16PlainText = UTI(rawValue: kUTTypeUTF16PlainText as String)
|
||||
static let delimitedText = UTI(rawValue: kUTTypeDelimitedText as String)
|
||||
static let commaSeparatedText = UTI(rawValue: kUTTypeCommaSeparatedText as String)
|
||||
static let tabSeparatedText = UTI(rawValue: kUTTypeTabSeparatedText as String)
|
||||
static let utf8TabSeparatedText = UTI(rawValue: kUTTypeUTF8TabSeparatedText as String)
|
||||
static let rtf = UTI(rawValue: kUTTypeRTF as String)
|
||||
static let html = UTI(rawValue: kUTTypeHTML as String)
|
||||
static let xml = UTI(rawValue: kUTTypeXML as String)
|
||||
static let sourceCode = UTI(rawValue: kUTTypeSourceCode as String)
|
||||
static let assemblyLanguageSource = UTI(rawValue: kUTTypeAssemblyLanguageSource as String)
|
||||
static let cSource = UTI(rawValue: kUTTypeCSource as String)
|
||||
static let objectiveCSource = UTI(rawValue: kUTTypeObjectiveCSource as String)
|
||||
static let item = UTI(rawValue: kUTTypeItem as String)
|
||||
static let content = UTI(rawValue: kUTTypeContent as String)
|
||||
static let compositeContent = UTI(rawValue: kUTTypeCompositeContent as String)
|
||||
static let message = UTI(rawValue: kUTTypeMessage as String)
|
||||
static let contact = UTI(rawValue: kUTTypeContact as String)
|
||||
static let archive = UTI(rawValue: kUTTypeArchive as String)
|
||||
static let diskImage = UTI(rawValue: kUTTypeDiskImage as String)
|
||||
static let data = UTI(rawValue: kUTTypeData as String)
|
||||
static let directory = UTI(rawValue: kUTTypeDirectory as String)
|
||||
static let resolvable = UTI(rawValue: kUTTypeResolvable as String)
|
||||
static let symLink = UTI(rawValue: kUTTypeSymLink as String)
|
||||
static let executable = UTI(rawValue: kUTTypeExecutable as String)
|
||||
static let mountPoint = UTI(rawValue: kUTTypeMountPoint as String)
|
||||
static let aliasFile = UTI(rawValue: kUTTypeAliasFile as String)
|
||||
static let aliasRecord = UTI(rawValue: kUTTypeAliasRecord as String)
|
||||
static let urlBookmarkData = UTI(rawValue: kUTTypeURLBookmarkData as String)
|
||||
static let url = UTI(rawValue: kUTTypeURL as String)
|
||||
static let fileURL = UTI(rawValue: kUTTypeFileURL as String)
|
||||
static let text = UTI(rawValue: kUTTypeText as String)
|
||||
static let plainText = UTI(rawValue: kUTTypePlainText as String)
|
||||
static let utf8PlainText = UTI(rawValue: kUTTypeUTF8PlainText as String)
|
||||
static let utf16ExternalPlainText = UTI(rawValue: kUTTypeUTF16ExternalPlainText as String)
|
||||
static let utf16PlainText = UTI(rawValue: kUTTypeUTF16PlainText as String)
|
||||
static let delimitedText = UTI(rawValue: kUTTypeDelimitedText as String)
|
||||
static let commaSeparatedText = UTI(rawValue: kUTTypeCommaSeparatedText as String)
|
||||
static let tabSeparatedText = UTI(rawValue: kUTTypeTabSeparatedText as String)
|
||||
static let utf8TabSeparatedText = UTI(rawValue: kUTTypeUTF8TabSeparatedText as String)
|
||||
static let rtf = UTI(rawValue: kUTTypeRTF as String)
|
||||
static let html = UTI(rawValue: kUTTypeHTML as String)
|
||||
static let xml = UTI(rawValue: kUTTypeXML as String)
|
||||
static let sourceCode = UTI(rawValue: kUTTypeSourceCode as String)
|
||||
static let assemblyLanguageSource = UTI(rawValue: kUTTypeAssemblyLanguageSource as String)
|
||||
static let cSource = UTI(rawValue: kUTTypeCSource as String)
|
||||
static let objectiveCSource = UTI(rawValue: kUTTypeObjectiveCSource as String)
|
||||
@available( OSX 10.11, iOS 9.0, * )
|
||||
static let swiftSource = UTI(rawValue: kUTTypeSwiftSource as String)
|
||||
static let cPlusPlusSource = UTI(rawValue: kUTTypeCPlusPlusSource as String)
|
||||
static let objectiveCPlusPlusSource = UTI(rawValue: kUTTypeObjectiveCPlusPlusSource as String)
|
||||
static let cHeader = UTI(rawValue: kUTTypeCHeader as String)
|
||||
static let cPlusPlusHeader = UTI(rawValue: kUTTypeCPlusPlusHeader as String)
|
||||
static let javaSource = UTI(rawValue: kUTTypeJavaSource as String)
|
||||
static let script = UTI(rawValue: kUTTypeScript as String)
|
||||
static let appleScript = UTI(rawValue: kUTTypeAppleScript as String)
|
||||
static let osaScript = UTI(rawValue: kUTTypeOSAScript as String)
|
||||
static let osaScriptBundle = UTI(rawValue: kUTTypeOSAScriptBundle as String)
|
||||
static let javaScript = UTI(rawValue: kUTTypeJavaScript as String)
|
||||
static let shellScript = UTI(rawValue: kUTTypeShellScript as String)
|
||||
static let perlScript = UTI(rawValue: kUTTypePerlScript as String)
|
||||
static let pythonScript = UTI(rawValue: kUTTypePythonScript as String)
|
||||
static let rubyScript = UTI(rawValue: kUTTypeRubyScript as String)
|
||||
static let phpScript = UTI(rawValue: kUTTypePHPScript as String)
|
||||
static let json = UTI(rawValue: kUTTypeJSON as String)
|
||||
static let propertyList = UTI(rawValue: kUTTypePropertyList as String)
|
||||
static let xmlPropertyList = UTI(rawValue: kUTTypeXMLPropertyList as String)
|
||||
static let binaryPropertyList = UTI(rawValue: kUTTypeBinaryPropertyList as String)
|
||||
static let pdf = UTI(rawValue: kUTTypePDF as String)
|
||||
static let rtfd = UTI(rawValue: kUTTypeRTFD as String)
|
||||
static let flatRTFD = UTI(rawValue: kUTTypeFlatRTFD as String)
|
||||
static let txnTextAndMultimediaData = UTI(rawValue: kUTTypeTXNTextAndMultimediaData as String)
|
||||
static let webArchive = UTI(rawValue: kUTTypeWebArchive as String)
|
||||
static let image = UTI(rawValue: kUTTypeImage as String)
|
||||
static let jpeg = UTI(rawValue: kUTTypeJPEG as String)
|
||||
static let jpeg2000 = UTI(rawValue: kUTTypeJPEG2000 as String)
|
||||
static let tiff = UTI(rawValue: kUTTypeTIFF as String)
|
||||
static let pict = UTI(rawValue: kUTTypePICT as String)
|
||||
static let gif = UTI(rawValue: kUTTypeGIF as String)
|
||||
static let png = UTI(rawValue: kUTTypePNG as String)
|
||||
static let quickTimeImage = UTI(rawValue: kUTTypeQuickTimeImage as String)
|
||||
static let appleICNS = UTI(rawValue: kUTTypeAppleICNS as String)
|
||||
static let bmp = UTI(rawValue: kUTTypeBMP as String)
|
||||
static let ico = UTI(rawValue: kUTTypeICO as String)
|
||||
static let rawImage = UTI(rawValue: kUTTypeRawImage as String)
|
||||
static let scalableVectorGraphics = UTI(rawValue: kUTTypeScalableVectorGraphics as String)
|
||||
static let swiftSource = UTI(rawValue: kUTTypeSwiftSource as String)
|
||||
static let cPlusPlusSource = UTI(rawValue: kUTTypeCPlusPlusSource as String)
|
||||
static let objectiveCPlusPlusSource = UTI(rawValue: kUTTypeObjectiveCPlusPlusSource as String)
|
||||
static let cHeader = UTI(rawValue: kUTTypeCHeader as String)
|
||||
static let cPlusPlusHeader = UTI(rawValue: kUTTypeCPlusPlusHeader as String)
|
||||
static let javaSource = UTI(rawValue: kUTTypeJavaSource as String)
|
||||
static let script = UTI(rawValue: kUTTypeScript as String)
|
||||
static let appleScript = UTI(rawValue: kUTTypeAppleScript as String)
|
||||
static let osaScript = UTI(rawValue: kUTTypeOSAScript as String)
|
||||
static let osaScriptBundle = UTI(rawValue: kUTTypeOSAScriptBundle as String)
|
||||
static let javaScript = UTI(rawValue: kUTTypeJavaScript as String)
|
||||
static let shellScript = UTI(rawValue: kUTTypeShellScript as String)
|
||||
static let perlScript = UTI(rawValue: kUTTypePerlScript as String)
|
||||
static let pythonScript = UTI(rawValue: kUTTypePythonScript as String)
|
||||
static let rubyScript = UTI(rawValue: kUTTypeRubyScript as String)
|
||||
static let phpScript = UTI(rawValue: kUTTypePHPScript as String)
|
||||
static let json = UTI(rawValue: kUTTypeJSON as String)
|
||||
static let propertyList = UTI(rawValue: kUTTypePropertyList as String)
|
||||
static let xmlPropertyList = UTI(rawValue: kUTTypeXMLPropertyList as String)
|
||||
static let binaryPropertyList = UTI(rawValue: kUTTypeBinaryPropertyList as String)
|
||||
static let pdf = UTI(rawValue: kUTTypePDF as String)
|
||||
static let rtfd = UTI(rawValue: kUTTypeRTFD as String)
|
||||
static let flatRTFD = UTI(rawValue: kUTTypeFlatRTFD as String)
|
||||
static let txnTextAndMultimediaData = UTI(rawValue: kUTTypeTXNTextAndMultimediaData as String)
|
||||
static let webArchive = UTI(rawValue: kUTTypeWebArchive as String)
|
||||
static let image = UTI(rawValue: kUTTypeImage as String)
|
||||
static let jpeg = UTI(rawValue: kUTTypeJPEG as String)
|
||||
static let jpeg2000 = UTI(rawValue: kUTTypeJPEG2000 as String)
|
||||
static let tiff = UTI(rawValue: kUTTypeTIFF as String)
|
||||
static let pict = UTI(rawValue: kUTTypePICT as String)
|
||||
static let gif = UTI(rawValue: kUTTypeGIF as String)
|
||||
static let png = UTI(rawValue: kUTTypePNG as String)
|
||||
static let quickTimeImage = UTI(rawValue: kUTTypeQuickTimeImage as String)
|
||||
static let appleICNS = UTI(rawValue: kUTTypeAppleICNS as String)
|
||||
static let bmp = UTI(rawValue: kUTTypeBMP as String)
|
||||
static let ico = UTI(rawValue: kUTTypeICO as String)
|
||||
static let rawImage = UTI(rawValue: kUTTypeRawImage as String)
|
||||
static let scalableVectorGraphics = UTI(rawValue: kUTTypeScalableVectorGraphics as String)
|
||||
@available(OSX 10.12, iOS 9.1, watchOS 2.1, *)
|
||||
static let livePhoto = UTI(rawValue: kUTTypeLivePhoto as String)
|
||||
static let livePhoto = UTI(rawValue: kUTTypeLivePhoto as String)
|
||||
@available(OSX 10.12, iOS 9.1, *)
|
||||
static let audiovisualContent = UTI(rawValue: kUTTypeAudiovisualContent as String)
|
||||
static let movie = UTI(rawValue: kUTTypeMovie as String)
|
||||
static let video = UTI(rawValue: kUTTypeVideo as String)
|
||||
static let audio = UTI(rawValue: kUTTypeAudio as String)
|
||||
static let quickTimeMovie = UTI(rawValue: kUTTypeQuickTimeMovie as String)
|
||||
static let mpeg = UTI(rawValue: kUTTypeMPEG as String)
|
||||
static let mpeg2Video = UTI(rawValue: kUTTypeMPEG2Video as String)
|
||||
static let mpeg2TransportStream = UTI(rawValue: kUTTypeMPEG2TransportStream as String)
|
||||
static let mp3 = UTI(rawValue: kUTTypeMP3 as String)
|
||||
static let mpeg4 = UTI(rawValue: kUTTypeMPEG4 as String)
|
||||
static let mpeg4Audio = UTI(rawValue: kUTTypeMPEG4Audio as String)
|
||||
static let appleProtectedMPEG4Audio = UTI(rawValue: kUTTypeAppleProtectedMPEG4Audio as String)
|
||||
static let appleProtectedMPEG4Video = UTI(rawValue: kUTTypeAppleProtectedMPEG4Video as String)
|
||||
static let aviMovie = UTI(rawValue: kUTTypeAVIMovie as String)
|
||||
static let audioInterchangeFileFormat = UTI(rawValue: kUTTypeAudioInterchangeFileFormat as String)
|
||||
static let waveformAudio = UTI(rawValue: kUTTypeWaveformAudio as String)
|
||||
static let midiAudio = UTI(rawValue: kUTTypeMIDIAudio as String)
|
||||
static let playlist = UTI(rawValue: kUTTypePlaylist as String)
|
||||
static let m3UPlaylist = UTI(rawValue: kUTTypeM3UPlaylist as String)
|
||||
static let folder = UTI(rawValue: kUTTypeFolder as String)
|
||||
static let volume = UTI(rawValue: kUTTypeVolume as String)
|
||||
static let package = UTI(rawValue: kUTTypePackage as String)
|
||||
static let bundle = UTI(rawValue: kUTTypeBundle as String)
|
||||
static let pluginBundle = UTI(rawValue: kUTTypePluginBundle as String)
|
||||
static let spotlightImporter = UTI(rawValue: kUTTypeSpotlightImporter as String)
|
||||
static let quickLookGenerator = UTI(rawValue: kUTTypeQuickLookGenerator as String)
|
||||
static let xpcService = UTI(rawValue: kUTTypeXPCService as String)
|
||||
static let framework = UTI(rawValue: kUTTypeFramework as String)
|
||||
static let application = UTI(rawValue: kUTTypeApplication as String)
|
||||
static let applicationBundle = UTI(rawValue: kUTTypeApplicationBundle as String)
|
||||
static let applicationFile = UTI(rawValue: kUTTypeApplicationFile as String)
|
||||
static let unixExecutable = UTI(rawValue: kUTTypeUnixExecutable as String)
|
||||
static let windowsExecutable = UTI(rawValue: kUTTypeWindowsExecutable as String)
|
||||
static let javaClass = UTI(rawValue: kUTTypeJavaClass as String)
|
||||
static let javaArchive = UTI(rawValue: kUTTypeJavaArchive as String)
|
||||
static let systemPreferencesPane = UTI(rawValue: kUTTypeSystemPreferencesPane as String)
|
||||
static let gnuZipArchive = UTI(rawValue: kUTTypeGNUZipArchive as String)
|
||||
static let bzip2Archive = UTI(rawValue: kUTTypeBzip2Archive as String)
|
||||
static let zipArchive = UTI(rawValue: kUTTypeZipArchive as String)
|
||||
static let spreadsheet = UTI(rawValue: kUTTypeSpreadsheet as String)
|
||||
static let presentation = UTI(rawValue: kUTTypePresentation as String)
|
||||
static let database = UTI(rawValue: kUTTypeDatabase as String)
|
||||
static let vCard = UTI(rawValue: kUTTypeVCard as String)
|
||||
static let toDoItem = UTI(rawValue: kUTTypeToDoItem as String)
|
||||
static let calendarEvent = UTI(rawValue: kUTTypeCalendarEvent as String)
|
||||
static let emailMessage = UTI(rawValue: kUTTypeEmailMessage as String)
|
||||
static let internetLocation = UTI(rawValue: kUTTypeInternetLocation as String)
|
||||
static let inkText = UTI(rawValue: kUTTypeInkText as String)
|
||||
static let font = UTI(rawValue: kUTTypeFont as String)
|
||||
static let bookmark = UTI(rawValue: kUTTypeBookmark as String)
|
||||
static let _3DContent = UTI(rawValue: kUTType3DContent as String)
|
||||
static let pkcs12 = UTI(rawValue: kUTTypePKCS12 as String)
|
||||
static let x509Certificate = UTI(rawValue: kUTTypeX509Certificate as String)
|
||||
static let electronicPublication = UTI(rawValue: kUTTypeElectronicPublication as String)
|
||||
static let log = UTI(rawValue: kUTTypeLog as String)
|
||||
static let audiovisualContent = UTI(rawValue: kUTTypeAudiovisualContent as String)
|
||||
static let movie = UTI(rawValue: kUTTypeMovie as String)
|
||||
static let video = UTI(rawValue: kUTTypeVideo as String)
|
||||
static let audio = UTI(rawValue: kUTTypeAudio as String)
|
||||
static let quickTimeMovie = UTI(rawValue: kUTTypeQuickTimeMovie as String)
|
||||
static let mpeg = UTI(rawValue: kUTTypeMPEG as String)
|
||||
static let mpeg2Video = UTI(rawValue: kUTTypeMPEG2Video as String)
|
||||
static let mpeg2TransportStream = UTI(rawValue: kUTTypeMPEG2TransportStream as String)
|
||||
static let mp3 = UTI(rawValue: kUTTypeMP3 as String)
|
||||
static let mpeg4 = UTI(rawValue: kUTTypeMPEG4 as String)
|
||||
static let mpeg4Audio = UTI(rawValue: kUTTypeMPEG4Audio as String)
|
||||
static let appleProtectedMPEG4Audio = UTI(rawValue: kUTTypeAppleProtectedMPEG4Audio as String)
|
||||
static let appleProtectedMPEG4Video = UTI(rawValue: kUTTypeAppleProtectedMPEG4Video as String)
|
||||
static let aviMovie = UTI(rawValue: kUTTypeAVIMovie as String)
|
||||
static let audioInterchangeFileFormat = UTI(rawValue: kUTTypeAudioInterchangeFileFormat as String)
|
||||
static let waveformAudio = UTI(rawValue: kUTTypeWaveformAudio as String)
|
||||
static let midiAudio = UTI(rawValue: kUTTypeMIDIAudio as String)
|
||||
static let playlist = UTI(rawValue: kUTTypePlaylist as String)
|
||||
static let m3UPlaylist = UTI(rawValue: kUTTypeM3UPlaylist as String)
|
||||
static let folder = UTI(rawValue: kUTTypeFolder as String)
|
||||
static let volume = UTI(rawValue: kUTTypeVolume as String)
|
||||
static let package = UTI(rawValue: kUTTypePackage as String)
|
||||
static let bundle = UTI(rawValue: kUTTypeBundle as String)
|
||||
static let pluginBundle = UTI(rawValue: kUTTypePluginBundle as String)
|
||||
static let spotlightImporter = UTI(rawValue: kUTTypeSpotlightImporter as String)
|
||||
static let quickLookGenerator = UTI(rawValue: kUTTypeQuickLookGenerator as String)
|
||||
static let xpcService = UTI(rawValue: kUTTypeXPCService as String)
|
||||
static let framework = UTI(rawValue: kUTTypeFramework as String)
|
||||
static let application = UTI(rawValue: kUTTypeApplication as String)
|
||||
static let applicationBundle = UTI(rawValue: kUTTypeApplicationBundle as String)
|
||||
static let applicationFile = UTI(rawValue: kUTTypeApplicationFile as String)
|
||||
static let unixExecutable = UTI(rawValue: kUTTypeUnixExecutable as String)
|
||||
static let windowsExecutable = UTI(rawValue: kUTTypeWindowsExecutable as String)
|
||||
static let javaClass = UTI(rawValue: kUTTypeJavaClass as String)
|
||||
static let javaArchive = UTI(rawValue: kUTTypeJavaArchive as String)
|
||||
static let systemPreferencesPane = UTI(rawValue: kUTTypeSystemPreferencesPane as String)
|
||||
static let gnuZipArchive = UTI(rawValue: kUTTypeGNUZipArchive as String)
|
||||
static let bzip2Archive = UTI(rawValue: kUTTypeBzip2Archive as String)
|
||||
static let zipArchive = UTI(rawValue: kUTTypeZipArchive as String)
|
||||
static let spreadsheet = UTI(rawValue: kUTTypeSpreadsheet as String)
|
||||
static let presentation = UTI(rawValue: kUTTypePresentation as String)
|
||||
static let database = UTI(rawValue: kUTTypeDatabase as String)
|
||||
static let vCard = UTI(rawValue: kUTTypeVCard as String)
|
||||
static let toDoItem = UTI(rawValue: kUTTypeToDoItem as String)
|
||||
static let calendarEvent = UTI(rawValue: kUTTypeCalendarEvent as String)
|
||||
static let emailMessage = UTI(rawValue: kUTTypeEmailMessage as String)
|
||||
static let internetLocation = UTI(rawValue: kUTTypeInternetLocation as String)
|
||||
static let inkText = UTI(rawValue: kUTTypeInkText as String)
|
||||
static let font = UTI(rawValue: kUTTypeFont as String)
|
||||
static let bookmark = UTI(rawValue: kUTTypeBookmark as String)
|
||||
static let _3DContent = UTI(rawValue: kUTType3DContent as String)
|
||||
static let pkcs12 = UTI(rawValue: kUTTypePKCS12 as String)
|
||||
static let x509Certificate = UTI(rawValue: kUTTypeX509Certificate as String)
|
||||
static let electronicPublication = UTI(rawValue: kUTTypeElectronicPublication as String)
|
||||
static let log = UTI(rawValue: kUTTypeLog as String)
|
||||
}
|
||||
|
||||
#if os(OSX)
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
#import "MXKRoomCreationView.h"
|
||||
|
||||
#import "MXKRoomInputToolbarView.h"
|
||||
#import "MXKRoomInputToolbarViewWithHPGrowingText.h"
|
||||
|
||||
#import "MXKRoomDataSourceManager.h"
|
||||
|
||||
|
||||
@@ -104,6 +104,8 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)saveAccounts
|
||||
{
|
||||
NSDate *startDate = [NSDate date];
|
||||
@@ -123,6 +125,7 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
|
||||
|
||||
MXLogDebug(@"[MXKAccountManager] saveAccounts. Done (result: %@) in %.0fms", @(result), [[NSDate date] timeIntervalSinceDate:startDate] * 1000);
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)addAccount:(MXKAccount *)account andOpenSession:(BOOL)openSession
|
||||
{
|
||||
@@ -608,6 +611,8 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
|
||||
return [matrixKitCacheFolder stringByAppendingPathComponent:kMXKAccountsKey];
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)loadAccounts
|
||||
{
|
||||
MXLogDebug(@"[MXKAccountManager] loadAccounts");
|
||||
@@ -675,6 +680,7 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
|
||||
mxAccounts = [NSMutableArray array];
|
||||
}
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (NSData*)encryptData:(NSData*)data
|
||||
{
|
||||
@@ -708,6 +714,8 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
|
||||
return data;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)migrateAccounts
|
||||
{
|
||||
NSString *pathOld = [[MXKAppSettings cacheFolder] stringByAppendingPathComponent:kMXKAccountsKeyOld];
|
||||
@@ -727,6 +735,7 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
|
||||
[fileManager removeItemAtPath:pathOld error:nil];
|
||||
}
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)readAndWriteCredentials:(void (^)(NSArray<MXCredentials*> * _Nullable readData, void (^completion)(BOOL didUpdateCredentials)))readAnWriteHandler
|
||||
{
|
||||
|
||||
@@ -93,6 +93,8 @@ extern NSString *const kMXKContactDefaultContactPrefixId;
|
||||
*/
|
||||
- (void)resetMatrixThumbnail;
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
/**
|
||||
The contact ID from native phonebook record
|
||||
*/
|
||||
@@ -105,6 +107,7 @@ extern NSString *const kMXKContactDefaultContactPrefixId;
|
||||
@return MXKContact instance
|
||||
*/
|
||||
- (id)initLocalContactWithABRecord:(ABRecordRef)record;
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
Create a matrix contact with the dedicated info
|
||||
|
||||
@@ -40,6 +40,8 @@ NSString *const kMXKContactDefaultContactPrefixId = @"Default_";
|
||||
@implementation MXKContact
|
||||
@synthesize isMatrixContact, isThirdPartyInvite;
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
+ (NSString*)contactID:(ABRecordRef)record
|
||||
{
|
||||
return [NSString stringWithFormat:@"%@%d", kMXKContactLocalContactPrefixId, ABRecordGetRecordID(record)];
|
||||
@@ -217,6 +219,7 @@ NSString *const kMXKContactDefaultContactPrefixId = @"Default_";
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (id)initMatrixContactWithDisplayName:(NSString*)displayName andMatrixID:(NSString*)matrixID
|
||||
{
|
||||
|
||||
@@ -537,6 +537,8 @@ NSString *const MXKContactManagerDataType = @"org.matrix.kit.MXKContactManagerDa
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
- (void)refreshLocalContacts
|
||||
{
|
||||
MXLogDebug(@"[MXKContactManager] refreshLocalContacts : Started");
|
||||
@@ -721,6 +723,7 @@ NSString *const MXKContactManagerDataType = @"org.matrix.kit.MXKContactManagerDa
|
||||
});
|
||||
}
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)updateMatrixIDsForLocalContact:(MXKContact *)contact
|
||||
{
|
||||
@@ -1582,6 +1585,9 @@ static NSString *matrixIDsDictFile = @"matrixIDsDictV2";
|
||||
static NSString *localContactsFile = @"localContactsV2";
|
||||
static NSString *contactsBookInfoFile = @"contactsV2";
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
- (NSString*)dataFilePathForComponent:(NSString*)component
|
||||
{
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
@@ -1857,6 +1863,8 @@ static NSString *contactsBookInfoFile = @"contactsV2";
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (BOOL)encryptAndSaveData:(NSData*)data toFile:(NSString*)fileName
|
||||
{
|
||||
NSError *error = nil;
|
||||
|
||||
@@ -670,6 +670,8 @@ static NSString *const kMXAppGroupID = @"group.org.matrix";
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (NSString*)phonebookCountryCode
|
||||
{
|
||||
NSString* res = phonebookCountryCode;
|
||||
@@ -699,6 +701,7 @@ static NSString *const kMXAppGroupID = @"group.org.matrix";
|
||||
|
||||
return res;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)setPhonebookCountryCode:(NSString *)stringValue
|
||||
{
|
||||
|
||||
@@ -30,8 +30,8 @@ extern NSString *const kMXKRecentCellIdentifier;
|
||||
|
||||
/**
|
||||
The recents data source based on a unique matrix session.
|
||||
Deprecated: Please see MXSession.roomListDataManager
|
||||
*/
|
||||
MXK_DEPRECATED_ATTRIBUTE_WITH_MSG("See MXSession.roomListDataManager")
|
||||
@interface MXKSessionRecentsDataSource : MXKDataSource {
|
||||
|
||||
@protected
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#define MXK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
||||
#define MXK_DEPRECATED_ATTRIBUTE_WITH_MSG(msg) __attribute((deprecated((msg))))
|
||||
|
||||
/**
|
||||
The Matrix iOS Kit version.
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,8 @@ import MobileCoreServices
|
||||
|
||||
/// MXKDocumentPickerPresenter presents a controller that provides access to documents or destinations outside the app’s sandbox.
|
||||
/// Internally presents a UIDocumentPickerViewController in UIDocumentPickerMode.import.
|
||||
/// Note: You must turn on the iCloud Documents capabilities in Xcode (see https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/DocumentPickerProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014451)
|
||||
/// Note: You must turn on the iCloud Documents capabilities in Xcode
|
||||
/// (see https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/DocumentPickerProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014451)
|
||||
@objcMembers
|
||||
public class MXKDocumentPickerPresenter: NSObject {
|
||||
|
||||
|
||||
@@ -1112,7 +1112,7 @@ manualChangeMessageForVideo:(NSString*)manualChangeMessageForVideo
|
||||
// Caution: We need here to escape the non-ASCII characters (like '#' in room alias)
|
||||
// to convert the link into a legal URL string.
|
||||
NSString *link = [attributedString.string substringWithRange:match.range];
|
||||
link = [link stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
link = [link stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
||||
[*mutableAttributedString addAttribute:NSLinkAttributeName value:link range:match.range];
|
||||
}
|
||||
}];
|
||||
|
||||
@@ -20,7 +20,7 @@ import MobileCoreServices
|
||||
|
||||
// We do not use the SwiftUTI pod anymore
|
||||
// The library is embedded in MatrixKit. See Libs/SwiftUTI/README.md for more details
|
||||
//import SwiftUTI
|
||||
// import SwiftUTI
|
||||
|
||||
/// MXKUTI represents a Universal Type Identifier (e.g. kUTTypePNG).
|
||||
/// See https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html#//apple_ref/doc/uid/TP40001319-CH202-SW5 for more information.
|
||||
@@ -134,6 +134,8 @@ extension MXKUTI {
|
||||
self.init(rawValue: uti as String)
|
||||
}
|
||||
|
||||
// swiftlint:disable unused_optional_binding
|
||||
|
||||
/// Initialize with local file URL.
|
||||
/// This method is currently applicable only to URLs for file system resources.
|
||||
///
|
||||
@@ -153,6 +155,8 @@ extension MXKUTI {
|
||||
}
|
||||
}
|
||||
|
||||
// swiftlint:enable unused_optional_binding
|
||||
|
||||
public convenience init?(localFileURL: URL) {
|
||||
self.init(localFileURL: localFileURL, loadResourceValues: true)
|
||||
}
|
||||
@@ -173,6 +177,8 @@ extension MXKUTI {
|
||||
}
|
||||
}
|
||||
|
||||
// swiftlint:disable force_unwrapping
|
||||
|
||||
// MARK: - Some system defined UTIs
|
||||
extension MXKUTI {
|
||||
public static let data = MXKUTI(cfRawValue: kUTTypeData)!
|
||||
@@ -190,6 +196,8 @@ extension MXKUTI {
|
||||
public static let xml = MXKUTI(cfRawValue: kUTTypeXML)!
|
||||
}
|
||||
|
||||
// swiftlint:enable force_unwrapping
|
||||
|
||||
// MARK: - Convenience static methods
|
||||
extension MXKUTI {
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ sendObjectMessage({ \
|
||||
MXLogDebug(@"[MXKAuthenticationFallbackWebView] URL has js: prefix");
|
||||
|
||||
// Listen only to scheme of the JS-WKWebView bridge
|
||||
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
|
||||
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByRemovingPercentEncoding];
|
||||
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
NSError *error;
|
||||
|
||||
@@ -102,7 +102,7 @@ var onloadCallback = function() { \
|
||||
if ([urlString hasPrefix:@"js:"])
|
||||
{
|
||||
// Listen only to scheme of the JS-WKWebView bridge
|
||||
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
|
||||
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
||||
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
NSError *error;
|
||||
|
||||
@@ -417,7 +417,7 @@ static NSAttributedString *verticalWhitespace = nil;
|
||||
[_mxSession.crypto setDeviceVerification:MXDeviceVerified forDevice:_mxDeviceInfo.deviceId ofUser:_mxDeviceInfo.userId success:^{
|
||||
|
||||
// Refresh data
|
||||
_mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent];
|
||||
self->_mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent];
|
||||
if (self->_delegate)
|
||||
{
|
||||
[self->_delegate encryptionInfoView:self didDeviceInfoVerifiedChange:self.mxDeviceInfo];
|
||||
@@ -473,7 +473,7 @@ static NSAttributedString *verticalWhitespace = nil;
|
||||
[_mxSession.crypto setDeviceVerification:verificationStatus forDevice:_mxDeviceInfo.deviceId ofUser:_mxDeviceInfo.userId success:^{
|
||||
|
||||
// Refresh data
|
||||
_mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent];
|
||||
self->_mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent];
|
||||
|
||||
if (self->_delegate)
|
||||
{
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "MXKRoomInputToolbarView.h"
|
||||
|
||||
#import <HPGrowingTextView/HPGrowingTextView.h>
|
||||
|
||||
/**
|
||||
`MXKRoomInputToolbarViewWithHPGrowingText` is a MXKRoomInputToolbarView-inherited class in which message
|
||||
composer is based on `HPGrowingTextView`.
|
||||
|
||||
Toolbar buttons are not overridden by this class. We keep the default implementation.
|
||||
*/
|
||||
@interface MXKRoomInputToolbarViewWithHPGrowingText : MXKRoomInputToolbarView <HPGrowingTextViewDelegate>
|
||||
{
|
||||
@protected
|
||||
HPGrowingTextView *growingTextView;
|
||||
}
|
||||
|
||||
@end
|
||||
-187
@@ -1,187 +0,0 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
Copyright 2017 Vector Creations Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "MXKRoomInputToolbarViewWithHPGrowingText.h"
|
||||
|
||||
@interface MXKRoomInputToolbarViewWithHPGrowingText()
|
||||
{
|
||||
// HPGrowingTextView triggers growingTextViewDidChange event when it recomposes itself
|
||||
// Save the last edited text to prevent unexpected typing events
|
||||
NSString* lastEditedText;
|
||||
}
|
||||
|
||||
/**
|
||||
Message composer defined in `messageComposerContainer`.
|
||||
*/
|
||||
@property (nonatomic) IBOutlet HPGrowingTextView *growingTextView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MXKRoomInputToolbarViewWithHPGrowingText
|
||||
@synthesize growingTextView;
|
||||
|
||||
+ (UINib *)nib
|
||||
{
|
||||
return [UINib nibWithNibName:NSStringFromClass([MXKRoomInputToolbarViewWithHPGrowingText class])
|
||||
bundle:[NSBundle bundleForClass:[MXKRoomInputToolbarViewWithHPGrowingText class]]];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[super awakeFromNib];
|
||||
|
||||
// Handle message composer based on HPGrowingTextView use
|
||||
growingTextView.delegate = self;
|
||||
|
||||
[growingTextView setTranslatesAutoresizingMaskIntoConstraints: NO];
|
||||
|
||||
// Add an accessory view to the text view in order to retrieve keyboard view.
|
||||
inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
growingTextView.internalTextView.inputAccessoryView = self.inputAccessoryView;
|
||||
|
||||
// on IOS 8, the growing textview animation could trigger weird UI animations
|
||||
// indeed, the messages tableView can be refreshed while its height is updated (e.g. when setting a message)
|
||||
growingTextView.animateHeightChange = NO;
|
||||
|
||||
lastEditedText = nil;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self destroy];
|
||||
}
|
||||
|
||||
-(void)customizeViewRendering
|
||||
{
|
||||
[super customizeViewRendering];
|
||||
|
||||
// set text input font
|
||||
growingTextView.font = [UIFont systemFontOfSize:14];
|
||||
|
||||
// draw a rounded border around the textView
|
||||
growingTextView.layer.cornerRadius = 5;
|
||||
growingTextView.layer.borderWidth = 1;
|
||||
growingTextView.layer.borderColor = [UIColor lightGrayColor].CGColor;
|
||||
growingTextView.clipsToBounds = YES;
|
||||
growingTextView.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
if (growingTextView)
|
||||
{
|
||||
growingTextView.delegate = nil;
|
||||
growingTextView = nil;
|
||||
}
|
||||
|
||||
[super destroy];
|
||||
}
|
||||
|
||||
- (void)setMaxHeight:(CGFloat)maxHeight
|
||||
{
|
||||
growingTextView.maxHeight = maxHeight - (self.messageComposerContainerTopConstraint.constant + self.messageComposerContainerBottomConstraint.constant);
|
||||
[growingTextView refreshHeight];
|
||||
|
||||
super.maxHeight = maxHeight;
|
||||
}
|
||||
|
||||
- (NSString*)textMessage
|
||||
{
|
||||
return growingTextView.text;
|
||||
}
|
||||
|
||||
- (void)setTextMessage:(NSString *)textMessage
|
||||
{
|
||||
growingTextView.text = textMessage;
|
||||
self.rightInputToolbarButton.enabled = textMessage.length;
|
||||
}
|
||||
|
||||
- (void)pasteText:(NSString *)text
|
||||
{
|
||||
self.textMessage = [growingTextView.text stringByReplacingCharactersInRange:growingTextView.selectedRange withString:text];
|
||||
}
|
||||
|
||||
- (void)setPlaceholder:(NSString *)inPlaceholder
|
||||
{
|
||||
[super setPlaceholder:inPlaceholder];
|
||||
growingTextView.placeholder = inPlaceholder;
|
||||
}
|
||||
|
||||
- (BOOL)becomeFirstResponder
|
||||
{
|
||||
return [growingTextView becomeFirstResponder];
|
||||
}
|
||||
|
||||
- (void)dismissKeyboard
|
||||
{
|
||||
[growingTextView resignFirstResponder];
|
||||
}
|
||||
|
||||
#pragma mark - HPGrowingTextView delegate
|
||||
|
||||
- (void)growingTextViewDidEndEditing:(HPGrowingTextView *)sender
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:isTyping:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self isTyping:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)growingTextViewDidChange:(HPGrowingTextView *)sender
|
||||
{
|
||||
NSString *msg = growingTextView.text;
|
||||
|
||||
// HPGrowingTextView triggers growingTextViewDidChange event when it recomposes itself.
|
||||
// Save the last edited text to prevent unexpected typing events
|
||||
if (![lastEditedText isEqualToString:msg])
|
||||
{
|
||||
lastEditedText = msg;
|
||||
if (msg.length)
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:isTyping:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self isTyping:YES];
|
||||
}
|
||||
self.rightInputToolbarButton.enabled = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:isTyping:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self isTyping:NO];
|
||||
}
|
||||
self.rightInputToolbarButton.enabled = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height
|
||||
{
|
||||
// Update growing text's superview (toolbar view)
|
||||
CGFloat updatedHeight = height + (self.messageComposerContainerTopConstraint.constant + self.messageComposerContainerBottomConstraint.constant);
|
||||
if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:heightDidChanged:completion:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self heightDidChanged:updatedHeight completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
|
||||
{
|
||||
return self.isEditable;
|
||||
}
|
||||
|
||||
@end
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MXKRoomInputToolbarViewWithHPGrowingText">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="41"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="contactAdd" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hga-l8-Wua" userLabel="left Button">
|
||||
<rect key="frame" x="8" y="0.0" width="35" height="41"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="35" id="ptO-BQ-NhS"/>
|
||||
</constraints>
|
||||
<state key="normal">
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onTouchUpInside:" destination="iN0-l3-epB" eventType="touchUpInside" id="jVG-We-DmS"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Owf-M8-qJi" userLabel="right Button">
|
||||
<rect key="frame" x="552" y="0.0" width="44" height="41"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="44" id="9FZ-CI-diT"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Send">
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onTouchUpInside:" destination="iN0-l3-epB" eventType="touchUpInside" id="jed-Mz-rxe"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QWp-NV-uh5" userLabel="Message Composer Container">
|
||||
<rect key="frame" x="51" y="4" width="497" height="33"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pkf-YH-tco" customClass="HPGrowingTextView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="497" height="33"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="pkf-YH-tco" secondAttribute="bottom" id="L3A-Oo-Ml2"/>
|
||||
<constraint firstItem="pkf-YH-tco" firstAttribute="top" secondItem="QWp-NV-uh5" secondAttribute="top" id="VPn-k0-0vc"/>
|
||||
<constraint firstItem="pkf-YH-tco" firstAttribute="leading" secondItem="QWp-NV-uh5" secondAttribute="leading" id="mXj-f3-DcT"/>
|
||||
<constraint firstAttribute="trailing" secondItem="pkf-YH-tco" secondAttribute="trailing" id="n4K-Do-gHr"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.89720267057418823" green="0.89720267057418823" blue="0.89720267057418823" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="Owf-M8-qJi" secondAttribute="trailing" constant="4" id="2M8-Gu-0f6"/>
|
||||
<constraint firstItem="QWp-NV-uh5" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="4" id="570-8j-VYY"/>
|
||||
<constraint firstAttribute="bottom" secondItem="QWp-NV-uh5" secondAttribute="bottom" constant="4" id="9Ya-0H-03W"/>
|
||||
<constraint firstItem="Hga-l8-Wua" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="8" id="Bc8-T7-wmA"/>
|
||||
<constraint firstItem="Hga-l8-Wua" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Cvk-xZ-ODy"/>
|
||||
<constraint firstItem="Owf-M8-qJi" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="SV8-U3-8dd"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Hga-l8-Wua" secondAttribute="bottom" id="Slr-2H-laO"/>
|
||||
<constraint firstItem="Owf-M8-qJi" firstAttribute="leading" secondItem="QWp-NV-uh5" secondAttribute="trailing" constant="4" id="UEd-gb-jgR"/>
|
||||
<constraint firstItem="QWp-NV-uh5" firstAttribute="leading" secondItem="Hga-l8-Wua" secondAttribute="trailing" constant="8" id="cCr-Am-M7d"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Owf-M8-qJi" secondAttribute="bottom" id="ycc-x9-PAv"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<nil key="simulatedTopBarMetrics"/>
|
||||
<nil key="simulatedBottomBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="growingTextView" destination="pkf-YH-tco" id="VeP-WI-6Xh"/>
|
||||
<outlet property="leftInputToolbarButton" destination="Hga-l8-Wua" id="zbm-3b-hoY"/>
|
||||
<outlet property="messageComposerContainer" destination="QWp-NV-uh5" id="7EX-Un-ZIe"/>
|
||||
<outlet property="messageComposerContainerBottomConstraint" destination="9Ya-0H-03W" id="226-iu-6tU"/>
|
||||
<outlet property="messageComposerContainerTopConstraint" destination="570-8j-VYY" id="VKv-Qh-PCs"/>
|
||||
<outlet property="rightInputToolbarButton" destination="Owf-M8-qJi" id="seO-ly-Bgg"/>
|
||||
</connections>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
Reference in New Issue
Block a user