Update deployment target to 15.0, WysiwygComposer to 2.15.0, downgrade DTCoreText to 1.6.26

This commit is contained in:
Nicolas Mauri
2023-11-14 10:27:00 +01:00
parent dde4847b90
commit 360d710d4f
8 changed files with 15 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ KEYCHAIN_ACCESS_GROUP = $(AppIdentifierPrefix)$(BASE_BUNDLE_IDENTIFIER).keychain
BROADCAST_UPLOAD_EXTENSION_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).broadcastUploadExtension BROADCAST_UPLOAD_EXTENSION_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).broadcastUploadExtension
// Build settings // Build settings
IPHONEOS_DEPLOYMENT_TARGET = 14.0 IPHONEOS_DEPLOYMENT_TARGET = 15.0
SDKROOT = iphoneos SDKROOT = iphoneos
TARGETED_DEVICE_FAMILY = 1,2 TARGETED_DEVICE_FAMILY = 1,2
SWIFT_VERSION = 5.6 SWIFT_VERSION = 5.6

View File

@@ -1,7 +1,7 @@
source 'https://cdn.cocoapods.org/' source 'https://cdn.cocoapods.org/'
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
platform :ios, '14.0' platform :ios, '15.0'
# By default, ignore all warnings from any pod # By default, ignore all warnings from any pod
inhibit_all_warnings! inhibit_all_warnings!

View File

@@ -47,7 +47,6 @@ class HTMLFormatter: NSObject {
var options: [AnyHashable: Any] = [ var options: [AnyHashable: Any] = [
DTUseiOS6Attributes: true, DTUseiOS6Attributes: true,
DTDefaultFontDescriptor: font.fontDescriptor,
DTDefaultLinkDecoration: false, DTDefaultLinkDecoration: false,
DTDefaultLinkColor: ThemeService.shared().theme.colors.links, DTDefaultLinkColor: ThemeService.shared().theme.colors.links,
DTWillFlushBlockCallBack: sanitizeCallback DTWillFlushBlockCallBack: sanitizeCallback

View File

@@ -384,8 +384,8 @@ extension RoomViewController: ComposerLinkActionBridgePresenterDelegate {
} }
// MARK: - PermalinkReplacer // MARK: - PermalinkReplacer
extension RoomViewController: PermalinkReplacer { extension RoomViewController: MentionReplacer {
public func replacementForLink(_ url: String, text: String) -> NSAttributedString? { public func replacementForMention(_ url: String, text: String) -> NSAttributedString? {
guard #available(iOS 15.0, *), guard #available(iOS 15.0, *),
let url = URL(string: url), let url = URL(string: url),
let session = roomDataSource.mxSession, let session = roomDataSource.mxSession,

View File

@@ -150,8 +150,8 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
return (delegate as? RoomInputToolbarViewDelegate) ?? nil return (delegate as? RoomInputToolbarViewDelegate) ?? nil
} }
private var permalinkReplacer: PermalinkReplacer? { private var permalinkReplacer: MentionReplacer? {
return (delegate as? PermalinkReplacer) return (delegate as? MentionReplacer)
} }
override func awakeFromNib() { override func awakeFromNib() {
@@ -238,7 +238,7 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
self?.handleViewModelResult(result) self?.handleViewModelResult(result)
} }
wysiwygViewModel.plainTextMode = !RiotSettings.shared.enableWysiwygTextFormatting wysiwygViewModel.plainTextMode = !RiotSettings.shared.enableWysiwygTextFormatting
wysiwygViewModel.permalinkReplacer = permalinkReplacer wysiwygViewModel.mentionReplacer = permalinkReplacer
inputAccessoryViewForKeyboard = UIView(frame: .zero) inputAccessoryViewForKeyboard = UIView(frame: .zero)

View File

@@ -156,7 +156,7 @@ extension FormatItem {
extension FormatType { extension FormatType {
/// Convenience method to map it to the external ViewModel action /// Convenience method to map it to the external ViewModel action
var action: WysiwygAction { var action: ComposerAction {
switch self { switch self {
case .bold: case .bold:
return .bold return .bold

View File

@@ -140,11 +140,12 @@ struct Composer: View {
} }
HStack(alignment: shouldFixRoundCorner ? .top : .center, spacing: 0) { HStack(alignment: shouldFixRoundCorner ? .top : .center, spacing: 0) {
WysiwygComposerView( WysiwygComposerView(
focused: $viewModel.focused, placeholder: viewModel.viewState.placeholder ?? "",
viewModel: wysiwygViewModel viewModel: wysiwygViewModel,
itemProviderHelper: nil,
keyCommandHandler: nil,
pasteHandler: nil
) )
.tintColor(theme.colors.accent)
.placeholder(viewModel.viewState.placeholder, color: theme.colors.tertiaryContent)
.onAppear { .onAppear {
if wysiwygViewModel.isContentEmpty { if wysiwygViewModel.isContentEmpty {
wysiwygViewModel.setup() wysiwygViewModel.setup()

View File

@@ -59,10 +59,10 @@ packages:
branch: 0.0.1 branch: 0.0.1
WysiwygComposer: WysiwygComposer:
url: https://github.com/matrix-org/matrix-wysiwyg-composer-swift url: https://github.com/matrix-org/matrix-wysiwyg-composer-swift
version: 2.2.2 version: 2.15.0
DeviceKit: DeviceKit:
url: https://github.com/devicekit/DeviceKit url: https://github.com/devicekit/DeviceKit
majorVersion: 4.7.0 majorVersion: 4.7.0
DTCoreText: DTCoreText:
url: https://github.com/Cocoanetics/DTCoreText url: https://github.com/Cocoanetics/DTCoreText
version: 1.6.27 version: 1.6.26