diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c0a10cfd..69a532a2e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,8 +10,6 @@ workflows: - ios/test: name: Test xcode-version: "11.0" - carthage-update: true - carthage-working-directory: Example bundle-install: false pod-install: false workspace: Aztec.xcworkspace diff --git a/Aztec.xcodeproj/project.pbxproj b/Aztec.xcodeproj/project.pbxproj index ea4ec9c1a..28c0d6aa7 100644 --- a/Aztec.xcodeproj/project.pbxproj +++ b/Aztec.xcodeproj/project.pbxproj @@ -264,13 +264,6 @@ remoteGlobalIDString = 5951CB8D1D8BC93600E1866F; remoteInfo = Aztec; }; - E8CE3F041F213AD0003254AB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5951CB851D8BC93600E1866F /* Project object */; - proxyType = 1; - remoteGlobalIDString = E8CE3EFE1F213AAA003254AB; - remoteInfo = "Carthage Update"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -1415,23 +1408,6 @@ }; /* End PBXHeadersBuildPhase section */ -/* Begin PBXLegacyTarget section */ - E8CE3EFE1F213AAA003254AB /* Carthage Update */ = { - isa = PBXLegacyTarget; - buildArgumentsString = "$(ACTION)"; - buildConfigurationList = E8CE3F031F213AAA003254AB /* Build configuration list for PBXLegacyTarget "Carthage Update" */; - buildPhases = ( - ); - buildToolPath = "${PROJECT_DIR}/Scripts/carthage_script.sh"; - buildWorkingDirectory = ""; - dependencies = ( - ); - name = "Carthage Update"; - passBuildSettingsInEnvironment = 1; - productName = "Carthage Update"; - }; -/* End PBXLegacyTarget section */ - /* Begin PBXNativeTarget section */ 5951CB8D1D8BC93600E1866F /* Aztec */ = { isa = PBXNativeTarget; @@ -1445,7 +1421,6 @@ buildRules = ( ); dependencies = ( - E8CE3F051F213AD0003254AB /* PBXTargetDependency */, ); name = Aztec; productName = Aztec; @@ -1492,10 +1467,6 @@ LastSwiftMigration = 1100; ProvisioningStyle = Automatic; }; - E8CE3EFE1F213AAA003254AB = { - CreatedOnToolsVersion = 8.3.3; - ProvisioningStyle = Automatic; - }; }; }; buildConfigurationList = 5951CB881D8BC93600E1866F /* Build configuration list for PBXProject "Aztec" */; @@ -1513,7 +1484,6 @@ targets = ( 5951CB8D1D8BC93600E1866F /* Aztec */, 5951CB961D8BC93600E1866F /* AztecTests */, - E8CE3EFE1F213AAA003254AB /* Carthage Update */, ); }; /* End PBXProject section */ @@ -1803,11 +1773,6 @@ target = 5951CB8D1D8BC93600E1866F /* Aztec */; targetProxy = 5951CB991D8BC93600E1866F /* PBXContainerItemProxy */; }; - E8CE3F051F213AD0003254AB /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = E8CE3EFE1F213AAA003254AB /* Carthage Update */; - targetProxy = E8CE3F041F213AD0003254AB /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -1949,10 +1914,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Example/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; @@ -1980,10 +1942,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Example/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; @@ -2035,53 +1994,6 @@ }; name = Release; }; - E8CE3EFF1F213AAA003254AB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEBUGGING_SYMBOLS = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - E8CE3F001F213AAA003254AB /* Release-Alpha */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = "Release-Alpha"; - }; - E8CE3F011F213AAA003254AB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - E8CE3F021F213AAA003254AB /* Profiling */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profiling; - }; F111A1101DA7E8B600294FD3 /* Profiling */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2155,10 +2067,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Example/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; @@ -2270,10 +2179,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Example/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; @@ -2344,17 +2250,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - E8CE3F031F213AAA003254AB /* Build configuration list for PBXLegacyTarget "Carthage Update" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E8CE3EFF1F213AAA003254AB /* Debug */, - E8CE3F001F213AAA003254AB /* Release-Alpha */, - E8CE3F011F213AAA003254AB /* Release */, - E8CE3F021F213AAA003254AB /* Profiling */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 5951CB851D8BC93600E1866F /* Project object */; diff --git a/Example/AztecExample.xcodeproj/project.pbxproj b/Example/AztecExample.xcodeproj/project.pbxproj index 8ed52f936..a4089619e 100644 --- a/Example/AztecExample.xcodeproj/project.pbxproj +++ b/Example/AztecExample.xcodeproj/project.pbxproj @@ -10,9 +10,7 @@ 59280F2A1D47CAF40083FB59 /* content.html in Resources */ = {isa = PBXBuildFile; fileRef = 59280F281D47CAF40083FB59 /* content.html */; }; 59280F2B1D47CAF40083FB59 /* SampleText.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 59280F291D47CAF40083FB59 /* SampleText.rtf */; }; 592D62C91D8DF5590013EFF7 /* Aztec.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 599F25771D8BD045002871D6 /* Aztec.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 596719401D8BC60D00F18F7F /* Gridicons.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5967193D1D8BC60D00F18F7F /* Gridicons.framework */; }; 599F25701D8BCF57002871D6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 599F256F1D8BCF57002871D6 /* AppDelegate.swift */; }; - 599F25861D8BD998002871D6 /* Gridicons.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5967193D1D8BC60D00F18F7F /* Gridicons.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 59D2873B1D8C599B00B99C80 /* AttachmentDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D287391D8C599B00B99C80 /* AttachmentDetailsViewController.swift */; }; 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; @@ -121,7 +119,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 599F25861D8BD998002871D6 /* Gridicons.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -130,7 +127,6 @@ /* Begin PBXFileReference section */ 59280F281D47CAF40083FB59 /* content.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = content.html; sourceTree = ""; }; 59280F291D47CAF40083FB59 /* SampleText.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = SampleText.rtf; sourceTree = ""; }; - 5967193D1D8BC60D00F18F7F /* Gridicons.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Gridicons.framework; path = Carthage/Build/iOS/Gridicons.framework; sourceTree = ""; }; 599F256F1D8BCF57002871D6 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 599F25711D8BD044002871D6 /* Aztec.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Aztec.xcodeproj; path = ../Aztec.xcodeproj; sourceTree = ""; }; 59D287391D8C599B00B99C80 /* AttachmentDetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttachmentDetailsViewController.swift; sourceTree = ""; }; @@ -178,7 +174,6 @@ buildActionMask = 2147483647; files = ( F1D3610A20929EF700B4E7A5 /* Aztec.framework in Frameworks */, - 596719401D8BC60D00F18F7F /* Gridicons.framework in Frameworks */, F1D3610B20929F0200B4E7A5 /* WordPressEditor.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -198,7 +193,6 @@ isa = PBXGroup; children = ( F122C2502072AE190018ED06 /* libxml2.tbd */, - 5967193D1D8BC60D00F18F7F /* Gridicons.framework */, ); name = Frameworks; sourceTree = ""; @@ -606,7 +600,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -660,7 +654,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = NO; @@ -678,10 +672,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = PZYM8XX95Q; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Example/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = AztecExample; @@ -701,10 +692,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Automattic, Inc. (PZYM8XX95Q)"; DEVELOPMENT_TEAM = PZYM8XX95Q; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Example/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = AztecExample; @@ -823,7 +811,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -841,10 +829,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = PZYM8XX95Q; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Example/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = AztecExample; @@ -907,7 +892,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -925,10 +910,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Automattic, Inc."; DEVELOPMENT_TEAM = 99KV9Z6BKV; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Example/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = AztecExample; diff --git a/Example/Cartfile.private b/Example/Cartfile.private deleted file mode 100644 index 0c702fa1f..000000000 --- a/Example/Cartfile.private +++ /dev/null @@ -1 +0,0 @@ -github "Automattic/Gridicons-iOS" "1.0" diff --git a/Example/Cartfile.resolved b/Example/Cartfile.resolved deleted file mode 100644 index 0c702fa1f..000000000 --- a/Example/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "Automattic/Gridicons-iOS" "1.0" diff --git a/Example/Example/EditorDemoController.swift b/Example/Example/EditorDemoController.swift index 792e6771e..016a0cb5f 100644 --- a/Example/Example/EditorDemoController.swift +++ b/Example/Example/EditorDemoController.swift @@ -1,6 +1,5 @@ import Aztec import Foundation -import Gridicons import MobileCoreServices import Photos import UIKit @@ -453,19 +452,19 @@ class EditorDemoController: UIViewController { } if richTextView.isFirstResponder { - return [ UIKeyCommand(input:"B", modifierFlags: .command, action:#selector(toggleBold), discoverabilityTitle:NSLocalizedString("Bold", comment: "Discoverability title for bold formatting keyboard shortcut.")), - UIKeyCommand(input:"I", modifierFlags: .command, action:#selector(toggleItalic), discoverabilityTitle:NSLocalizedString("Italic", comment: "Discoverability title for italic formatting keyboard shortcut.")), - UIKeyCommand(input:"S", modifierFlags: [.command], action:#selector(toggleStrikethrough), discoverabilityTitle: NSLocalizedString("Strikethrough", comment:"Discoverability title for strikethrough formatting keyboard shortcut.")), - UIKeyCommand(input:"U", modifierFlags: .command, action:#selector(EditorDemoController.toggleUnderline(_:)), discoverabilityTitle: NSLocalizedString("Underline", comment:"Discoverability title for underline formatting keyboard shortcut.")), - UIKeyCommand(input:"Q", modifierFlags:[.command,.alternate], action: #selector(toggleBlockquote), discoverabilityTitle: NSLocalizedString("Block Quote", comment: "Discoverability title for block quote keyboard shortcut.")), - UIKeyCommand(input:"K", modifierFlags:.command, action:#selector(toggleLink), discoverabilityTitle: NSLocalizedString("Insert Link", comment: "Discoverability title for insert link keyboard shortcut.")), - UIKeyCommand(input:"M", modifierFlags:[.command,.alternate], action:#selector(showImagePicker), discoverabilityTitle: NSLocalizedString("Insert Media", comment: "Discoverability title for insert media keyboard shortcut.")), - UIKeyCommand(input:"U", modifierFlags:[.command, .alternate], action:#selector(toggleUnorderedList), discoverabilityTitle:NSLocalizedString("Bullet List", comment: "Discoverability title for bullet list keyboard shortcut.")), - UIKeyCommand(input:"O", modifierFlags:[.command, .alternate], action:#selector(toggleOrderedList), discoverabilityTitle:NSLocalizedString("Numbered List", comment:"Discoverability title for numbered list keyboard shortcut.")), - UIKeyCommand(input:"H", modifierFlags:[.command, .shift], action:#selector(toggleEditingMode), discoverabilityTitle:NSLocalizedString("Toggle HTML Source ", comment: "Discoverability title for HTML keyboard shortcut.")) + return [ UIKeyCommand(title: NSLocalizedString("Bold", comment: "Discoverability title for bold formatting keyboard shortcut."), action:#selector(toggleBold), input:"B", modifierFlags: .command, propertyList: nil, alternates: []), + UIKeyCommand(title:NSLocalizedString("Italic", comment: "Discoverability title for italic formatting keyboard shortcut."), action:#selector(toggleItalic), input:"I", modifierFlags: .command ), + UIKeyCommand(title: NSLocalizedString("Strikethrough", comment:"Discoverability title for strikethrough formatting keyboard shortcut."), action:#selector(toggleStrikethrough), input:"S", modifierFlags: [.command]), + UIKeyCommand(title: NSLocalizedString("Underline", comment:"Discoverability title for underline formatting keyboard shortcut."), action:#selector(EditorDemoController.toggleUnderline(_:)), input:"U", modifierFlags: .command ), + UIKeyCommand(title: NSLocalizedString("Block Quote", comment: "Discoverability title for block quote keyboard shortcut."), action: #selector(toggleBlockquote), input:"Q", modifierFlags:[.command,.alternate]), + UIKeyCommand(title: NSLocalizedString("Insert Link", comment: "Discoverability title for insert link keyboard shortcut."), action:#selector(toggleLink), input:"K", modifierFlags:.command), + UIKeyCommand(title: NSLocalizedString("Insert Media", comment: "Discoverability title for insert media keyboard shortcut."), action:#selector(showImagePicker), input:"M", modifierFlags:[.command,.alternate]), + UIKeyCommand(title:NSLocalizedString("Bullet List", comment: "Discoverability title for bullet list keyboard shortcut."), action:#selector(toggleUnorderedList), input:"U", modifierFlags:[.command, .alternate]), + UIKeyCommand(title:NSLocalizedString("Numbered List", comment:"Discoverability title for numbered list keyboard shortcut."), action:#selector(toggleOrderedList), input:"O", modifierFlags:[.command, .alternate]), + UIKeyCommand(title:NSLocalizedString("Toggle HTML Source ", comment: "Discoverability title for HTML keyboard shortcut."), action:#selector(toggleEditingMode), input:"H", modifierFlags:[.command, .shift]) ] } else if htmlTextView.isFirstResponder { - return [UIKeyCommand(input:"H", modifierFlags:[.command, .shift], action:#selector(toggleEditingMode), discoverabilityTitle:NSLocalizedString("Toggle HTML Source ", comment: "Discoverability title for HTML keyboard shortcut.")) + return [UIKeyCommand(title:NSLocalizedString("Toggle HTML Source ", comment: "Discoverability title for HTML keyboard shortcut."), action:#selector(toggleEditingMode), input:"H", modifierFlags:[.command, .shift]) ] } return [] @@ -998,7 +997,7 @@ extension EditorDemoController { toolbar.dividerTintColor = .gray } - toolbar.overflowToggleIcon = .gridicon(.ellipsis) + toolbar.overflowToggleIcon = UIImage.init(systemName: "ellipsis")! toolbar.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: 44.0) toolbar.autoresizingMask = [ .flexibleHeight ] toolbar.formatter = self @@ -1108,10 +1107,10 @@ extension EditorDemoController { static var tintedMissingImage: UIImage = { if #available(iOS 13.0, *) { - return UIImage.gridicon(.image).withTintColor(.label) + return UIImage.init(systemName: "photo")!.withTintColor(.label) } else { // Fallback on earlier versions - return .gridicon(.image) + return UIImage.init(systemName: "photo")! } }() @@ -1136,61 +1135,68 @@ extension EditorDemoController { } } +extension UIImage { + + static func systemImage(_ name: String) -> UIImage { + guard let image = UIImage(systemName: name) else { + assertionFailure("Missing system image: \(name)") + return UIImage() + } + + return image + } +} + extension FormattingIdentifier { var iconImage: UIImage { switch(self) { case .media: - return gridicon(.addOutline) + return UIImage.systemImage("plus.circle") case .p: - return gridicon(.heading) + return UIImage.systemImage("textformat.size") case .bold: - return gridicon(.bold) + return UIImage.systemImage("bold") case .italic: - return gridicon(.italic) + return UIImage.systemImage("italic") case .underline: - return gridicon(.underline) + return UIImage.systemImage("underline") case .strikethrough: - return gridicon(.strikethrough) + return UIImage.systemImage("strikethrough") case .blockquote: - return gridicon(.quote) + return UIImage.systemImage("text.quote") case .orderedlist: - return gridicon(.listOrdered) + return UIImage.systemImage("list.number") case .unorderedlist: - return gridicon(.listUnordered) + return UIImage.systemImage("list.bullet") case .link: - return gridicon(.link) + return UIImage.systemImage("link") case .horizontalruler: - return gridicon(.minusSmall) + return UIImage.systemImage("minus") case .sourcecode: - return gridicon(.code) + return UIImage.systemImage("chevron.left.slash.chevron.right") case .more: - return gridicon(.readMore) + return UIImage.systemImage("textformat.abc.dottedunderline") case .header1: - return gridicon(.headingH1) + return UIImage.systemImage("textformat.size") case .header2: - return gridicon(.headingH2) + return UIImage.systemImage("textformat.size") case .header3: - return gridicon(.headingH3) + return UIImage.systemImage("textformat.size") case .header4: - return gridicon(.headingH4) + return UIImage.systemImage("textformat.size") case .header5: - return gridicon(.headingH5) + return UIImage.systemImage("textformat.size") case .header6: - return gridicon(.headingH6) + return UIImage.systemImage("textformat.size") case .code: - return gridicon(.posts) + return UIImage.systemImage("textbox") default: - return gridicon(.help) + return UIImage.systemImage("info") } } - private func gridicon(_ gridiconType: GridiconType) -> UIImage { - let size = EditorDemoController.Constants.formatBarIconSize - return .gridicon(gridiconType, size: size) - } - var accessibilityIdentifier: String { switch(self) { case .media: diff --git a/Example/Example/MediaInserter.swift b/Example/Example/MediaInserter.swift index 69a102a93..cbdde6712 100644 --- a/Example/Example/MediaInserter.swift +++ b/Example/Example/MediaInserter.swift @@ -2,7 +2,6 @@ import Foundation import UIKit import Aztec import AVFoundation -import Gridicons class MediaInserter { @@ -71,7 +70,7 @@ class MediaInserter timer.invalidate() let message = NSAttributedString(string: "Upload failed!", attributes: attachmentTextAttributes) attachment.message = message - attachment.overlayImage = .gridicon(.refresh) + attachment.overlayImage = UIImage.systemImage("arrow.clockwise") } if progress.fractionCompleted >= 1 { timer.invalidate() diff --git a/Example/Example/TextViewAttachmentDelegateProvider.swift b/Example/Example/TextViewAttachmentDelegateProvider.swift index d61f382a0..83d9dc75e 100644 --- a/Example/Example/TextViewAttachmentDelegateProvider.swift +++ b/Example/Example/TextViewAttachmentDelegateProvider.swift @@ -1,7 +1,6 @@ import Foundation import Aztec import UIKit -import Gridicons import AVFoundation import AVKit @@ -43,16 +42,15 @@ class TextViewAttachmentDelegateProvider: NSObject, TextViewAttachmentDelegate { return placeholderImage(for: attachment) } - func placeholderImage(for attachment: NSTextAttachment) -> UIImage { - let imageSize = CGSize(width:64, height:64) + func placeholderImage(for attachment: NSTextAttachment) -> UIImage { var placeholderImage: UIImage switch attachment { case _ as ImageAttachment: - placeholderImage = .gridicon(.image, size: imageSize) + placeholderImage = UIImage.systemImage("photo") case _ as VideoAttachment: - placeholderImage = .gridicon(.video, size: imageSize) + placeholderImage = UIImage.systemImage("video") default: - placeholderImage = .gridicon(.attachment, size: imageSize) + placeholderImage = UIImage.systemImage("paperclip") } if #available(iOS 13.0, *) { placeholderImage = placeholderImage.withTintColor(.label) @@ -106,7 +104,7 @@ class TextViewAttachmentDelegateProvider: NSObject, TextViewAttachmentDelegate { let message = NSLocalizedString("Options", comment: "Options to show when tapping on a media object on the post/page editor.") attachment.message = NSAttributedString(string: message, attributes: attachmentTextAttributes) } - attachment.overlayImage = UIImage.gridicon(.pencil, size: CGSize(width: 32.0, height: 32.0)).withRenderingMode(.alwaysTemplate) + attachment.overlayImage = UIImage.init(systemName: "square.and.pencil")!.withRenderingMode(.alwaysTemplate) textView.refresh(attachment) currentSelectedAttachment = attachment } diff --git a/Example/carthage.sh b/Example/carthage.sh deleted file mode 100755 index 41de89f1a..000000000 --- a/Example/carthage.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -# carthage.sh -# Usage example: ./carthage.sh build --platform iOS -# This script was copied from here: https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323 - -set -euo pipefail - -xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) -trap 'rm -f "$xcconfig"' INT TERM HUP EXIT - -# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise -# the build will fail on lipo due to duplicate architectures. -echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig -echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig - -export XCODE_XCCONFIG_FILE="$xcconfig" -carthage "$@" diff --git a/README.md b/README.md index a6797e0bb..88b139b5b 100644 --- a/README.md +++ b/README.md @@ -22,28 +22,11 @@ WordPressEditor is a Swift library that provides a plugin to make Aztec work wit ## Requirements - iOS 10 and above -- Xcode 9.3 and above +- Xcode 11 and above ## Running the Example App -To run the Example app, you first need to make sure its dependencies are installed: - -- Make sure you have [Carthage](https://github.com/Carthage/Carthage) installed. -- Using the command line: - -```bash -cd Example -carthage update --platform iOS -``` - -*If using XCode 12 use the follow script:* - -```bash -cd Example -./carthage.sh update --platform iOS -``` - -Once Carthage finishes, you should open the file `Aztec.xcworkspace` from the root directory of Aztec. +To run the Example app, you first open the file `Aztec.xcworkspace` from the root directory of Aztec. Make sure the `AztecExample` target it selected, and press CMD + R to run it. diff --git a/Scripts/carthage_script.sh b/Scripts/carthage_script.sh deleted file mode 100755 index 70080c842..000000000 --- a/Scripts/carthage_script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -cd "${PROJECT_DIR}/Example" -if [ -d "Carthage/Build/iOS" ]; then - echo "Carthage: found dependencies!" -else - carthage update -fi