From 983ac6e0d92cd3d04125c224e384743f899af1b0 Mon Sep 17 00:00:00 2001 From: Jeremy Massel Date: Wed, 4 Sep 2019 15:54:30 -0600 Subject: [PATCH 01/14] Tag 1.9.0 --- WordPress-Aztec-iOS.podspec | 2 +- WordPress-Editor-iOS.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index 1701bf162..54e1be3b1 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'WordPress-Aztec-iOS' - s.version = '1.9.0-beta.1' + s.version = '1.9.0' s.summary = 'The native HTML Editor.' # This description is used to generate tags and improve search results. diff --git a/WordPress-Editor-iOS.podspec b/WordPress-Editor-iOS.podspec index b10d640ff..c1631ac64 100644 --- a/WordPress-Editor-iOS.podspec +++ b/WordPress-Editor-iOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'WordPress-Editor-iOS' - s.version = '1.9.0-beta.1' + s.version = '1.9.0' s.summary = 'The WordPress HTML Editor.' # This description is used to generate tags and improve search results. From a8dc39df9786e2c4430fc9bdf4376b3783017d0d Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 14:46:49 +0100 Subject: [PATCH 02/14] Fix new warnings. --- Aztec/Classes/EditorView/EditorView.swift | 2 +- Aztec/Classes/TextKit/TextView.swift | 2 +- Example/Example/EditorDemoController.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Aztec/Classes/EditorView/EditorView.swift b/Aztec/Classes/EditorView/EditorView.swift index 3128cee57..a10643e10 100644 --- a/Aztec/Classes/EditorView/EditorView.swift +++ b/Aztec/Classes/EditorView/EditorView.swift @@ -323,7 +323,7 @@ extension EditorView: UITextInput { } set { - activeView.selectedTextRange = selectedTextRange + activeView.selectedTextRange = newValue } } } diff --git a/Aztec/Classes/TextKit/TextView.swift b/Aztec/Classes/TextKit/TextView.swift index 71295404d..2ae6dc6ac 100644 --- a/Aztec/Classes/TextKit/TextView.swift +++ b/Aztec/Classes/TextKit/TextView.swift @@ -1343,7 +1343,7 @@ open class TextView: UITextView { let attachment = ImageAttachment(identifier: identifier, url: url) attachment.delegate = storage attachment.image = placeHolderImage - attachment.alignment = .none + attachment.alignment = ImageAttachment.Alignment.none replace(at: range, with: attachment) return attachment } diff --git a/Example/Example/EditorDemoController.swift b/Example/Example/EditorDemoController.swift index 78ab2df54..b174ad6b3 100644 --- a/Example/Example/EditorDemoController.swift +++ b/Example/Example/EditorDemoController.swift @@ -1294,7 +1294,7 @@ private extension EditorDemoController let attachment = richTextView.replaceWithImage(at: richTextView.selectedRange, sourceURL: fileURL, placeHolderImage: image) attachment.size = .full - attachment.alignment = .none + attachment.alignment = ImageAttachment.Alignment.none if let attachmentRange = richTextView.textStorage.ranges(forAttachment: attachment).first { richTextView.setLink(fileURL, inRange: attachmentRange) } From e44770e426672e6e867fb508f43f06ed727b7dee Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 15:07:28 +0100 Subject: [PATCH 03/14] Mark method public because of new system interface. --- .../OptionsTableViewController/OptionsTablePresenter.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPressEditor/WordPressEditor/Classes/ViewControllers/OptionsTableViewController/OptionsTablePresenter.swift b/WordPressEditor/WordPressEditor/Classes/ViewControllers/OptionsTableViewController/OptionsTablePresenter.swift index f2ffb19da..5ba9c9a7e 100644 --- a/WordPressEditor/WordPressEditor/Classes/ViewControllers/OptionsTableViewController/OptionsTablePresenter.swift +++ b/WordPressEditor/WordPressEditor/Classes/ViewControllers/OptionsTableViewController/OptionsTablePresenter.swift @@ -122,11 +122,11 @@ public class OptionsTablePresenter: NSObject { // extension OptionsTablePresenter: UIPopoverPresentationControllerDelegate { - private func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle { + public func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle { return .none } - private func popoverPresentationControllerDidDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) { + public func popoverPresentationControllerDidDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) { if optionsTableViewController != nil { optionsTableViewController = nil } From 1fa56f7c8a1fe059e4a336ca42bb658e0fcb0157 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 15:08:19 +0100 Subject: [PATCH 04/14] Add default option for unknown cases. --- Aztec/Classes/GUI/FormatBar/FormatBar.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Aztec/Classes/GUI/FormatBar/FormatBar.swift b/Aztec/Classes/GUI/FormatBar/FormatBar.swift index 39efd86bd..82ca1300a 100644 --- a/Aztec/Classes/GUI/FormatBar/FormatBar.swift +++ b/Aztec/Classes/GUI/FormatBar/FormatBar.swift @@ -712,6 +712,8 @@ private extension FormatBar { constant: 0 ) self.overflowToggleItemRTLLeadingConstraint = overflowLeadingConstraint + @unknown default: + overflowLeadingConstraint = overflowToggleItem.leadingAnchor.constraint(greaterThanOrEqualTo: scrollableStackView.trailingAnchor) } ///Trailing item @@ -726,6 +728,8 @@ private extension FormatBar { trailingItemLeadingConstraint = trailingItemContainer.leadingAnchor.constraint(greaterThanOrEqualTo: scrollableStackView.trailingAnchor) case .rightToLeft: trailingItemLeadingConstraint = trailingItemContainer.leadingAnchor.constraint(greaterThanOrEqualTo: scrollableStackView.leadingAnchor) + @unknown default: + trailingItemLeadingConstraint = trailingItemContainer.leadingAnchor.constraint(greaterThanOrEqualTo: scrollableStackView.trailingAnchor) } NSLayoutConstraint.activate([ From 065e59f4b857f94df1c1b995ccb4981d8a431943 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 15:08:40 +0100 Subject: [PATCH 05/14] Update projects to Swift 5. --- Aztec.xcodeproj/project.pbxproj | 20 +++++++++---------- .../Classes/Extensions/Array+Attribute.swift | 4 ++-- .../Extensions/Array+ShortcodeAttribute.swift | 4 ++-- .../Libxml2/DOM/Data/ElementNode.swift | 4 ++-- Aztec/Classes/Libxml2/DOM/Data/Node.swift | 2 +- .../Conversions/AttributedStringParser.swift | 2 +- Aztec/Classes/TextKit/ParagraphStyle.swift | 2 +- Aztec/Classes/TextKit/TextView.swift | 5 ++--- .../AztecExample.xcodeproj/project.pbxproj | 20 +++++++++---------- Example/Example/EditorDemoController.swift | 4 ++-- .../WordPressEditor.xcodeproj/project.pbxproj | 16 +++++++-------- 11 files changed, 41 insertions(+), 42 deletions(-) diff --git a/Aztec.xcodeproj/project.pbxproj b/Aztec.xcodeproj/project.pbxproj index d27d5faed..826034637 100644 --- a/Aztec.xcodeproj/project.pbxproj +++ b/Aztec.xcodeproj/project.pbxproj @@ -1435,12 +1435,12 @@ 5951CB8D1D8BC93600E1866F = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = PZYM8XX95Q; - LastSwiftMigration = 1010; + LastSwiftMigration = 1100; ProvisioningStyle = Manual; }; 5951CB961D8BC93600E1866F = { CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 1010; + LastSwiftMigration = 1100; ProvisioningStyle = Automatic; }; E8CE3EFE1F213AAA003254AB = { @@ -1899,7 +1899,7 @@ SKIP_INSTALL = YES; STRIP_INSTALLED_PRODUCT = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Debug; @@ -1927,7 +1927,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Release; @@ -1947,7 +1947,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.wordpress.AztecTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1965,7 +1965,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.wordpress.AztecTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -2100,7 +2100,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Profiling; @@ -2119,7 +2119,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.wordpress.AztecTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Profiling; }; @@ -2214,7 +2214,7 @@ SKIP_INSTALL = YES; STRIP_INSTALLED_PRODUCT = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = "Release-Alpha"; @@ -2234,7 +2234,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.wordpress.AztecTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = "Release-Alpha"; }; diff --git a/Aztec/Classes/Extensions/Array+Attribute.swift b/Aztec/Classes/Extensions/Array+Attribute.swift index 0bbb9f984..2b8ebba5f 100644 --- a/Aztec/Classes/Extensions/Array+Attribute.swift +++ b/Aztec/Classes/Extensions/Array+Attribute.swift @@ -22,7 +22,7 @@ public extension Array where Element == Attribute { } mutating func set(_ value: Attribute.Value, for name: String) { - guard let attributeIndex = index(where: { $0.name == name }) else { + guard let attributeIndex = firstIndex(where: { $0.name == name }) else { let newAttribute = Attribute(name: name, value: value) append(newAttribute) @@ -33,7 +33,7 @@ public extension Array where Element == Attribute { } mutating func remove(named name: String) { - guard let attributeIndex = index(where: { $0.name == name }) else { + guard let attributeIndex = firstIndex(where: { $0.name == name }) else { return } diff --git a/Aztec/Classes/Extensions/Array+ShortcodeAttribute.swift b/Aztec/Classes/Extensions/Array+ShortcodeAttribute.swift index 6243c5925..10b3db8e0 100644 --- a/Aztec/Classes/Extensions/Array+ShortcodeAttribute.swift +++ b/Aztec/Classes/Extensions/Array+ShortcodeAttribute.swift @@ -15,7 +15,7 @@ public extension Array where Element == ShortcodeAttribute { mutating func set(_ value: ShortcodeAttribute.Value, forKey key: String) { let newAttribute = ShortcodeAttribute(key: key, value: value) - guard let attributeIndex = index(where: { $0.key == key }) else { + guard let attributeIndex = firstIndex(where: { $0.key == key }) else { append(newAttribute) return } @@ -24,7 +24,7 @@ public extension Array where Element == ShortcodeAttribute { } mutating func remove(key: String) { - guard let attributeIndex = index(where: { $0.key == key }) else { + guard let attributeIndex = firstIndex(where: { $0.key == key }) else { return } diff --git a/Aztec/Classes/Libxml2/DOM/Data/ElementNode.swift b/Aztec/Classes/Libxml2/DOM/Data/ElementNode.swift index 782bd2778..4aa2ec720 100644 --- a/Aztec/Classes/Libxml2/DOM/Data/ElementNode.swift +++ b/Aztec/Classes/Libxml2/DOM/Data/ElementNode.swift @@ -115,7 +115,7 @@ public class ElementNode: Node { private func updateParentForChildren() { for child in children where child.parent !== self { if let oldParent = child.parent, - let childIndex = oldParent.children.index(where: { child === $0 }) { + let childIndex = oldParent.children.firstIndex(where: { child === $0 }) { oldParent.children.remove(at: childIndex) } @@ -349,7 +349,7 @@ public class ElementNode: Node { /// - Returns: the index of the specified child node. /// func indexOf(childNode: Node) -> Int { - guard let index = children.index(where: { childNode === $0 } ) else { + guard let index = children.firstIndex(where: { childNode === $0 } ) else { fatalError("Broken parent-child relationship found.") } diff --git a/Aztec/Classes/Libxml2/DOM/Data/Node.swift b/Aztec/Classes/Libxml2/DOM/Data/Node.swift index 93dd6b196..1bef92668 100644 --- a/Aztec/Classes/Libxml2/DOM/Data/Node.swift +++ b/Aztec/Classes/Libxml2/DOM/Data/Node.swift @@ -167,7 +167,7 @@ public class Node: Equatable, CustomReflectable, Hashable { return nil } - let index = parent.children.index { node -> Bool in + let index = parent.children.firstIndex { node -> Bool in return node === self }! diff --git a/Aztec/Classes/NSAttributedString/Conversions/AttributedStringParser.swift b/Aztec/Classes/NSAttributedString/Conversions/AttributedStringParser.swift index 5c5317e24..94d4fcd3d 100644 --- a/Aztec/Classes/NSAttributedString/Conversions/AttributedStringParser.swift +++ b/Aztec/Classes/NSAttributedString/Conversions/AttributedStringParser.swift @@ -333,7 +333,7 @@ private extension AttributedStringParser { var nonDuplicates = [ElementNode]() for node in previous where current.contains(node) { - guard let index = current.index(of: node) else { + guard let index = current.firstIndex(of: node) else { continue } diff --git a/Aztec/Classes/TextKit/ParagraphStyle.swift b/Aztec/Classes/TextKit/ParagraphStyle.swift index 1b2f04a1e..201dddee0 100644 --- a/Aztec/Classes/TextKit/ParagraphStyle.swift +++ b/Aztec/Classes/TextKit/ParagraphStyle.swift @@ -181,7 +181,7 @@ open class ParagraphStyle: NSMutableParagraphStyle, CustomReflectable { public var blockquoteIndent: CGFloat { let blockquoteIndex = properties.filter({ property in return property is Blockquote || property is TextList - }).index(where: { property in + }).firstIndex(where: { property in return property is Blockquote }) diff --git a/Aztec/Classes/TextKit/TextView.swift b/Aztec/Classes/TextKit/TextView.swift index 2ae6dc6ac..1b956173c 100644 --- a/Aztec/Classes/TextKit/TextView.swift +++ b/Aztec/Classes/TextKit/TextView.swift @@ -418,7 +418,7 @@ open class TextView: UITextView { } storage.attachmentsDelegate = self font = defaultFont - linkTextAttributes = [.underlineStyle: NSNumber(value: NSUnderlineStyle.single.rawValue), .foregroundColor: self.tintColor] + linkTextAttributes = [.underlineStyle: NSNumber(value: NSUnderlineStyle.single.rawValue), .foregroundColor: tintColor as Any] typingAttributes = defaultAttributes setupMenuController() setupAttachmentTouchDetection() @@ -1342,8 +1342,7 @@ open class TextView: UITextView { open func replaceWithImage(at range: NSRange, sourceURL url: URL, placeHolderImage: UIImage?, identifier: String = UUID().uuidString) -> ImageAttachment { let attachment = ImageAttachment(identifier: identifier, url: url) attachment.delegate = storage - attachment.image = placeHolderImage - attachment.alignment = ImageAttachment.Alignment.none + attachment.image = placeHolderImage replace(at: range, with: attachment) return attachment } diff --git a/Example/AztecExample.xcodeproj/project.pbxproj b/Example/AztecExample.xcodeproj/project.pbxproj index dc334e39d..88248f3c4 100644 --- a/Example/AztecExample.xcodeproj/project.pbxproj +++ b/Example/AztecExample.xcodeproj/project.pbxproj @@ -362,12 +362,12 @@ 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; DevelopmentTeam = PZYM8XX95Q; - LastSwiftMigration = 1010; + LastSwiftMigration = 1100; ProvisioningStyle = Manual; }; CC400F161E9EC04200859AB4 = { CreatedOnToolsVersion = 8.3.1; - LastSwiftMigration = 1010; + LastSwiftMigration = 1100; ProvisioningStyle = Automatic; TestTargetID = 607FACCF1AFB9204008FA782; }; @@ -664,7 +664,7 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = "Aztec Example Development"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -687,7 +687,7 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = "Aztec Example Ad Hoc"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -704,7 +704,7 @@ PRODUCT_BUNDLE_IDENTIFIER = WP.AztecUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = AztecExample; }; name = Debug; @@ -719,7 +719,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = WP.AztecUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = AztecExample; }; name = "Release-Alpha"; @@ -734,7 +734,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = WP.AztecUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = AztecExample; }; name = Release; @@ -749,7 +749,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = WP.AztecUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = AztecExample; }; name = Profiling; @@ -826,7 +826,7 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = "Aztec Example Development"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Profiling; @@ -909,7 +909,7 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = "Aztec Example Alpha Distribution"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Release-Alpha"; diff --git a/Example/Example/EditorDemoController.swift b/Example/Example/EditorDemoController.swift index b174ad6b3..5cd6472e0 100644 --- a/Example/Example/EditorDemoController.swift +++ b/Example/Example/EditorDemoController.swift @@ -635,7 +635,7 @@ extension EditorDemoController { return OptionsTableViewOption(image: headerType.iconImage, title: title) } - let selectedIndex = Constants.headers.index(of: headerLevelForSelectedText()) + let selectedIndex = Constants.headers.firstIndex(of: headerLevelForSelectedText()) let optionsTableViewController = OptionsTableViewController(options: options) optionsTableViewController.cellDeselectedTintColor = .gray @@ -665,7 +665,7 @@ extension EditorDemoController { var index: Int? = nil if let listType = listTypeForSelectedText() { - index = Constants.lists.index(of: listType) + index = Constants.lists.firstIndex(of: listType) } let optionsTableViewController = OptionsTableViewController(options: options) diff --git a/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj b/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj index 24dcb3c53..9dae87d91 100644 --- a/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj +++ b/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj @@ -560,11 +560,11 @@ TargetAttributes = { F1D360AC2092947500B4E7A5 = { CreatedOnToolsVersion = 9.3; - LastSwiftMigration = 1010; + LastSwiftMigration = 1100; }; F1D360B52092947500B4E7A5 = { CreatedOnToolsVersion = 9.3; - LastSwiftMigration = 1010; + LastSwiftMigration = 1100; }; }; }; @@ -795,7 +795,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPress; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Profiling; @@ -814,7 +814,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Profiling; @@ -963,7 +963,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPress; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -988,7 +988,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPress; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -1007,7 +1007,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1026,7 +1026,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; From 01d7f613e5599569cc2cf377dc93023f25b5fc75 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 16:17:05 +0100 Subject: [PATCH 06/14] Update images --- .../Resources/UIImageResizeImage1_2x.png.dat | Bin 11071 -> 11203 bytes .../Resources/UIImageResizeImage2_2x.png.dat | Bin 11071 -> 11203 bytes .../GutenpackAttachmentRender_2x.png.dat | Bin 1902 -> 2034 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/AztecTests/Resources/UIImageResizeImage1_2x.png.dat b/AztecTests/Resources/UIImageResizeImage1_2x.png.dat index 9279c124963fd5a207450ea3efd2d28c3bbd287a..c195fc1a28880ba086efeece036f3477c5028b56 100644 GIT binary patch delta 141 zcmdlVb~t>3VSPnvglC$sFM}2X0|N&G3!@YRE0Dzq#CD9*aJCzx1_Lu#oQZ*TmUgTMqJ2I+y&%nKNys)1q)m|&_ICoEt_utC~R?qRx~yHQV28vwub5Ptvw delta 10 RcmX>czCUb&;l{0e+5jAg1dsp# diff --git a/AztecTests/Resources/UIImageResizeImage2_2x.png.dat b/AztecTests/Resources/UIImageResizeImage2_2x.png.dat index 9279c124963fd5a207450ea3efd2d28c3bbd287a..c195fc1a28880ba086efeece036f3477c5028b56 100644 GIT binary patch delta 141 zcmdlVb~t>3VSPnvglC$sFM}2X0|N&G3!@YRE0Dzq#CD9*aJCzx1_Lu#oQZ*TmUgTMqJ2I+y&%nKNys)1q)m|&_ICoEt_utC~R?qRx~yHQV28vwub5Ptvw delta 10 RcmX>czCUb&;l{0e+5jAg1dsp# diff --git a/WordPressEditor/WordPressEditorTests/Resources/GutenpackAttachmentRender_2x.png.dat b/WordPressEditor/WordPressEditorTests/Resources/GutenpackAttachmentRender_2x.png.dat index 0ea89492d361920fa9df5399a5ec931f9bb3ff88..057ef62e5b552a03dd14ea88023183325f3738da 100644 GIT binary patch delta 141 zcmaFI_lbXkVSPnvglC$sFM}2X0|N&G3!@YRE0Dzq#CD9*aJCzx1_Lu#oQZ*TmUgTMqJ2I+y&%nKNys)1q)nBb~UEMSJSBS6|_Twq$HvQf{09RQ>l54!*W delta 10 Rcmeyw|Bi2h;l{1D>;M~(1Ze;O From 6e8cc2ef2141176e17cecba17f165ec4fa9a3393 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 16:19:53 +0100 Subject: [PATCH 07/14] Update CircleCI configuration. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe8559e14..4f53c07c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ workflows: jobs: - ios/test: name: Test - xcode-version: "10.2.0" + xcode-version: "11.0" carthage-update: true carthage-working-directory: Example bundle-install: false @@ -17,16 +17,16 @@ workflows: workspace: Aztec.xcworkspace scheme: AztecExample device: iPhone XS - ios-version: "12.2" + ios-version: "13.0" - ios/validate-podspec: name: Validate WordPress-Aztec-iOS.podspec - xcode-version: "10.2.0" + xcode-version: "11.0" podspec-path: WordPress-Aztec-iOS.podspec - ios/validate-podspec: name: Validate WordPress-Editor-iOS.podspec - xcode-version: "10.2.0" + xcode-version: "11.0" podspec-path: WordPress-Editor-iOS.podspec # Updating specs is needed since WordPress-Editor-iOS depends on WordPress-Aztec-iOS update-specs-repo: true From 06dc4dec93e0a0677dac2ee0fc7fa215c6d7980a Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 16:26:38 +0100 Subject: [PATCH 08/14] Update Swift version. --- WordPress-Aztec-iOS.podspec | 2 +- WordPress-Editor-iOS.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index 54e1be3b1..0cab08f87 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.social_media_url = "http://twitter.com/WordPressiOS" s.source = { :git => 'https://github.com/wordpress-mobile/WordPress-Aztec-iOS.git', :tag => s.version.to_s } s.ios.deployment_target = '10.0' - s.swift_version = '4.2' + s.swift_version = '5.0' s.module_name = "Aztec" s.source_files = 'Aztec/Classes/**/*' diff --git a/WordPress-Editor-iOS.podspec b/WordPress-Editor-iOS.podspec index c1631ac64..0282af172 100644 --- a/WordPress-Editor-iOS.podspec +++ b/WordPress-Editor-iOS.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.social_media_url = "http://twitter.com/WordPressiOS" s.source = { :git => 'https://github.com/wordpress-mobile/WordPress-Aztec-iOS.git', :tag => s.version.to_s } s.ios.deployment_target = '10.0' - s.swift_version = '4.2' + s.swift_version = '5.0' s.module_name = "WordPressEditor" s.source_files = 'WordPressEditor/WordPressEditor/Classes/**/*' From 22b6f329bd303764aa2c07a1b3756b51e2270716 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 18:28:20 +0100 Subject: [PATCH 09/14] Select iPhone 11 for tests. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f53c07c2..73e579fba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: pod-install: false workspace: Aztec.xcworkspace scheme: AztecExample - device: iPhone XS + device: iPhone 11 ios-version: "13.0" - ios/validate-podspec: From 4451814d1c86e579092504bdc4f01032458fb1ce Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 23 Sep 2019 18:31:18 +0100 Subject: [PATCH 10/14] Update orb. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 73e579fba..aa058ec4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.1 orbs: # This uses the iOS Orb located at https://github.com/wordpress-mobile/circleci-orbs - ios: wordpress-mobile/ios@0.0.25 + ios: wordpress-mobile/ios@0.0.32 workflows: test_and_validate: From 1b7ee91fcf976ce6f72a90c88d427f8f8484adc1 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 24 Sep 2019 14:18:17 +0100 Subject: [PATCH 11/14] Update cocoapods version. --- Gemfile | 2 +- Gemfile.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index fd43c049c..652ca282c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' do - gem 'cocoapods', '1.6.1' + gem 'cocoapods', '1.7.5' end diff --git a/Gemfile.lock b/Gemfile.lock index 8dd63d70e..376b79767 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,19 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.0) + CFPropertyList (3.0.1) activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) atomos (0.1.3) - claide (1.0.2) - cocoapods (1.6.1) + claide (1.0.3) + cocoapods (1.7.5) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.6.1) - cocoapods-deintegrate (>= 1.0.2, < 2.0) + cocoapods-core (= 1.7.5) + cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) @@ -22,13 +22,13 @@ GEM cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) - fourflusher (>= 2.2.0, < 3.0) + fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.8.1, < 2.0) - cocoapods-core (1.6.1) + xcodeproj (>= 1.10.0, < 2.0) + cocoapods-core (1.7.5) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) @@ -38,19 +38,19 @@ GEM nap cocoapods-search (1.0.0) cocoapods-stats (1.1.0) - cocoapods-trunk (1.3.1) + cocoapods-trunk (1.4.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.1.0) colored2 (3.1.2) concurrent-ruby (1.1.5) escape (0.0.4) - fourflusher (2.2.0) + fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - minitest (5.11.3) + minitest (5.12.0) molinillo (0.6.6) nanaimo (0.2.6) nap (1.1.0) @@ -59,7 +59,7 @@ GEM thread_safe (0.3.6) tzinfo (1.2.5) thread_safe (~> 0.1) - xcodeproj (1.8.2) + xcodeproj (1.12.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -70,7 +70,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.6.1)! + cocoapods (= 1.7.5)! BUNDLED WITH - 1.17.2 + 2.0.2 From 89021000ad034c1fa8ddecfcfe05b70c309fc61c Mon Sep 17 00:00:00 2001 From: Jeremy Massel Date: Fri, 24 May 2019 15:02:37 -0600 Subject: [PATCH 12/14] Improve inline podspec documentation --- WordPress-Aztec-iOS.podspec | 2 +- WordPress-Editor-iOS.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index 0cab08f87..b73c0b75f 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -1,5 +1,5 @@ # -# Be sure to run `pod lib lint WordPress-Aztec-iOS.podspec' to ensure this is a +# Be sure to run `bundle exec pod lib lint WordPress-Aztec-iOS.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged diff --git a/WordPress-Editor-iOS.podspec b/WordPress-Editor-iOS.podspec index 0282af172..3ed1d000c 100644 --- a/WordPress-Editor-iOS.podspec +++ b/WordPress-Editor-iOS.podspec @@ -1,5 +1,5 @@ # -# Be sure to run `pod lib lint WordPress-Aztec-iOS.podspec' to ensure this is a +# Be sure to run `bundle exec pod lib lint WordPress-Editor-iOS.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged From ac2d9c3f608a3eb837bf2f98f2d3a9e637d417a3 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 30 Sep 2019 12:18:26 +0100 Subject: [PATCH 13/14] Make underline action use a span and css by default. --- .../Implementations/UnderlineFormatter.swift | 12 ++++++++++++ Aztec/Classes/TextKit/TextView.swift | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Aztec/Classes/Formatters/Implementations/UnderlineFormatter.swift b/Aztec/Classes/Formatters/Implementations/UnderlineFormatter.swift index 21f8fdd91..0a8ef0470 100644 --- a/Aztec/Classes/Formatters/Implementations/UnderlineFormatter.swift +++ b/Aztec/Classes/Formatters/Implementations/UnderlineFormatter.swift @@ -8,3 +8,15 @@ class UnderlineFormatter: StandardAttributeFormatter { htmlRepresentationKey: .underlineHtmlRepresentation) } } + +class SpanUnderlineFormatter: UnderlineFormatter { + + override func apply(to attributes: [NSAttributedString.Key : Any], andStore representation: HTMLRepresentation?) -> [NSAttributedString.Key : Any] { + + let cssAttribute = CSSAttribute.underline + let underlineStyleAttribute = Attribute(type: .style, value: .inlineCss([cssAttribute])) + let spanRepresentation = HTMLElementRepresentation(ElementNode.init(type: .span, attributes: [underlineStyleAttribute], children: [])) + + return super.apply(to: attributes, andStore: HTMLRepresentation(for: .element(spanRepresentation))) + } +} diff --git a/Aztec/Classes/TextKit/TextView.swift b/Aztec/Classes/TextKit/TextView.swift index 1b956173c..b0b7a53be 100644 --- a/Aztec/Classes/TextKit/TextView.swift +++ b/Aztec/Classes/TextKit/TextView.swift @@ -747,7 +747,7 @@ open class TextView: UITextView { private static let formatterMap: [FormattingIdentifier: AttributeFormatter] = [ .bold: BoldFormatter(), .italic: ItalicFormatter(), - .underline: UnderlineFormatter(), + .underline: SpanUnderlineFormatter(), .strikethrough: StrikethroughFormatter(), .link: LinkFormatter(), .orderedlist: TextListFormatter(style: .ordered), @@ -935,7 +935,7 @@ open class TextView: UITextView { /// - Parameter range: The NSRange to edit. /// open func toggleUnderline(range: NSRange) { - let formatter = UnderlineFormatter() + let formatter = SpanUnderlineFormatter() toggle(formatter: formatter, atRange: range) } From d3e532103fc071de894febcc748642f09ec9ea3b Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 30 Sep 2019 13:33:07 +0100 Subject: [PATCH 14/14] Update release number to 1.10.0 --- WordPress-Aztec-iOS.podspec | 2 +- WordPress-Editor-iOS.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index b73c0b75f..f650d0e20 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'WordPress-Aztec-iOS' - s.version = '1.9.0' + s.version = '1.10.0' s.summary = 'The native HTML Editor.' # This description is used to generate tags and improve search results. diff --git a/WordPress-Editor-iOS.podspec b/WordPress-Editor-iOS.podspec index 3ed1d000c..017568238 100644 --- a/WordPress-Editor-iOS.podspec +++ b/WordPress-Editor-iOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'WordPress-Editor-iOS' - s.version = '1.9.0' + s.version = '1.10.0' s.summary = 'The WordPress HTML Editor.' # This description is used to generate tags and improve search results.