@@ -1055,6 +1055,7 @@ extension EditorDemoController {
10551055
10561056}
10571057
1058+ // MARK: - TextViewAttachmentDelegate
10581059
10591060extension EditorDemoController : TextViewAttachmentDelegate {
10601061
@@ -1087,7 +1088,7 @@ extension EditorDemoController: TextViewAttachmentDelegate {
10871088
10881089 func placeholderImage( for attachment: NSTextAttachment ) -> UIImage {
10891090 let imageSize = CGSize ( width: 64 , height: 64 )
1090- let placeholderImage : UIImage
1091+ var placeholderImage : UIImage
10911092 switch attachment {
10921093 case _ as ImageAttachment :
10931094 placeholderImage = Gridicon . iconOfType ( . image, withSize: imageSize)
@@ -1096,7 +1097,9 @@ extension EditorDemoController: TextViewAttachmentDelegate {
10961097 default :
10971098 placeholderImage = Gridicon . iconOfType ( . attachment, withSize: imageSize)
10981099 }
1099-
1100+ if #available( iOS 13 . 0 , * ) {
1101+ placeholderImage = placeholderImage. withTintColor ( . label)
1102+ }
11001103 return placeholderImage
11011104 }
11021105
@@ -1501,10 +1504,19 @@ private extension EditorDemoController
15011504
15021505extension EditorDemoController {
15031506
1507+ static var tintedMissingImage : UIImage = {
1508+ if #available( iOS 13 . 0 , * ) {
1509+ return Gridicon . iconOfType ( . image) . withTintColor ( . label)
1510+ } else {
1511+ // Fallback on earlier versions
1512+ return Gridicon . iconOfType ( . image)
1513+ }
1514+ } ( )
1515+
15041516 struct Constants {
15051517 static let defaultContentFont = UIFont . systemFont ( ofSize: 14 )
15061518 static let defaultHtmlFont = UIFont . systemFont ( ofSize: 24 )
1507- static let defaultMissingImage = Gridicon . iconOfType ( . image )
1519+ static let defaultMissingImage = tintedMissingImage
15081520 static let formatBarIconSize = CGSize ( width: 20.0 , height: 20.0 )
15091521 static let headers = [ Header . HeaderType. none, . h1, . h2, . h3, . h4, . h5, . h6]
15101522 static let lists = [ TextList . Style. unordered, . ordered]
0 commit comments