From 29e84161bddbd412a562ef658cc8deb950898ae8 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 22 Jun 2017 13:24:40 +0100 Subject: [PATCH 1/4] Remove gridicons references from the main Aztec pod. Only keep references that are done on the demo project. --- .../Converters/HTMLNodeToNSAttributedString.swift | 1 - Aztec/Classes/TextKit/TextView.swift | 3 +-- Aztec/Classes/TextKit/VideoAttachment.swift | 3 +-- .../Formatters/BlockquoteFormatterTests.swift | 3 +-- AztecTests/Formatters/PreFormaterTests.swift | 1 - AztecTests/TextViewStubAttachmentDelegate.swift | 8 ++++---- AztecTests/TextViewTests.swift | 13 ++++++------- Example/Cartfile | 2 +- Example/Cartfile.resolved | 2 +- WordPress-Aztec-iOS.podspec | 2 -- 10 files changed, 15 insertions(+), 23 deletions(-) diff --git a/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift b/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift index 8a27bd514..19a7115fa 100644 --- a/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift +++ b/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift @@ -1,5 +1,4 @@ import Foundation -import Gridicons import UIKit class HTMLNodeToNSAttributedString: SafeConverter { diff --git a/Aztec/Classes/TextKit/TextView.swift b/Aztec/Classes/TextKit/TextView.swift index a41dc66e6..b3bc3ae91 100644 --- a/Aztec/Classes/TextKit/TextView.swift +++ b/Aztec/Classes/TextKit/TextView.swift @@ -1,7 +1,6 @@ import UIKit import Foundation -import Gridicons // MARK: - TextViewAttachmentDelegate @@ -196,7 +195,7 @@ open class TextView: UITextView { required public init?(coder aDecoder: NSCoder) { defaultFont = UIFont.systemFont(ofSize: 14) - defaultMissingImage = Gridicon.iconOfType(.image) + defaultMissingImage = UIImage() super.init(coder: aDecoder) commonInit() } diff --git a/Aztec/Classes/TextKit/VideoAttachment.swift b/Aztec/Classes/TextKit/VideoAttachment.swift index e9d1e5c3c..9598d7fd3 100644 --- a/Aztec/Classes/TextKit/VideoAttachment.swift +++ b/Aztec/Classes/TextKit/VideoAttachment.swift @@ -1,6 +1,5 @@ import Foundation import UIKit -import Gridicons protocol VideoAttachmentDelegate: class { func videoAttachment( @@ -43,7 +42,7 @@ open class VideoAttachment: MediaAttachment { super.init(identifier: identifier, url: posterURL) - self.overlayImage = Gridicon.iconOfType(.video) + self.overlayImage = UIImage() } /// Required Initializer diff --git a/AztecTests/Formatters/BlockquoteFormatterTests.swift b/AztecTests/Formatters/BlockquoteFormatterTests.swift index e361c2443..53ec108b8 100644 --- a/AztecTests/Formatters/BlockquoteFormatterTests.swift +++ b/AztecTests/Formatters/BlockquoteFormatterTests.swift @@ -1,5 +1,4 @@ import XCTest -import Gridicons @testable import Aztec // MARK: - BlockquoteFormatterTests Tests @@ -101,7 +100,7 @@ class BlockquoteFormatterTests: XCTestCase { private extension BlockquoteFormatterTests { var testTextView: TextView { - let view = TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.image)) + let view = TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) view.text = plainText return view } diff --git a/AztecTests/Formatters/PreFormaterTests.swift b/AztecTests/Formatters/PreFormaterTests.swift index 5f89d18f6..fdde9e477 100644 --- a/AztecTests/Formatters/PreFormaterTests.swift +++ b/AztecTests/Formatters/PreFormaterTests.swift @@ -1,5 +1,4 @@ import XCTest -import Gridicons @testable import Aztec diff --git a/AztecTests/TextViewStubAttachmentDelegate.swift b/AztecTests/TextViewStubAttachmentDelegate.swift index f8bd10279..dd3d935d7 100644 --- a/AztecTests/TextViewStubAttachmentDelegate.swift +++ b/AztecTests/TextViewStubAttachmentDelegate.swift @@ -1,6 +1,6 @@ import Foundation import Aztec -import Gridicons +import UIKit class TextViewStubAttachmentDelegate: TextViewAttachmentDelegate { @@ -17,11 +17,11 @@ class TextViewStubAttachmentDelegate: TextViewAttachmentDelegate { let placeholderImage: UIImage switch attachment { case _ as ImageAttachment: - placeholderImage = Gridicon.iconOfType(.image, withSize: imageSize) + placeholderImage = UIImage() case _ as VideoAttachment: - placeholderImage = Gridicon.iconOfType(.video, withSize: imageSize) + placeholderImage = UIImage() default: - placeholderImage = Gridicon.iconOfType(.attachment, withSize: imageSize) + placeholderImage = UIImage() } diff --git a/AztecTests/TextViewTests.swift b/AztecTests/TextViewTests.swift index b3d1e9637..eb6acc503 100644 --- a/AztecTests/TextViewTests.swift +++ b/AztecTests/TextViewTests.swift @@ -1,6 +1,5 @@ import XCTest @testable import Aztec -import Gridicons class TextViewTests: XCTestCase { @@ -25,13 +24,13 @@ class TextViewTests: XCTestCase { // MARK: - TextView construction func createEmptyTextView() -> Aztec.TextView { - let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) + let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) richTextView.textAttachmentDelegate = attachmentDelegate return richTextView } func createTextView(withHTML html: String) -> Aztec.TextView { - let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) + let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) richTextView.textAttachmentDelegate = attachmentDelegate richTextView.setHTML(html) @@ -40,7 +39,7 @@ class TextViewTests: XCTestCase { func createTextViewWithContent() -> Aztec.TextView { let paragraph = "Lorem ipsum dolar sit amet.\n" - let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) + let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) richTextView.textAttachmentDelegate = attachmentDelegate let attributes = [NSParagraphStyleAttributeName : NSParagraphStyle()] let templateString = NSMutableAttributedString(string: paragraph, attributes: attributes) @@ -58,7 +57,7 @@ class TextViewTests: XCTestCase { func testTextViewReferencesStorage() { - let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) + let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) textView.text = "Foo" XCTAssert(textView.text == "Foo") @@ -79,7 +78,7 @@ class TextViewTests: XCTestCase { // MARK: - Test Index Wrangling func testMaxIndex() { - let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) + let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) textView.text = "foo" @@ -92,7 +91,7 @@ class TextViewTests: XCTestCase { } func testAdjustedIndex() { - let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) + let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) textView.text = "foobarbaz" diff --git a/Example/Cartfile b/Example/Cartfile index d8fc3c9d9..45854aaf5 100644 --- a/Example/Cartfile +++ b/Example/Cartfile @@ -1 +1 @@ -github "Automattic/Gridicons-iOS" "0.7" +github "Automattic/Gridicons-iOS" "0.8" diff --git a/Example/Cartfile.resolved b/Example/Cartfile.resolved index d8fc3c9d9..45854aaf5 100644 --- a/Example/Cartfile.resolved +++ b/Example/Cartfile.resolved @@ -1 +1 @@ -github "Automattic/Gridicons-iOS" "0.7" +github "Automattic/Gridicons-iOS" "0.8" diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index 9ad339d1e..a58b9f950 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -38,6 +38,4 @@ Pod::Spec.new do |s| s.xcconfig = {'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2'} s.preserve_paths = 'Aztec/Modulemaps/libxml2/*' - s.dependency 'Gridicons', '0.8' - end From 87c3f1f0be8f9ab67fbb57e320201f8b2bbcf1b8 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 23 Jun 2017 23:18:08 +0100 Subject: [PATCH 2/4] Add resources for play and image. --- Aztec.xcodeproj/project.pbxproj | 12 ++++++++++++ Aztec/Assets/Media.xcassets/Contents.json | 6 ++++++ .../Media.xcassets/Image.imageset/Contents.json | 12 ++++++++++++ .../Image.imageset/gridicons-image.pdf | Bin 0 -> 4012 bytes .../Media.xcassets/play.imageset/Contents.json | 12 ++++++++++++ .../play.imageset/gridicons-play.pdf | Bin 0 -> 3925 bytes Aztec/Classes/TextKit/VideoAttachment.swift | 4 +++- 7 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 Aztec/Assets/Media.xcassets/Contents.json create mode 100644 Aztec/Assets/Media.xcassets/Image.imageset/Contents.json create mode 100644 Aztec/Assets/Media.xcassets/Image.imageset/gridicons-image.pdf create mode 100644 Aztec/Assets/Media.xcassets/play.imageset/Contents.json create mode 100644 Aztec/Assets/Media.xcassets/play.imageset/gridicons-play.pdf diff --git a/Aztec.xcodeproj/project.pbxproj b/Aztec.xcodeproj/project.pbxproj index 250bf447e..3b4ae05a1 100644 --- a/Aztec.xcodeproj/project.pbxproj +++ b/Aztec.xcodeproj/project.pbxproj @@ -124,6 +124,7 @@ F1FA0E861E6EF514009D98EE /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1FA0E7E1E6EF514009D98EE /* Node.swift */; }; F1FA0E871E6EF514009D98EE /* StandardElementType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1FA0E7F1E6EF514009D98EE /* StandardElementType.swift */; }; F1FA0E881E6EF514009D98EE /* TextNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1FA0E801E6EF514009D98EE /* TextNode.swift */; }; + FF0714021EFD78AF00E50713 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FF0714001EFD78AF00E50713 /* Media.xcassets */; }; FF152D8E1E68552A00FF596C /* StringRangeConversionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF152D8D1E68552A00FF596C /* StringRangeConversionTests.swift */; }; FF20D6401EDC389A00294B78 /* HTMLAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF20D63D1EDC389A00294B78 /* HTMLAttributes.swift */; }; FF20D6411EDC389A00294B78 /* HTMLProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF20D63E1EDC389A00294B78 /* HTMLProcessor.swift */; }; @@ -288,6 +289,7 @@ F1FA0E7E1E6EF514009D98EE /* Node.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Node.swift; sourceTree = ""; }; F1FA0E7F1E6EF514009D98EE /* StandardElementType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StandardElementType.swift; sourceTree = ""; }; F1FA0E801E6EF514009D98EE /* TextNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextNode.swift; sourceTree = ""; }; + FF0714001EFD78AF00E50713 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; FF152D8D1E68552A00FF596C /* StringRangeConversionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringRangeConversionTests.swift; sourceTree = ""; }; FF20D63D1EDC389A00294B78 /* HTMLAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTMLAttributes.swift; sourceTree = ""; }; FF20D63E1EDC389A00294B78 /* HTMLProcessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTMLProcessor.swift; sourceTree = ""; }; @@ -357,6 +359,7 @@ 5951CB901D8BC93600E1866F /* Aztec */ = { isa = PBXGroup; children = ( + FF0713FE1EFD78AF00E50713 /* Assets */, 5951CB921D8BC93600E1866F /* Info.plist */, 599F25001D8BC9A1002871D6 /* Classes */, 599F25911D8BDCA9002871D6 /* Documentation */, @@ -781,6 +784,14 @@ path = Data; sourceTree = ""; }; + FF0713FE1EFD78AF00E50713 /* Assets */ = { + isa = PBXGroup; + children = ( + FF0714001EFD78AF00E50713 /* Media.xcassets */, + ); + path = Assets; + sourceTree = ""; + }; FF20D63C1EDC389A00294B78 /* Processor */ = { isa = PBXGroup; children = ( @@ -896,6 +907,7 @@ buildActionMask = 2147483647; files = ( F138062A1E3651DC00CFB9ED /* ControlCharacters.rtf in Resources */, + FF0714021EFD78AF00E50713 /* Media.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Aztec/Assets/Media.xcassets/Contents.json b/Aztec/Assets/Media.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Aztec/Assets/Media.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Aztec/Assets/Media.xcassets/Image.imageset/Contents.json b/Aztec/Assets/Media.xcassets/Image.imageset/Contents.json new file mode 100644 index 000000000..30bf4ae6b --- /dev/null +++ b/Aztec/Assets/Media.xcassets/Image.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "gridicons-image.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Aztec/Assets/Media.xcassets/Image.imageset/gridicons-image.pdf b/Aztec/Assets/Media.xcassets/Image.imageset/gridicons-image.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f8f4c1a6b98f1f0a7837554ac0ec3b2bce9e2d1f GIT binary patch literal 4012 zcmai%c{tQ<7soAA7_yWlQvDJm*=8}8r;MFMjitrdXR|Y6Ldu#YTe4*-$r2$;QMQmh z=`mzWg~X8TOLlo@RB!b@&vm`O>vzrXo^zl3KKFgj`Q!5yGtktQhRGnnVvW=V>SWI1 z{f@?Fup9sdNH_=Z$&-MrKGDUNYzH7|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z&Hul>Z+S?B5r*OIN| zpG|J{($xJvYf8xt+vt#T4cYC4wIX!GE=n#%QoB_9i%x+KC2}ot!29u1(_C9*V%JD; zt;DxyD+!(XX}+Et)wa0S#yQ8%$z+w&gAZ$z)_a$o#|fWDyFBe@vva}+^J`R=1GdsP z@JlT*6I19_bV6E`isv=9%>^%rv(4DhO3>oQKdG8dp*tuo4}<@NRXV@YZ8XT$)zDDK zx)TWi9bkHR^Dj6QrT~?PBVY)G0t{vfg^JVOU!K36herK`%XpeP+lfh23>q|1Mz$xpXws2= zXHU9}AQ685|Lde)ZbTa}O;sSk(EmPwJQ9gO0ye-88v;qw9Xqpt%TF5=fuv~<`t!?% zfGg2d%bzwV6i&O=|JZ1k`iD&pNh{-@eh4^{)&hUpph)bN<=6@ zPEi4dz}mnR@HhnQ2^JI6LTiKn0~v79 A(EtDd literal 0 HcmV?d00001 diff --git a/Aztec/Assets/Media.xcassets/play.imageset/Contents.json b/Aztec/Assets/Media.xcassets/play.imageset/Contents.json new file mode 100644 index 000000000..a54066a68 --- /dev/null +++ b/Aztec/Assets/Media.xcassets/play.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "gridicons-play.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Aztec/Assets/Media.xcassets/play.imageset/gridicons-play.pdf b/Aztec/Assets/Media.xcassets/play.imageset/gridicons-play.pdf new file mode 100644 index 0000000000000000000000000000000000000000..19231ad4f86e3a92aeab3e2ed45fa103a77eeb35 GIT binary patch literal 3925 zcmai%c{o&W8^C5-Hel0?=lMI{=t zWQo@#TPkE35<+B6-Wk>V>$hCjd#-cMIrBZwb3f1Xz3)Fhw~Vo_{t*}i0hVcGd|^!G zE!=t4*aSubP=Jhg1*@q6ibh0FXNn7eVoIifqCUx;LiA!j-EkD6E|EZXBmx>5U~h^S z5$6H+V?T*C^5bB179v09-rr&8*S;o3|YNOGT{+ZW>dCx%W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 +0100 Subject: [PATCH 3/4] Update images assets. --- .../Image.imageset/gridicons-image.pdf | Bin 4012 -> 4007 bytes .../play.imageset/gridicons-play.pdf | Bin 3925 -> 4067 bytes Aztec/Classes/TextKit/VideoAttachment.swift | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Aztec/Assets/Media.xcassets/Image.imageset/gridicons-image.pdf b/Aztec/Assets/Media.xcassets/Image.imageset/gridicons-image.pdf index f8f4c1a6b98f1f0a7837554ac0ec3b2bce9e2d1f..ba4edd9880c83723a444e4f0b30ee03eddb838d1 100644 GIT binary patch delta 561 zcmZ1@zg&JoK)r5&V;+kk$L{mmHS0p86g(#v$8T6}mvALZ`)t^)bN`plQuJa`IVMr@ zs7?J$Lf7%9zE!Uc#Mg@+yM5^0hItJ2Y{H)pdN500kZj3K)of&oN{ZC1%SqL>O`86$ z(K@SBssDp0``u-q>>fI61U#6VrXIo(=aIOh>BYN6@+EOi6H~I459Z!(e&?1pE!ktH zk56n^9P7J@v*)%Xs|Sc*ov^j{ubiQPwX{*%1DT4lq)Vq+`7(RwXl>=+;Z^!BZEpAb@RJiC8uSI8Nh{bX$SoxAE5JBzf@0@({+|2Ix7Gdt3eGI^1P zZNX9IcONoDzt7zHbc^BUYr-+@0+0F5b3cj}O#C!sqnUuN#Okz*$5zQ`#U#~yv_E$< z=tfrE;YN{_Lhrgb&08~WCwxzo)9%Ro^Oi;VVe7=t^G_~OVL7zAzU$D+3lUFz<1C_; zA6`jWw{G(8U*7*kEY)@w7)n`Q5S(>2D)L^+94$LuG40eBv)1N3d17%eX=Qnd_sr;3 z*J{^z7o6JgS;^1;Xx8-no5408{x#+MUHj0w{q*IH_NJQqpZ8r~HF@VUu{ygCov-zq zzeIX+rRJp+mlUNY=7L!HlRX)Em`n^Ohcm{q8W|`Unr+_6=*|scPG;qu&u(mJY;105 zIC(X1qZUws0SGAMDR6-q1_s8aX6RzZMwTX%!}!$e&Cz8HOiV4%#f*(iEz!jcOpUOZ zYK)-{=rU7uy~ZX+P%%D)GmTBmEhcmE+r_6O8(J7yrW&M}SeP3cC#D&iCnuSwC8k;= r8=I$^8=Bj3*$`Bs5UXHk$5mXCSX5F`l$yq6Y-(xBrK;-c@5TiHUEj=9 diff --git a/Aztec/Assets/Media.xcassets/play.imageset/gridicons-play.pdf b/Aztec/Assets/Media.xcassets/play.imageset/gridicons-play.pdf index 19231ad4f86e3a92aeab3e2ed45fa103a77eeb35..a34b2e8eaa014c2da9f662b7f33ca61ff2199d0c 100644 GIT binary patch delta 813 zcmcaA_gH>HKz;25TfV~zJgwj7JUTnoD~Bg@hIPriE6fZ2d1fx1^4oi>r_=URVrF&E z4jVk~k(?*Mq2Hr-R6!)yU7$?l(FBvLZEF_3)Ll8LGrBlD&^J85Hrvo@p#qcT4#S^? z4HG6GX;eH|_(7(wlPP>-_FLW!4y9)+8rTh9zmcjv#A1J|_i|L&{4I~0%un!El>Oak zP;_znjHx~Umb6wMw43E_^gpI>_5M%O?}UEJb53?PJ|nW$`K8OfXOSK8oL{_5xKi^{ zic5-86LUeV{G=={Qw0MB5N&8-Hkp+%mc_(C!DMn8qkE>lYek8Ba7kiGs)CJ;g1&pP zp@IcaZ4j58or0YmOgl&jq#dLrq_QAY0ZE&Fa-xEPo+*-QOC;4ksd?!o84895n@=;g zaxobiOb+BxXSAGL$zuv}#3mruaPlo4H7WhD)S}|d{5%DHLp>8D;|z@^^YEHT8beLh zaIrEnFf=zXGcq$YHZ(CYnH_?`2p{2(ilWpsE&~Na zlgWE|WwcFAfx!X-3V8}#V1|K#v4J7Fn6a^;>0}l@wR#I9bSVQ91E3YCMi?7e7@&(8 zm{1y!AasR@Sl#zv+X>Wqyo&A@t;M1& delta 714 zcmaDXe^qWmK)tWOHy@KC&)xHy_gIgJX&7Yt8))-8n9N#m(&D>+&P7LOXZgzc(?q$$ z3=Rs*b?7}iBlN~Kq3}_yU~|i=+z-qpr%uG$d|h!cJK%fNcfHQ%EP8o;nrxpx=t$0y zOnwm^jWsGGpGEgv@+{WlG zXJ-dfVgXfRW22z&lbV-alA&O^*^H@`i_voOULJKui^)%UOd%TOc-0vVCcE*f@gTGt z8cuHGHIX!enxf%iWn^GzZeV6)Y-nt3ZfrdHGOwDNAy76*LEjnZw35vHJeS0hR0Ttj z7NDSSehQR7S)Nba!jGWgYxrB6bua}=kQC!n;0h>CM6mqrly)38KoL08YZS1 w8Cn=5T9}!cCK_8L+i}?tRH6{80F0;NlEk8tilWpsE@M*z3ocbvSARDy0DF Date: Mon, 26 Jun 2017 15:06:30 +0100 Subject: [PATCH 4/4] Update code to use local assets. --- Aztec.xcodeproj/project.pbxproj | 4 ++++ .../Contents.json | 0 .../gridicons-image.pdf | Bin Aztec/Classes/GUI/Assets.swift | 17 +++++++++++++++++ Aztec/Classes/TextKit/TextView.swift | 2 +- Aztec/Classes/TextKit/VideoAttachment.swift | 4 +--- Example/Example/EditorDemoController.swift | 3 ++- 7 files changed, 25 insertions(+), 5 deletions(-) rename Aztec/Assets/Media.xcassets/{Image.imageset => image.imageset}/Contents.json (100%) rename Aztec/Assets/Media.xcassets/{Image.imageset => image.imageset}/gridicons-image.pdf (100%) create mode 100644 Aztec/Classes/GUI/Assets.swift diff --git a/Aztec.xcodeproj/project.pbxproj b/Aztec.xcodeproj/project.pbxproj index 3b4ae05a1..b9555c2eb 100644 --- a/Aztec.xcodeproj/project.pbxproj +++ b/Aztec.xcodeproj/project.pbxproj @@ -131,6 +131,7 @@ FF20D6421EDC389A00294B78 /* Processor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF20D63F1EDC389A00294B78 /* Processor.swift */; }; FF20D6441EDC395E00294B78 /* NSTextingResult+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF20D6431EDC395E00294B78 /* NSTextingResult+Helpers.swift */; }; FF20D6471EDC3B3900294B78 /* HTMLProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF20D6461EDC3B3900294B78 /* HTMLProcessorTests.swift */; }; + FF24AC991F0146AF003CA91D /* Assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF24AC981F0146AF003CA91D /* Assets.swift */; }; FF4E26601EA8DF1E005E8E42 /* ImageAttachment.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF4E265F1EA8DF1E005E8E42 /* ImageAttachment.swift */; }; FF7A1C511E5651EA00C4C7C8 /* LineAttachment.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF7A1C501E5651EA00C4C7C8 /* LineAttachment.swift */; }; FF7C89B01E3BC52F000472A8 /* NSAttributedString+FontTraits.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF7C89AF1E3BC52F000472A8 /* NSAttributedString+FontTraits.swift */; }; @@ -296,6 +297,7 @@ FF20D63F1EDC389A00294B78 /* Processor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Processor.swift; sourceTree = ""; }; FF20D6431EDC395E00294B78 /* NSTextingResult+Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSTextingResult+Helpers.swift"; sourceTree = ""; }; FF20D6461EDC3B3900294B78 /* HTMLProcessorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTMLProcessorTests.swift; sourceTree = ""; }; + FF24AC981F0146AF003CA91D /* Assets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Assets.swift; sourceTree = ""; }; FF4E265F1EA8DF1E005E8E42 /* ImageAttachment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageAttachment.swift; sourceTree = ""; }; FF5B98E21DC29D0C00571CA4 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; }; FF5B98E41DC355B400571CA4 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; }; @@ -507,6 +509,7 @@ isa = PBXGroup; children = ( 599F25291D8BC9A1002871D6 /* FormatBar */, + FF24AC981F0146AF003CA91D /* Assets.swift */, ); path = GUI; sourceTree = ""; @@ -1014,6 +1017,7 @@ B551A4A01E770B3800EE3A7F /* UIFont+Emoji.swift in Sources */, F12F586E1EF20394008AE298 /* LinkFormatter.swift in Sources */, F12F586A1EF20394008AE298 /* HeaderFormatter.swift in Sources */, + FF24AC991F0146AF003CA91D /* Assets.swift in Sources */, 599F254D1D8BC9A1002871D6 /* FormatBar.swift in Sources */, F1FA0E881E6EF514009D98EE /* TextNode.swift in Sources */, 599F253A1D8BC9A1002871D6 /* InNodeConverter.swift in Sources */, diff --git a/Aztec/Assets/Media.xcassets/Image.imageset/Contents.json b/Aztec/Assets/Media.xcassets/image.imageset/Contents.json similarity index 100% rename from Aztec/Assets/Media.xcassets/Image.imageset/Contents.json rename to Aztec/Assets/Media.xcassets/image.imageset/Contents.json diff --git a/Aztec/Assets/Media.xcassets/Image.imageset/gridicons-image.pdf b/Aztec/Assets/Media.xcassets/image.imageset/gridicons-image.pdf similarity index 100% rename from Aztec/Assets/Media.xcassets/Image.imageset/gridicons-image.pdf rename to Aztec/Assets/Media.xcassets/image.imageset/gridicons-image.pdf diff --git a/Aztec/Classes/GUI/Assets.swift b/Aztec/Classes/GUI/Assets.swift new file mode 100644 index 000000000..59861699f --- /dev/null +++ b/Aztec/Classes/GUI/Assets.swift @@ -0,0 +1,17 @@ +import Foundation +import UIKit + +class Assets { + + public static var playIcon: UIImage { + let bundle = Bundle(for: self) + let playImage = UIImage(named: "play", in: bundle, compatibleWith: nil)! + return playImage + } + + public static var imageIcon: UIImage { + let bundle = Bundle(for: self) + let playImage = UIImage(named: "image", in: bundle, compatibleWith: nil)! + return playImage + } +} diff --git a/Aztec/Classes/TextKit/TextView.swift b/Aztec/Classes/TextKit/TextView.swift index b3bc3ae91..48903fe03 100644 --- a/Aztec/Classes/TextKit/TextView.swift +++ b/Aztec/Classes/TextKit/TextView.swift @@ -195,7 +195,7 @@ open class TextView: UITextView { required public init?(coder aDecoder: NSCoder) { defaultFont = UIFont.systemFont(ofSize: 14) - defaultMissingImage = UIImage() + defaultMissingImage = Assets.imageIcon super.init(coder: aDecoder) commonInit() } diff --git a/Aztec/Classes/TextKit/VideoAttachment.swift b/Aztec/Classes/TextKit/VideoAttachment.swift index 147f61d09..a505e20b1 100644 --- a/Aztec/Classes/TextKit/VideoAttachment.swift +++ b/Aztec/Classes/TextKit/VideoAttachment.swift @@ -42,9 +42,7 @@ open class VideoAttachment: MediaAttachment { super.init(identifier: identifier, url: posterURL) - let bundle = Bundle(for: VideoAttachment.self) - let playImage = UIImage(named: "play", in: bundle, compatibleWith: nil) - self.overlayImage = playImage + self.overlayImage = Assets.playIcon } /// Required Initializer diff --git a/Example/Example/EditorDemoController.swift b/Example/Example/EditorDemoController.swift index 0b10f6bb5..a7dd1529a 100644 --- a/Example/Example/EditorDemoController.swift +++ b/Example/Example/EditorDemoController.swift @@ -1243,8 +1243,9 @@ private extension EditorDemoController if progress.fractionCompleted >= 1 { timer.invalidate() attachment.progress = nil - if let videoAttachment = attachment as? VideoAttachment, let videoURL = progress.userInfo[MediaProgressKey.mediaID] as? URL { + if let videoAttachment = attachment as? VideoAttachment, let videoURL = progress.userInfo[MediaProgressKey.videoURL] as? URL { videoAttachment.srcURL = videoURL + videoAttachment.overlayColor = UIColor.clear richTextView.update(attachment: videoAttachment) } }