Skip to content

Commit d8cf065

Browse files
committed
Replace Gridicons with SFSymbols.
1 parent bec35ea commit d8cf065

4 files changed

Lines changed: 33 additions & 47 deletions

File tree

Example/AztecExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
59280F2A1D47CAF40083FB59 /* content.html in Resources */ = {isa = PBXBuildFile; fileRef = 59280F281D47CAF40083FB59 /* content.html */; };
1111
59280F2B1D47CAF40083FB59 /* SampleText.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 59280F291D47CAF40083FB59 /* SampleText.rtf */; };
1212
592D62C91D8DF5590013EFF7 /* Aztec.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 599F25771D8BD045002871D6 /* Aztec.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
13-
596719401D8BC60D00F18F7F /* Gridicons.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5967193D1D8BC60D00F18F7F /* Gridicons.framework */; };
1413
599F25701D8BCF57002871D6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 599F256F1D8BCF57002871D6 /* AppDelegate.swift */; };
15-
599F25861D8BD998002871D6 /* Gridicons.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5967193D1D8BC60D00F18F7F /* Gridicons.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1614
59D2873B1D8C599B00B99C80 /* AttachmentDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D287391D8C599B00B99C80 /* AttachmentDetailsViewController.swift */; };
1715
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
1816
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
@@ -121,7 +119,6 @@
121119
dstPath = "";
122120
dstSubfolderSpec = 10;
123121
files = (
124-
599F25861D8BD998002871D6 /* Gridicons.framework in CopyFiles */,
125122
);
126123
runOnlyForDeploymentPostprocessing = 0;
127124
};
@@ -130,7 +127,6 @@
130127
/* Begin PBXFileReference section */
131128
59280F281D47CAF40083FB59 /* content.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = content.html; sourceTree = "<group>"; };
132129
59280F291D47CAF40083FB59 /* SampleText.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = SampleText.rtf; sourceTree = "<group>"; };
133-
5967193D1D8BC60D00F18F7F /* Gridicons.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Gridicons.framework; path = Carthage/Build/iOS/Gridicons.framework; sourceTree = "<group>"; };
134130
599F256F1D8BCF57002871D6 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
135131
599F25711D8BD044002871D6 /* Aztec.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Aztec.xcodeproj; path = ../Aztec.xcodeproj; sourceTree = "<group>"; };
136132
59D287391D8C599B00B99C80 /* AttachmentDetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttachmentDetailsViewController.swift; sourceTree = "<group>"; };
@@ -178,7 +174,6 @@
178174
buildActionMask = 2147483647;
179175
files = (
180176
F1D3610A20929EF700B4E7A5 /* Aztec.framework in Frameworks */,
181-
596719401D8BC60D00F18F7F /* Gridicons.framework in Frameworks */,
182177
F1D3610B20929F0200B4E7A5 /* WordPressEditor.framework in Frameworks */,
183178
);
184179
runOnlyForDeploymentPostprocessing = 0;
@@ -198,7 +193,6 @@
198193
isa = PBXGroup;
199194
children = (
200195
F122C2502072AE190018ED06 /* libxml2.tbd */,
201-
5967193D1D8BC60D00F18F7F /* Gridicons.framework */,
202196
);
203197
name = Frameworks;
204198
sourceTree = "<group>";
@@ -606,7 +600,7 @@
606600
GCC_WARN_UNUSED_FUNCTION = YES;
607601
GCC_WARN_UNUSED_VARIABLE = YES;
608602
HEADER_SEARCH_PATHS = /usr/include/libxml2;
609-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
603+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
610604
MTL_ENABLE_DEBUG_INFO = YES;
611605
ONLY_ACTIVE_ARCH = YES;
612606
SDKROOT = iphoneos;
@@ -660,7 +654,7 @@
660654
GCC_WARN_UNUSED_FUNCTION = YES;
661655
GCC_WARN_UNUSED_VARIABLE = YES;
662656
HEADER_SEARCH_PATHS = /usr/include/libxml2;
663-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
657+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
664658
MTL_ENABLE_DEBUG_INFO = NO;
665659
SDKROOT = iphoneos;
666660
STRIP_INSTALLED_PRODUCT = NO;
@@ -823,7 +817,7 @@
823817
GCC_WARN_UNUSED_FUNCTION = YES;
824818
GCC_WARN_UNUSED_VARIABLE = YES;
825819
HEADER_SEARCH_PATHS = /usr/include/libxml2;
826-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
820+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
827821
MTL_ENABLE_DEBUG_INFO = NO;
828822
ONLY_ACTIVE_ARCH = YES;
829823
SDKROOT = iphoneos;
@@ -907,7 +901,7 @@
907901
GCC_WARN_UNUSED_FUNCTION = YES;
908902
GCC_WARN_UNUSED_VARIABLE = YES;
909903
HEADER_SEARCH_PATHS = /usr/include/libxml2;
910-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
904+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
911905
MTL_ENABLE_DEBUG_INFO = YES;
912906
ONLY_ACTIVE_ARCH = YES;
913907
SDKROOT = iphoneos;

Example/Example/EditorDemoController.swift

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Aztec
22
import Foundation
3-
import Gridicons
43
import MobileCoreServices
54
import Photos
65
import UIKit
@@ -998,7 +997,7 @@ extension EditorDemoController {
998997
toolbar.dividerTintColor = .gray
999998
}
1000999

1001-
toolbar.overflowToggleIcon = .gridicon(.ellipsis)
1000+
toolbar.overflowToggleIcon = UIImage.init(systemName: "ellipsis")!
10021001
toolbar.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: 44.0)
10031002
toolbar.autoresizingMask = [ .flexibleHeight ]
10041003
toolbar.formatter = self
@@ -1108,10 +1107,10 @@ extension EditorDemoController {
11081107

11091108
static var tintedMissingImage: UIImage = {
11101109
if #available(iOS 13.0, *) {
1111-
return UIImage.gridicon(.image).withTintColor(.label)
1110+
return UIImage.init(systemName: "photo")!.withTintColor(.label)
11121111
} else {
11131112
// Fallback on earlier versions
1114-
return .gridicon(.image)
1113+
return UIImage.init(systemName: "photo")!
11151114
}
11161115
}()
11171116

@@ -1142,55 +1141,50 @@ extension FormattingIdentifier {
11421141

11431142
switch(self) {
11441143
case .media:
1145-
return gridicon(.addOutline)
1144+
return UIImage.init(systemName: "plus.circle")!
11461145
case .p:
1147-
return gridicon(.heading)
1146+
return UIImage.init(systemName: "textformat.size")!
11481147
case .bold:
1149-
return gridicon(.bold)
1148+
return UIImage.init(systemName: "bold")!
11501149
case .italic:
1151-
return gridicon(.italic)
1150+
return UIImage.init(systemName: "italic")!
11521151
case .underline:
1153-
return gridicon(.underline)
1152+
return UIImage.init(systemName: "underline")!
11541153
case .strikethrough:
1155-
return gridicon(.strikethrough)
1154+
return UIImage.init(systemName: "strikethrough")!
11561155
case .blockquote:
1157-
return gridicon(.quote)
1156+
return UIImage.init(systemName: "text.quote")!
11581157
case .orderedlist:
1159-
return gridicon(.listOrdered)
1158+
return UIImage.init(systemName: "list.number")!
11601159
case .unorderedlist:
1161-
return gridicon(.listUnordered)
1160+
return UIImage.init(systemName: "list.bullet")!
11621161
case .link:
1163-
return gridicon(.link)
1162+
return UIImage.init(systemName: "link")!
11641163
case .horizontalruler:
1165-
return gridicon(.minusSmall)
1164+
return UIImage.init(systemName: "minus")!
11661165
case .sourcecode:
1167-
return gridicon(.code)
1166+
return UIImage.init(systemName: "chevron.left.slash.chevron.right")!
11681167
case .more:
1169-
return gridicon(.readMore)
1168+
return UIImage.init(systemName: "ellipsis")!
11701169
case .header1:
1171-
return gridicon(.headingH1)
1170+
return UIImage.init(systemName: "textformat.size")!
11721171
case .header2:
1173-
return gridicon(.headingH2)
1172+
return UIImage.init(systemName: "textformat.size")!
11741173
case .header3:
1175-
return gridicon(.headingH3)
1174+
return UIImage.init(systemName: "textformat.size")!
11761175
case .header4:
1177-
return gridicon(.headingH4)
1176+
return UIImage.init(systemName: "textformat.size")!
11781177
case .header5:
1179-
return gridicon(.headingH5)
1178+
return UIImage.init(systemName: "textformat.size")!
11801179
case .header6:
1181-
return gridicon(.headingH6)
1180+
return UIImage.init(systemName: "textformat.size")!
11821181
case .code:
1183-
return gridicon(.posts)
1182+
return UIImage.init(systemName: "textbox")!
11841183
default:
1185-
return gridicon(.help)
1184+
return UIImage.init(systemName: "info")!
11861185
}
11871186
}
11881187

1189-
private func gridicon(_ gridiconType: GridiconType) -> UIImage {
1190-
let size = EditorDemoController.Constants.formatBarIconSize
1191-
return .gridicon(gridiconType, size: size)
1192-
}
1193-
11941188
var accessibilityIdentifier: String {
11951189
switch(self) {
11961190
case .media:

Example/Example/MediaInserter.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Foundation
22
import UIKit
33
import Aztec
44
import AVFoundation
5-
import Gridicons
65

76
class MediaInserter
87
{
@@ -71,7 +70,7 @@ class MediaInserter
7170
timer.invalidate()
7271
let message = NSAttributedString(string: "Upload failed!", attributes: attachmentTextAttributes)
7372
attachment.message = message
74-
attachment.overlayImage = .gridicon(.refresh)
73+
attachment.overlayImage = UIImage.init(systemName: "arrow.clockwise")
7574
}
7675
if progress.fractionCompleted >= 1 {
7776
timer.invalidate()

Example/Example/TextViewAttachmentDelegateProvider.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Foundation
22
import Aztec
33
import UIKit
4-
import Gridicons
54
import AVFoundation
65
import AVKit
76

@@ -48,11 +47,11 @@ class TextViewAttachmentDelegateProvider: NSObject, TextViewAttachmentDelegate {
4847
var placeholderImage: UIImage
4948
switch attachment {
5049
case _ as ImageAttachment:
51-
placeholderImage = .gridicon(.image, size: imageSize)
50+
placeholderImage = UIImage.init(systemName: "photo")!
5251
case _ as VideoAttachment:
53-
placeholderImage = .gridicon(.video, size: imageSize)
52+
placeholderImage = UIImage.init(systemName: "video")!
5453
default:
55-
placeholderImage = .gridicon(.attachment, size: imageSize)
54+
placeholderImage = UIImage.init(systemName: "paperclip")!
5655
}
5756
if #available(iOS 13.0, *) {
5857
placeholderImage = placeholderImage.withTintColor(.label)
@@ -106,7 +105,7 @@ class TextViewAttachmentDelegateProvider: NSObject, TextViewAttachmentDelegate {
106105
let message = NSLocalizedString("Options", comment: "Options to show when tapping on a media object on the post/page editor.")
107106
attachment.message = NSAttributedString(string: message, attributes: attachmentTextAttributes)
108107
}
109-
attachment.overlayImage = UIImage.gridicon(.pencil, size: CGSize(width: 32.0, height: 32.0)).withRenderingMode(.alwaysTemplate)
108+
attachment.overlayImage = UIImage.init(systemName: "square.and.pencil")!.withRenderingMode(.alwaysTemplate)
110109
textView.refresh(attachment)
111110
currentSelectedAttachment = attachment
112111
}

0 commit comments

Comments
 (0)