From d83e5cc43ed60780cf6de432e47daa4717f278a2 Mon Sep 17 00:00:00 2001 From: Georg Date: Sat, 27 Oct 2018 18:15:37 +0100 Subject: [PATCH 01/10] Simplify enums using .allCases from Swift 4.2 Simplified enums by removing as many stored properties as possible and replacing them with computed ones; some renaming to be more Swift like; update to FontAwesome 5.4.2 --- Assets/fa-brands-400.ttf | Bin 123304 -> 124668 bytes Assets/fa-regular-400.ttf | Bin 40348 -> 40348 bytes Assets/fa-solid-900.ttf | Bin 191112 -> 191292 bytes Classes/Enums/Awesome.swift | 379 +-- Classes/Enums/AwesomePro.swift | 2743 ++++++++--------- Classes/Extensions/Amazing+Tools.swift | 391 ++- .../NSAttributedString+Awesome.swift | 2 +- Classes/Extensions/StringProtocol.swift | 20 + Classes/Protocols/Amazing.swift | 23 +- Generator/Sources/Generator/EnumBuilder.swift | 10 +- 10 files changed, 1819 insertions(+), 1749 deletions(-) create mode 100644 Classes/Extensions/StringProtocol.swift diff --git a/Assets/fa-brands-400.ttf b/Assets/fa-brands-400.ttf index 867f408c5afcfc97d0ed1c77450ee97f2d727e7e..218ff47f8268577baa46a72170751838db84de4e 100644 GIT binary patch delta 6772 zcmX|`31C#^wa5SG-kE!6k}z4A$pi=?W?%**5VFl6OVAKd77>F`K(?^U5)dhiAcKMd z5h*f&8&Y-=6}3v*s=Q+w$v$?C(p!%9%NPV$FArb!UNsL4fI-RkLu8ame6U zlEeD>wKcOQk4tHNI0^aS7FH;nGyDE|e{TIwIi!9jkoEWzM?<~qAgoKi-Z=lnxb&XQ zNHzEX`1t!PxBb7o-gNzl@rYbz*#rIh=QdK8$dmiz?}>HNTZ;FemoXyC_7|F2X5tph z?=t#bzn&Oj9d{X-KqAL}$&iM`3A=Aw*Uy8(x(4&-yH1oT?AryGbs^E-^H1-Yt7orX z`rh?@@&4A{Q${?+{P~xI-i>)UhxIZHzeYkVapSkxfBvsg}DCkU409^Ozu=P$zd{hfI;_62w)B$pq;lzeb}h#dgV-fK*B!48tffxGj@# z40&<1m7daF$}v((Wioo;xMX1_euH&*LHbLo%#b1(Di7g*u?^)YL05D}Da!CJPU9ea zxCy;*Hy*(mX)j^vC^v~qX31E5CJ(|v1MWjHif{+k;&B;*@9~tf?CYQ{dfQm zVL4V|1D?jScm|vC9Cl$hp2r@%gjeu89L6F1f!6v*yn(lH3McUn&f)`Hz$f?=|AoKc zulO8)!%Z}8vv7R~q`Kj2^Z3I7(`BVI|7ma=HQ?}qrVWQ2^AQ8JoVRU?yRs?3yH znI{j(GKs^FE_e|Cz}IM!4CLTFX(!W=f!3ITI5y#BsgPS}mBVRRoiH13<6c>gC3q3n zB~3DML4{k*zs?ZO8aT{*O0QAQ|48l~LsK!U)lUC9X3-Ksc<1xIBdi)QrNudmu z`>_uf@n?J`Z6qR587TM4eVC5DcoQGu@A3$|G5{_NMm0uYK7N$Ba>xGfd@Ur-v#Ner z1q}~rXw_(VSVQ|p1JAI6mX3z?8Yua+hSraUXEZzqXn0nG1my*dSd*YFUbv89H`35`(=4;C8fv=n$PaX2H?VFgRmG_r*9UJZ{O8fR!QaeZd6 z#Q_#-HCUWzpBd_3%@S9r;HgC8A`JqR4`_H&(Wts2JhNz2LlB-`G(M=ogv7ecVE;On zxQ7a!X*8;d5$vFRR3lR;S8HTCNDEQWk)g3( zgBKEWS_b>4vZPc`L@D(j8Y!Z@qLHDLUu)?6(D+Xc-5?sj(_mZTe9NJ&-UX7ThAt6F zj|K-5J^e+k?q(@dLnnzOXRN@P#0r0pVJ?pvbzSKQF8qXx>O{4YUo^% z?4_ZbMY2MJ`x5>@QUA3p)oAcIq|qxFJdmV|Q80`k zxl6-k+@?$=-|Ml2*xX|OV}E*R>tlckR}jABTBqJir5Q;no2J_%}#T;>zP7zbyx221z*bM6s_ zJ2*4}1p^-(9tZ_PAe<*O42E#lYZw;cBs2_=a5iWdD&cTX6%3kiHfb=PlKZ7#Acezy zRWPK&p<{`w3!^KX=QND7aJFa|apBNaD;Rs>Y|}6b!`ZH3JchGF!^jMWJELHXhC_uZ z7_H&Z-zXTj;q1{cg2&-dlL`iNIMkwoVI9tk8U}bcFKHO+;k>M2(1){6!|)I16%7*s zI8?rZDFGZBfP%>Z92$UvX#yN7-8m3vff{#yuVL;0=b(mJ1RPZ+D*JU*J;KZa&JhiB z3^=cAm~FsOZ3y!YII0a{1_I}phPeow;~HiqaN?>FVS)ljRU}MR;JmG2(gH^{B1~W4 zoYpXrfpbQ~lm^aw8YVYzRL6vA4xIBECOmLdzl5m|oQs+`vmiM28soqt2s0=+pJ|v&!BG<=%&OpA(%|2eYJx;;%FmgU@&fU)Ku4mG z6iPK)A}uM^Y>6yNY{-2t{wtu#)W`@*mqtcXx-~M2lHDt0G^Ix)V<1SHp}FO>H%xdYkez(vI>MWLjcPUZ}$iKIx$0i9%CY!yFV%5e;5W z)aMn+@Pw;fC_bCdiZskh(bQFgdnt=G%v8~IhlV*TnyNL-UeTnKKyaN>Z9EaRX|x>$ zb6Ye~WeOaj{JVzvE}FOtiQVnCbx<2kTTh4>OP^F#54Kr_{&U>b~O zj-+5hjAp7v!PFSdJ`Iy(G^cBrE~A-ys$k-bX3k83Yn0TWLJBFVJ%tRWqy`mCu+hAp zDpwcg+GyUQVb+c29UA7}Xr{+e;HyNp8+r`mCN{sXVLp!LMh!D_G;>i3=IChtQNwH< zS2c_aQy4o>zKR_FC3!Q?F|kTPohD__lXJ?-9Mv-0HgZXyxe2wUs9;FZCJH z=R{RjRc+NLef#xm-EVKdK|>ao>(tDA=Q8@hDp(Yx!14Ia^Pj3da%|PuGvlU@yEMLP{N9>w6NXRBpW>RbVQP5l+Nobn+d1w0z28jV zIsMX%f*E(uxHNO@%=5EKY71&#uT9Rboc+^%*Wz<)=RWo8tOcDGOjz*M!nB2F7P%Hx zF1oPTzj)N*`HOciX}@I3l2uC%J~;NloezGubalLJ*~w);KD6TD-OF>9FR2?)x4rJd z%G^g!udZHw=CSHESd+hI$>Uj%FInsR&E|EL>%Lgudi~n<-zB1nJsWa1EZcBtqi^Hb zjTbg`+%#>|$tSx!<#{^Z{ppj>jDBYOv$@ai-CVZ0cJr0zraX7}xvN{&Zh8B+3%42D z9@zHP_EFpGcU13Kwe#q%j9t~cR_waGd&=%B&yRloi#^j{aJ{g1@8B1Qzxc*W(U%Us zbmisTmpAXT_D$J$?v*cI`RUb)SHF3!=WFX-^U9-+a*XgUuI=3!5)o zxtM?PmW$IbF1@(BK3c!3{_=<650f-T8szmiWt$x0=Y<-6PT1eKL+;3UfNx+dlL$KS zFX=L-Fmw3#z#jZdz)u;~{F{4{ES8n>m^>xV%bW5i`IO(O%3`6g9qlb$j3TpZX{aC^ zDb5aNw-tZ7l$ON8v99S-UK$PfZ7ULt@|{0e994D7%OYVr6kyv}*y5!)ZrSQtq&QD{ z2)j@%3hd%=B-@IV$D$?eBo+uq3M{)qVzyNhiq?FqeEG~}~*uj9U+LVRu@~GdfU)sS~q%_?q{<&r_6e#63N22A$ z+}xWa7znWqH4}|Rdr6dimXww#b=h$%6bW+EZ=$|Rg4qGdOA(h#TyAk&re#@T`MqxO z8ips7p2`nl`9{Fw_DnSlx7QR`OOMNIxDCVQ_84OF$1CoXfQwZu?+u1&@*lAcahaAo z)g_iG!ltHSh}-nIO|KC*T^?IZBeleIr+K_?)5U%~E)loEmWIc$d21OQ-*mg&ZZR!Z zW)-)vC)F8;@QD1}Oicc!vtWr>e8^90{KO;d!fb7_c6&9|G_Hm3O%I>A42i3rI8X{# z%;p?{Yw@)8X1Hy>l@vFJ5Y?B5t8{r?9+$_+X_F_uj97ZQO{=`NHxzccw$m=OJ9V}KeygxkZ{J=RGtX6Fq7F8wb9=|u;&o#O%Bg0gB$dYWgD{gXOTpBAH77@wdFzGGb zZm)RLEpCx3#WJZeOPK_1gPYG^wP|VywTC9#DUGtKnxN{53KGj@8t!zOl0nU>>5FX| zv;&j%s9@tJR(2V2i_1|aL2Kh1Wi#x83-Fk1PpfiMS$2xmBFp9CJ8y=XA}x}WrNUfp z!<%KhZp`cGOP35^$GpM0{2AySX6N|bT|M4GURP$er!dv<4E7jpI<*-Tb>HgtdRtc7 z;jmq4Wqa?q(Gy4yWaPRse3skWHa*|V!L2l*n)6MITP4z#<{RXA`^PVB``Mu*Bjph@ ze*OCOKN!_=3WfY`IEa5HPGErNQMDD8&2!3M-dMlL0E;|(3ObmuSrAb#?N~I@ManCT zl03sFk%Dj;y$}zj75n9eE+$CF@yk>Bw%fp}s!rt{3*)(2slJqSYWzlzo#AV37i4B- zwk_;f-l?i;V7DHHfxy4Jbn<5ea&pZ)U#ncHm>!>AA-$)+;tTk51O8s>k{ft}<`CeW z4DXPZnpT+V^;jvXKA%4;yJcbVjfJ5$1)YQGl45y0X@#uNp~HQ#o3H(t=FdniYGJs$ zb@F#@b7S9*9s5@I?Ks!pE=#g9#24U9)J+DjS^s%>=+3cH8SQN_03D~<9fz$x=d}@f zxKxR_Q>8T4^4oLW@<*IIn=hY!yD5MEdvg5RmT{Y;=Gs<%P~CX#+L>!R4z1fD&lSa0 zFYic$96=gC*P6{L&0(j)hlXb&mLW;r`n+%@)}0wb5YkA_)I z-~P~NZl6AL>(pghZl=rI*JHLbtVi8ufoa@oSU0&{Mt3vS%rgeLJG)G2MH`lU({rcA zlc=oBw3d72@Gm{Eo8R6V_Sm<%T^(HRgk`&y+b(yN%kApM`euLIw!9IGaraQClhQd= z>JE*1Um3hnXRJIl;evc*ru!y!uBn~Wc~a*IlNZgdoph+%M{=8eXyu$4nesn delta 5320 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 delta 49 xcmbQUn`zE&rU`+}iJxsIhD?!}FL8WDJipCX25u$>5V-y{G9E^6W?`H$2LQ@t5n=!U diff --git a/Assets/fa-solid-900.ttf b/Assets/fa-solid-900.ttf index 4c04632bac7652766144fedc875c38416eee6c9d..c6818494584137a0616a98e084e48a29e4ac219d 100644 GIT binary patch delta 878 zcmXw%TS$~a6vxk*+5NEeb6wZly1A~GO)O1O6h&R{cg@RgRAA}4u5RKD6S0R#>A{ku zl@IhGAqlgWh~O&>5laY)D5;<%>LIAWpobJqFx~B}Uk>w||C}>tX3j9@+6Vu|kN)n| zD|6#<&jB>409o-JU63;oS9gR%eMkjEHU2+Z<;l^Ti{OzP+Q$zt2$8crgwpj;cK$}fbH+t-@~o4 z5tl?28}@poFM*DzRAo(b4EX*miS#f)P%5YbJ#v#KoMECopv@L=PJR&Xk60%yMEp=U zFeg7L&FalqBE8aEu~affepXlTN?s*-A{|&RwHi9qg}j*8ODl#Htd%^5TRfi^NYh6? z@giO$4MmM(qa+xs4_SB_ucqt-c|ylg6X1J8!lrKopnN-{a|EoD=gbbZz5!tUi~@6# zo>ib!Vvm2r5?M&vMl6**$q8zG1;EBT1zt(|UV&H1mh{sM%jL<8UZyVu*ql`0#iUaT zyk0hDMI+YAmh5|6%m>&yrN9g1ja-9TEFyD7f!D~9MOKcDa!=_~j7bF8Cb)(4gaR)k zO;O<0a!I*2pn)proEzAA74ZvLa}%%@`t+7XVDXi6CG5 zOJE%pz+CsK5?#J(yy~`%x@|b`wz1%*Bri2Kf+G+GM}e-!m{=iH8xod-X_@(G!L+bw zG@{SS&`$N4SV#kF*?T7HbmEN8F6_Y|b>B(fnVBb)tu2L$!H< z8ckrHHdH5KfvEfK3p(gjptm2g!63BGhb^;NfvIfs3oqE;7%^b5KiOgLZ)@$PVe0Wu G_VypLZRU0W delta 694 zcmXxiZAep57zgm@dCu+(=iDr4uK89fE|eL)p=7>J=lkoTf=btXS+M0mKNtuF1xXY+ z4rEXtA_n@wFLi=}sMR+=gp_43^hGEkA_z)xq+!pzbm4dZ=XuUOmvawy_PuFr*))FW z>Rb2bB!Hy|pk(hr@Jj#kwa^rRcO2+aAkgRQO&j>#2mmYWc%osb(#Ci^%kl!D;gK7W zzaIhcD}cE^IOz9@_{nqtkDKe}kZ&Yx7)9cF?m^CFU#M^E?&C$Exi|p*2@ejLheLBe z$ADg}0UV4(W^*e#0r^>WI5%mg+fud;CVl~5A6C!$|L6AF_6*&^S6uG`+F7x)Ms%ty zoHxsrRDY&RZ(E!oc1A^<$pBUt7*e-XkHtplR3mAnMvSVbHWOm2oKIiX+Nn>p$SHe1 z*2qPB7rNzveV;Xts22^A9Db~m{f+^xQdEmJx#TFuW=R~Bzq;m+C819=A6)pHkDVBjo7T*rIW&34zPYo zCn{9D%%Pd9xLnkUCY4j&C9p#c*FHy^3t)qZTFzo!;%k)Gvz^ki1#~_Pbm0tJ0O}3` z^*GrIkS`8&@jm+jDJNN4X7zuEPu_h!_Kv8b1JpNlm Image { @@ -26,181 +25,317 @@ public extension Amazing { } - -extension Awesome.brand { - - public typealias AwesomeType = Awesome.brand - - public static func fromType(_ code: String) -> AwesomeType? { - guard let icon = AwesomeType(rawValue: code) else { - return nil - } - return icon +extension Awesome.Brand { + + public var code: String { + return self.rawValue } - + + public var key: String { + return String(describing: self) + } + + public var description: String { + return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") + } + public var name: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.keys[index] - return name + return self.key } - + public var label: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.labels[index] - return name + return self.description } - + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") + public static var all: [Awesome.brand] { + return allCases + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + public static var keys: [String] { + return allKeys + } + + public static var labels: [String] { + return allDescriptions + } + } -extension Awesome.regular { - - public typealias AwesomeType = Awesome.regular - - public static func fromType(_ code: String) -> AwesomeType? { - guard let icon = AwesomeType(rawValue: code) else { - return nil - } - return icon +extension Awesome.Regular { + + public var code: String { + return self.rawValue } - + + public var key: String { + return String(describing: self) + } + + public var description: String { + return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") + } + public var name: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.keys[index] - return name + return self.key } - + public var label: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.labels[index] - return name + return self.description } - + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") + public static var all: [Awesome.regular] { + return allCases + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + public static var keys: [String] { + return allKeys + } + + public static var labels: [String] { + return allDescriptions + } + } -extension Awesome.solid { - - public typealias AwesomeType = Awesome.solid - - public static func fromType(_ code: String) -> AwesomeType? { - guard let icon = AwesomeType(rawValue: code) else { - return nil - } - return icon +extension Awesome.Solid { + + public var code: String { + return self.rawValue } - + + public var key: String { + return String(describing: self) + } + + public var description: String { + return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") + } + public var name: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.keys[index] - return name + return self.key } - + public var label: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.labels[index] - return name + return self.description } - + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") + public static var all: [Awesome.solid] { + return allCases + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + public static var keys: [String] { + return allKeys + } + + public static var labels: [String] { + return allDescriptions + } + } - -extension AwesomePro.brand { - - public typealias AwesomeType = AwesomePro.brand - - public static func fromType(_ code: String) -> AwesomeType? { - guard let icon = AwesomeType(rawValue: code) else { - return nil - } - return icon +extension AwesomePro.Brand { + + public var code: String { + return self.rawValue } - + + public var key: String { + return String(describing: self) + } + + public var description: String { + return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") + } + public var name: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.keys[index] - return name + return self.key } - + public var label: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.labels[index] - return name + return self.description } - + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") + public static var all: [AwesomePro.brand] { + return allCases + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + public static var keys: [String] { + return allKeys + } + + public static var labels: [String] { + return allDescriptions + } + } -extension AwesomePro.regular { - - public typealias AwesomeType = AwesomePro.regular - - public static func fromType(_ code: String) -> AwesomeType? { - guard let icon = AwesomeType(rawValue: code) else { - return nil - } - return icon +extension AwesomePro.Regular { + + public var code: String { + return self.rawValue } - + + public var key: String { + return String(describing: self) + } + + public var description: String { + return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") + } + public var name: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.keys[index] - return name + return self.key } - + public var label: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.labels[index] - return name + return self.description } - + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") + public static var all: [AwesomePro.regular] { + return allCases + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + public static var keys: [String] { + return allKeys + } + + public static var labels: [String] { + return allDescriptions + } + } -extension AwesomePro.solid { - - public typealias AwesomeType = AwesomePro.solid - - public static func fromType(_ code: String) -> AwesomeType? { - guard let icon = AwesomeType(rawValue: code) else { - return nil - } - return icon +extension AwesomePro.Solid { + + public var code: String { + return self.rawValue } - + + public var key: String { + return String(describing: self) + } + + public var description: String { + return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") + } + public var name: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.keys[index] - return name + return self.key } - + public var label: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.labels[index] - return name + return self.description } - + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") + public static var all: [AwesomePro.solid] { + return allCases + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + public static var keys: [String] { + return allKeys + } + + public static var labels: [String] { + return allDescriptions + } + } -extension AwesomePro.light { - - public typealias AwesomeType = AwesomePro.light - - public static func fromType(_ code: String) -> AwesomeType? { - guard let icon = AwesomeType(rawValue: code) else { - return nil - } - return icon +extension AwesomePro.Light { + + public var code: String { + return self.rawValue + } + + public var key: String { + return String(describing: self) + } + + public var description: String { + return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") } public var name: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.keys[index] - return name + return self.key } - + public var label: String { - let index = AwesomeType.all.index(of: self)! - let name = AwesomeType.labels[index] - return name + return self.description } -} + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") + public static var all: [AwesomePro.light] { + return allCases + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + public static var keys: [String] { + return allKeys + } + public static var labels: [String] { + return allDescriptions + } + +} diff --git a/Classes/Extensions/NSAttributedString+Awesome.swift b/Classes/Extensions/NSAttributedString+Awesome.swift index 104be74..d2ddbf5 100644 --- a/Classes/Extensions/NSAttributedString+Awesome.swift +++ b/Classes/Extensions/NSAttributedString+Awesome.swift @@ -26,7 +26,7 @@ public extension NSAttributedString { paragraph.alignment = .center let attributes = [NSAttributedString.Key.font: font, .foregroundColor: color, .backgroundColor: backgroundColor, .paragraphStyle: paragraph] - let attributedString = NSAttributedString(string: icon.code, attributes: attributes) + let attributedString = NSAttributedString(string: icon.rawValue, attributes: attributes) return attributedString } diff --git a/Classes/Extensions/StringProtocol.swift b/Classes/Extensions/StringProtocol.swift new file mode 100644 index 0000000..a126c3c --- /dev/null +++ b/Classes/Extensions/StringProtocol.swift @@ -0,0 +1,20 @@ +// +// StringProtocol.swift +// AwesomeEnum-iOS +// +// Created by Georg on 27.10.18. +// Copyright © 2018 LiveUI. All rights reserved. +// + +import Foundation + +extension StringProtocol { + var firstUppercased: String { + guard let first = first else { return "" } + return String(first).uppercased() + dropFirst() + } + var firstCapitalized: String { + guard let first = first else { return "" } + return String(first).capitalized + dropFirst() + } +} diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index 47921b8..be5d0a6 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -10,15 +10,28 @@ import Foundation public protocol Amazing { init?(rawValue: String) + + var key: String { get } + var description: String { get } + var rawValue: String { get } + var fontType: AwesomeFont { get } + + static var allKeys: [String] { get } + static var allDescriptions: [String] { get } - var code: String { get } - + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allKeys instead") static var keys: [String] { get } - static var labels: [String] { get } - var fontType: AwesomeFont { get } + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allDescriptions instead") + static var labels: [String] { get } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .rawValue instead.") + var code: String { get } + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key instead.") var name: String { get } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") var label: String { get } - + } diff --git a/Generator/Sources/Generator/EnumBuilder.swift b/Generator/Sources/Generator/EnumBuilder.swift index 8c635e0..763acd5 100644 --- a/Generator/Sources/Generator/EnumBuilder.swift +++ b/Generator/Sources/Generator/EnumBuilder.swift @@ -12,7 +12,9 @@ func buildEnum (_ name: String, from styles: [String: [Icon]]) -> String { for (var style, list) in styles { if style == "brands" { style = "brand" } - content += "\n public enum \(style): String, Amazing {\n" + content += "\n @available(*, deprecated, renamed: \"\(style.firstUppercased())\")" + content += "\n public typealias \(style) = \(style.firstUppercased())" + content += "\n public enum \(style.firstUppercased()): String, CaseIterable, Amazing {\n" var names = [String]() for icon in list { var name = icon.name.split(separator: "-").map { $0.firstUppercased() }.joined(separator: "") @@ -22,13 +24,7 @@ func buildEnum (_ name: String, from styles: [String: [Icon]]) -> String { content += " case \(name.isKeyword ? "`\(name)`" : name) = \"\\u{\(icon.unicode)}\"\n" } - - content += "\n public static var all: [\(style)] {\n return [ \(names.map {"\(style).\($0)"}.joined(separator: ", ")) ]\n }\n" - content += "\n public static var keys: [String] {\n return [ \(list.map {"\"\($0.name)\""}.joined(separator: ", ")) ]\n }\n" - content += "\n public static var labels: [String] {\n return [ \(list.map {"\"\($0.name.split(separator: "-").map { $0.firstUppercased() }.joined(separator: " "))\""}.joined(separator: ", ")) ]\n }\n" - content += "\n public var code: String {\n return rawValue\n }\n" content += "\n public var fontType: AwesomeFont {\n return \(name).Font.\(style)\n }\n" - content += " }\n" print(" Style \"\(style)\" has \(list.count) icons.") From 26818df9ebb151d0302baeb4f29f7ac70dacc654 Mon Sep 17 00:00:00 2001 From: Georg Date: Sun, 28 Oct 2018 11:53:30 +0000 Subject: [PATCH 02/10] Implemented changes suggested by @divadretlaw - Moved most computed properties into Amazing - Updated generator and regenerated enums - Fixed a bug where key and description were not return what was expected - Amazing.name now returns the old key (deprecated), Amazing.key returns the old key prepended by the font name and face --- Classes/Enums/Awesome.swift | 1732 ++++++++--------- Classes/Enums/AwesomePro.swift | 10 +- Classes/Extensions/Amazing+Tools.swift | 271 +-- Classes/Extensions/Image+Awesome.swift | 8 +- .../NSAttributedString+Awesome.swift | 2 +- Classes/Protocols/Amazing.swift | 66 +- Generator/Sources/Generator/EnumBuilder.swift | 4 +- 7 files changed, 953 insertions(+), 1140 deletions(-) diff --git a/Classes/Enums/Awesome.swift b/Classes/Enums/Awesome.swift index d7a822f..04e5cb6 100644 --- a/Classes/Enums/Awesome.swift +++ b/Classes/Enums/Awesome.swift @@ -5,875 +5,12 @@ // Originally created by Ondrej Rafaj on 13/10/2017. // Copyright © 2017 manGoweb UK. All rights reserved. // -// This file has been auto-generated on 27/10/2018 18:12. +// This file has been auto-generated on 28/10/2018 08:25. import Foundation public struct Awesome { - @available(*, deprecated, renamed: "Solid") - public typealias solid = Solid - public enum Solid: String, CaseIterable, Amazing { - case ad = "\u{f641}" - case addressBook = "\u{f2b9}" - case addressCard = "\u{f2bb}" - case adjust = "\u{f042}" - case airFreshener = "\u{f5d0}" - case alignCenter = "\u{f037}" - case alignJustify = "\u{f039}" - case alignLeft = "\u{f036}" - case alignRight = "\u{f038}" - case allergies = "\u{f461}" - case ambulance = "\u{f0f9}" - case americanSignLanguageInterpreting = "\u{f2a3}" - case anchor = "\u{f13d}" - case angleDoubleDown = "\u{f103}" - case angleDoubleLeft = "\u{f100}" - case angleDoubleRight = "\u{f101}" - case angleDoubleUp = "\u{f102}" - case angleDown = "\u{f107}" - case angleLeft = "\u{f104}" - case angleRight = "\u{f105}" - case angleUp = "\u{f106}" - case angry = "\u{f556}" - case ankh = "\u{f644}" - case appleAlt = "\u{f5d1}" - case archive = "\u{f187}" - case archway = "\u{f557}" - case arrowAltCircleDown = "\u{f358}" - case arrowAltCircleLeft = "\u{f359}" - case arrowAltCircleRight = "\u{f35a}" - case arrowAltCircleUp = "\u{f35b}" - case arrowCircleDown = "\u{f0ab}" - case arrowCircleLeft = "\u{f0a8}" - case arrowCircleRight = "\u{f0a9}" - case arrowCircleUp = "\u{f0aa}" - case arrowDown = "\u{f063}" - case arrowLeft = "\u{f060}" - case arrowRight = "\u{f061}" - case arrowUp = "\u{f062}" - case arrowsAlt = "\u{f0b2}" - case arrowsAltH = "\u{f337}" - case arrowsAltV = "\u{f338}" - case assistiveListeningSystems = "\u{f2a2}" - case asterisk = "\u{f069}" - case at = "\u{f1fa}" - case atlas = "\u{f558}" - case atom = "\u{f5d2}" - case audioDescription = "\u{f29e}" - case award = "\u{f559}" - case backspace = "\u{f55a}" - case backward = "\u{f04a}" - case balanceScale = "\u{f24e}" - case ban = "\u{f05e}" - case bandAid = "\u{f462}" - case barcode = "\u{f02a}" - case bars = "\u{f0c9}" - case baseballBall = "\u{f433}" - case basketballBall = "\u{f434}" - case bath = "\u{f2cd}" - case batteryEmpty = "\u{f244}" - case batteryFull = "\u{f240}" - case batteryHalf = "\u{f242}" - case batteryQuarter = "\u{f243}" - case batteryThreeQuarters = "\u{f241}" - case bed = "\u{f236}" - case beer = "\u{f0fc}" - case bell = "\u{f0f3}" - case bellSlash = "\u{f1f6}" - case bezierCurve = "\u{f55b}" - case bible = "\u{f647}" - case bicycle = "\u{f206}" - case binoculars = "\u{f1e5}" - case birthdayCake = "\u{f1fd}" - case blender = "\u{f517}" - case blenderPhone = "\u{f6b6}" - case blind = "\u{f29d}" - case bold = "\u{f032}" - case bolt = "\u{f0e7}" - case bomb = "\u{f1e2}" - case bone = "\u{f5d7}" - case bong = "\u{f55c}" - case book = "\u{f02d}" - case bookDead = "\u{f6b7}" - case bookOpen = "\u{f518}" - case bookReader = "\u{f5da}" - case bookmark = "\u{f02e}" - case bowlingBall = "\u{f436}" - case box = "\u{f466}" - case boxOpen = "\u{f49e}" - case boxes = "\u{f468}" - case braille = "\u{f2a1}" - case brain = "\u{f5dc}" - case briefcase = "\u{f0b1}" - case briefcaseMedical = "\u{f469}" - case broadcastTower = "\u{f519}" - case broom = "\u{f51a}" - case brush = "\u{f55d}" - case bug = "\u{f188}" - case building = "\u{f1ad}" - case bullhorn = "\u{f0a1}" - case bullseye = "\u{f140}" - case burn = "\u{f46a}" - case bus = "\u{f207}" - case busAlt = "\u{f55e}" - case businessTime = "\u{f64a}" - case calculator = "\u{f1ec}" - case calendar = "\u{f133}" - case calendarAlt = "\u{f073}" - case calendarCheck = "\u{f274}" - case calendarMinus = "\u{f272}" - case calendarPlus = "\u{f271}" - case calendarTimes = "\u{f273}" - case camera = "\u{f030}" - case cameraRetro = "\u{f083}" - case campground = "\u{f6bb}" - case cannabis = "\u{f55f}" - case capsules = "\u{f46b}" - case car = "\u{f1b9}" - case carAlt = "\u{f5de}" - case carBattery = "\u{f5df}" - case carCrash = "\u{f5e1}" - case carSide = "\u{f5e4}" - case caretDown = "\u{f0d7}" - case caretLeft = "\u{f0d9}" - case caretRight = "\u{f0da}" - case caretSquareDown = "\u{f150}" - case caretSquareLeft = "\u{f191}" - case caretSquareRight = "\u{f152}" - case caretSquareUp = "\u{f151}" - case caretUp = "\u{f0d8}" - case cartArrowDown = "\u{f218}" - case cartPlus = "\u{f217}" - case cat = "\u{f6be}" - case certificate = "\u{f0a3}" - case chair = "\u{f6c0}" - case chalkboard = "\u{f51b}" - case chalkboardTeacher = "\u{f51c}" - case chargingStation = "\u{f5e7}" - case chartArea = "\u{f1fe}" - case chartBar = "\u{f080}" - case chartLine = "\u{f201}" - case chartPie = "\u{f200}" - case check = "\u{f00c}" - case checkCircle = "\u{f058}" - case checkDouble = "\u{f560}" - case checkSquare = "\u{f14a}" - case chess = "\u{f439}" - case chessBishop = "\u{f43a}" - case chessBoard = "\u{f43c}" - case chessKing = "\u{f43f}" - case chessKnight = "\u{f441}" - case chessPawn = "\u{f443}" - case chessQueen = "\u{f445}" - case chessRook = "\u{f447}" - case chevronCircleDown = "\u{f13a}" - case chevronCircleLeft = "\u{f137}" - case chevronCircleRight = "\u{f138}" - case chevronCircleUp = "\u{f139}" - case chevronDown = "\u{f078}" - case chevronLeft = "\u{f053}" - case chevronRight = "\u{f054}" - case chevronUp = "\u{f077}" - case child = "\u{f1ae}" - case church = "\u{f51d}" - case circle = "\u{f111}" - case circleNotch = "\u{f1ce}" - case city = "\u{f64f}" - case clipboard = "\u{f328}" - case clipboardCheck = "\u{f46c}" - case clipboardList = "\u{f46d}" - case clock = "\u{f017}" - case clone = "\u{f24d}" - case closedCaptioning = "\u{f20a}" - case cloud = "\u{f0c2}" - case cloudDownloadAlt = "\u{f381}" - case cloudMoon = "\u{f6c3}" - case cloudSun = "\u{f6c4}" - case cloudUploadAlt = "\u{f382}" - case cocktail = "\u{f561}" - case code = "\u{f121}" - case codeBranch = "\u{f126}" - case coffee = "\u{f0f4}" - case cog = "\u{f013}" - case cogs = "\u{f085}" - case coins = "\u{f51e}" - case columns = "\u{f0db}" - case comment = "\u{f075}" - case commentAlt = "\u{f27a}" - case commentDollar = "\u{f651}" - case commentDots = "\u{f4ad}" - case commentSlash = "\u{f4b3}" - case comments = "\u{f086}" - case commentsDollar = "\u{f653}" - case compactDisc = "\u{f51f}" - case compass = "\u{f14e}" - case compress = "\u{f066}" - case conciergeBell = "\u{f562}" - case cookie = "\u{f563}" - case cookieBite = "\u{f564}" - case copy = "\u{f0c5}" - case copyright = "\u{f1f9}" - case couch = "\u{f4b8}" - case creditCard = "\u{f09d}" - case crop = "\u{f125}" - case cropAlt = "\u{f565}" - case cross = "\u{f654}" - case crosshairs = "\u{f05b}" - case crow = "\u{f520}" - case crown = "\u{f521}" - case cube = "\u{f1b2}" - case cubes = "\u{f1b3}" - case cut = "\u{f0c4}" - case database = "\u{f1c0}" - case deaf = "\u{f2a4}" - case desktop = "\u{f108}" - case dharmachakra = "\u{f655}" - case diagnoses = "\u{f470}" - case dice = "\u{f522}" - case diceD20 = "\u{f6cf}" - case diceD6 = "\u{f6d1}" - case diceFive = "\u{f523}" - case diceFour = "\u{f524}" - case diceOne = "\u{f525}" - case diceSix = "\u{f526}" - case diceThree = "\u{f527}" - case diceTwo = "\u{f528}" - case digitalTachograph = "\u{f566}" - case directions = "\u{f5eb}" - case divide = "\u{f529}" - case dizzy = "\u{f567}" - case dna = "\u{f471}" - case dog = "\u{f6d3}" - case dollarSign = "\u{f155}" - case dolly = "\u{f472}" - case dollyFlatbed = "\u{f474}" - case donate = "\u{f4b9}" - case doorClosed = "\u{f52a}" - case doorOpen = "\u{f52b}" - case dotCircle = "\u{f192}" - case dove = "\u{f4ba}" - case download = "\u{f019}" - case draftingCompass = "\u{f568}" - case dragon = "\u{f6d5}" - case drawPolygon = "\u{f5ee}" - case drum = "\u{f569}" - case drumSteelpan = "\u{f56a}" - case drumstickBite = "\u{f6d7}" - case dumbbell = "\u{f44b}" - case dungeon = "\u{f6d9}" - case edit = "\u{f044}" - case eject = "\u{f052}" - case ellipsisH = "\u{f141}" - case ellipsisV = "\u{f142}" - case envelope = "\u{f0e0}" - case envelopeOpen = "\u{f2b6}" - case envelopeOpenText = "\u{f658}" - case envelopeSquare = "\u{f199}" - case equals = "\u{f52c}" - case eraser = "\u{f12d}" - case euroSign = "\u{f153}" - case exchangeAlt = "\u{f362}" - case exclamation = "\u{f12a}" - case exclamationCircle = "\u{f06a}" - case exclamationTriangle = "\u{f071}" - case expand = "\u{f065}" - case expandArrowsAlt = "\u{f31e}" - case externalLinkAlt = "\u{f35d}" - case externalLinkSquareAlt = "\u{f360}" - case eye = "\u{f06e}" - case eyeDropper = "\u{f1fb}" - case eyeSlash = "\u{f070}" - case fastBackward = "\u{f049}" - case fastForward = "\u{f050}" - case fax = "\u{f1ac}" - case feather = "\u{f52d}" - case featherAlt = "\u{f56b}" - case female = "\u{f182}" - case fighterJet = "\u{f0fb}" - case file = "\u{f15b}" - case fileAlt = "\u{f15c}" - case fileArchive = "\u{f1c6}" - case fileAudio = "\u{f1c7}" - case fileCode = "\u{f1c9}" - case fileContract = "\u{f56c}" - case fileCsv = "\u{f6dd}" - case fileDownload = "\u{f56d}" - case fileExcel = "\u{f1c3}" - case fileExport = "\u{f56e}" - case fileImage = "\u{f1c5}" - case fileImport = "\u{f56f}" - case fileInvoice = "\u{f570}" - case fileInvoiceDollar = "\u{f571}" - case fileMedical = "\u{f477}" - case fileMedicalAlt = "\u{f478}" - case filePdf = "\u{f1c1}" - case filePowerpoint = "\u{f1c4}" - case filePrescription = "\u{f572}" - case fileSignature = "\u{f573}" - case fileUpload = "\u{f574}" - case fileVideo = "\u{f1c8}" - case fileWord = "\u{f1c2}" - case fill = "\u{f575}" - case fillDrip = "\u{f576}" - case film = "\u{f008}" - case filter = "\u{f0b0}" - case fingerprint = "\u{f577}" - case fire = "\u{f06d}" - case fireExtinguisher = "\u{f134}" - case firstAid = "\u{f479}" - case fish = "\u{f578}" - case fistRaised = "\u{f6de}" - case flag = "\u{f024}" - case flagCheckered = "\u{f11e}" - case flask = "\u{f0c3}" - case flushed = "\u{f579}" - case folder = "\u{f07b}" - case folderMinus = "\u{f65d}" - case folderOpen = "\u{f07c}" - case folderPlus = "\u{f65e}" - case font = "\u{f031}" - case fontAwesomeLogoFull = "\u{f4e6}" - case footballBall = "\u{f44e}" - case forward = "\u{f04e}" - case frog = "\u{f52e}" - case frown = "\u{f119}" - case frownOpen = "\u{f57a}" - case funnelDollar = "\u{f662}" - case futbol = "\u{f1e3}" - case gamepad = "\u{f11b}" - case gasPump = "\u{f52f}" - case gavel = "\u{f0e3}" - case gem = "\u{f3a5}" - case genderless = "\u{f22d}" - case ghost = "\u{f6e2}" - case gift = "\u{f06b}" - case glassMartini = "\u{f000}" - case glassMartiniAlt = "\u{f57b}" - case glasses = "\u{f530}" - case globe = "\u{f0ac}" - case globeAfrica = "\u{f57c}" - case globeAmericas = "\u{f57d}" - case globeAsia = "\u{f57e}" - case golfBall = "\u{f450}" - case gopuram = "\u{f664}" - case graduationCap = "\u{f19d}" - case greaterThan = "\u{f531}" - case greaterThanEqual = "\u{f532}" - case grimace = "\u{f57f}" - case grin = "\u{f580}" - case grinAlt = "\u{f581}" - case grinBeam = "\u{f582}" - case grinBeamSweat = "\u{f583}" - case grinHearts = "\u{f584}" - case grinSquint = "\u{f585}" - case grinSquintTears = "\u{f586}" - case grinStars = "\u{f587}" - case grinTears = "\u{f588}" - case grinTongue = "\u{f589}" - case grinTongueSquint = "\u{f58a}" - case grinTongueWink = "\u{f58b}" - case grinWink = "\u{f58c}" - case gripHorizontal = "\u{f58d}" - case gripVertical = "\u{f58e}" - case hSquare = "\u{f0fd}" - case hammer = "\u{f6e3}" - case hamsa = "\u{f665}" - case handHolding = "\u{f4bd}" - case handHoldingHeart = "\u{f4be}" - case handHoldingUsd = "\u{f4c0}" - case handLizard = "\u{f258}" - case handPaper = "\u{f256}" - case handPeace = "\u{f25b}" - case handPointDown = "\u{f0a7}" - case handPointLeft = "\u{f0a5}" - case handPointRight = "\u{f0a4}" - case handPointUp = "\u{f0a6}" - case handPointer = "\u{f25a}" - case handRock = "\u{f255}" - case handScissors = "\u{f257}" - case handSpock = "\u{f259}" - case hands = "\u{f4c2}" - case handsHelping = "\u{f4c4}" - case handshake = "\u{f2b5}" - case hanukiah = "\u{f6e6}" - case hashtag = "\u{f292}" - case hatWizard = "\u{f6e8}" - case haykal = "\u{f666}" - case hdd = "\u{f0a0}" - case heading = "\u{f1dc}" - case headphones = "\u{f025}" - case headphonesAlt = "\u{f58f}" - case headset = "\u{f590}" - case heart = "\u{f004}" - case heartbeat = "\u{f21e}" - case helicopter = "\u{f533}" - case highlighter = "\u{f591}" - case hiking = "\u{f6ec}" - case hippo = "\u{f6ed}" - case history = "\u{f1da}" - case hockeyPuck = "\u{f453}" - case home = "\u{f015}" - case horse = "\u{f6f0}" - case hospital = "\u{f0f8}" - case hospitalAlt = "\u{f47d}" - case hospitalSymbol = "\u{f47e}" - case hotTub = "\u{f593}" - case hotel = "\u{f594}" - case hourglass = "\u{f254}" - case hourglassEnd = "\u{f253}" - case hourglassHalf = "\u{f252}" - case hourglassStart = "\u{f251}" - case houseDamage = "\u{f6f1}" - case hryvnia = "\u{f6f2}" - case iCursor = "\u{f246}" - case idBadge = "\u{f2c1}" - case idCard = "\u{f2c2}" - case idCardAlt = "\u{f47f}" - case image = "\u{f03e}" - case images = "\u{f302}" - case inbox = "\u{f01c}" - case indent = "\u{f03c}" - case industry = "\u{f275}" - case infinity = "\u{f534}" - case info = "\u{f129}" - case infoCircle = "\u{f05a}" - case italic = "\u{f033}" - case jedi = "\u{f669}" - case joint = "\u{f595}" - case journalWhills = "\u{f66a}" - case kaaba = "\u{f66b}" - case key = "\u{f084}" - case keyboard = "\u{f11c}" - case khanda = "\u{f66d}" - case kiss = "\u{f596}" - case kissBeam = "\u{f597}" - case kissWinkHeart = "\u{f598}" - case kiwiBird = "\u{f535}" - case landmark = "\u{f66f}" - case language = "\u{f1ab}" - case laptop = "\u{f109}" - case laptopCode = "\u{f5fc}" - case laugh = "\u{f599}" - case laughBeam = "\u{f59a}" - case laughSquint = "\u{f59b}" - case laughWink = "\u{f59c}" - case layerGroup = "\u{f5fd}" - case leaf = "\u{f06c}" - case lemon = "\u{f094}" - case lessThan = "\u{f536}" - case lessThanEqual = "\u{f537}" - case levelDownAlt = "\u{f3be}" - case levelUpAlt = "\u{f3bf}" - case lifeRing = "\u{f1cd}" - case lightbulb = "\u{f0eb}" - case link = "\u{f0c1}" - case liraSign = "\u{f195}" - case list = "\u{f03a}" - case listAlt = "\u{f022}" - case listOl = "\u{f0cb}" - case listUl = "\u{f0ca}" - case locationArrow = "\u{f124}" - case lock = "\u{f023}" - case lockOpen = "\u{f3c1}" - case longArrowAltDown = "\u{f309}" - case longArrowAltLeft = "\u{f30a}" - case longArrowAltRight = "\u{f30b}" - case longArrowAltUp = "\u{f30c}" - case lowVision = "\u{f2a8}" - case luggageCart = "\u{f59d}" - case magic = "\u{f0d0}" - case magnet = "\u{f076}" - case mailBulk = "\u{f674}" - case male = "\u{f183}" - case map = "\u{f279}" - case mapMarked = "\u{f59f}" - case mapMarkedAlt = "\u{f5a0}" - case mapMarker = "\u{f041}" - case mapMarkerAlt = "\u{f3c5}" - case mapPin = "\u{f276}" - case mapSigns = "\u{f277}" - case marker = "\u{f5a1}" - case mars = "\u{f222}" - case marsDouble = "\u{f227}" - case marsStroke = "\u{f229}" - case marsStrokeH = "\u{f22b}" - case marsStrokeV = "\u{f22a}" - case mask = "\u{f6fa}" - case medal = "\u{f5a2}" - case medkit = "\u{f0fa}" - case meh = "\u{f11a}" - case mehBlank = "\u{f5a4}" - case mehRollingEyes = "\u{f5a5}" - case memory = "\u{f538}" - case menorah = "\u{f676}" - case mercury = "\u{f223}" - case microchip = "\u{f2db}" - case microphone = "\u{f130}" - case microphoneAlt = "\u{f3c9}" - case microphoneAltSlash = "\u{f539}" - case microphoneSlash = "\u{f131}" - case microscope = "\u{f610}" - case minus = "\u{f068}" - case minusCircle = "\u{f056}" - case minusSquare = "\u{f146}" - case mobile = "\u{f10b}" - case mobileAlt = "\u{f3cd}" - case moneyBill = "\u{f0d6}" - case moneyBillAlt = "\u{f3d1}" - case moneyBillWave = "\u{f53a}" - case moneyBillWaveAlt = "\u{f53b}" - case moneyCheck = "\u{f53c}" - case moneyCheckAlt = "\u{f53d}" - case monument = "\u{f5a6}" - case moon = "\u{f186}" - case mortarPestle = "\u{f5a7}" - case mosque = "\u{f678}" - case motorcycle = "\u{f21c}" - case mountain = "\u{f6fc}" - case mousePointer = "\u{f245}" - case music = "\u{f001}" - case networkWired = "\u{f6ff}" - case neuter = "\u{f22c}" - case newspaper = "\u{f1ea}" - case notEqual = "\u{f53e}" - case notesMedical = "\u{f481}" - case objectGroup = "\u{f247}" - case objectUngroup = "\u{f248}" - case oilCan = "\u{f613}" - case om = "\u{f679}" - case otter = "\u{f700}" - case outdent = "\u{f03b}" - case paintBrush = "\u{f1fc}" - case paintRoller = "\u{f5aa}" - case palette = "\u{f53f}" - case pallet = "\u{f482}" - case paperPlane = "\u{f1d8}" - case paperclip = "\u{f0c6}" - case parachuteBox = "\u{f4cd}" - case paragraph = "\u{f1dd}" - case parking = "\u{f540}" - case passport = "\u{f5ab}" - case pastafarianism = "\u{f67b}" - case paste = "\u{f0ea}" - case pause = "\u{f04c}" - case pauseCircle = "\u{f28b}" - case paw = "\u{f1b0}" - case peace = "\u{f67c}" - case pen = "\u{f304}" - case penAlt = "\u{f305}" - case penFancy = "\u{f5ac}" - case penNib = "\u{f5ad}" - case penSquare = "\u{f14b}" - case pencilAlt = "\u{f303}" - case pencilRuler = "\u{f5ae}" - case peopleCarry = "\u{f4ce}" - case percent = "\u{f295}" - case percentage = "\u{f541}" - case phone = "\u{f095}" - case phoneSlash = "\u{f3dd}" - case phoneSquare = "\u{f098}" - case phoneVolume = "\u{f2a0}" - case piggyBank = "\u{f4d3}" - case pills = "\u{f484}" - case placeOfWorship = "\u{f67f}" - case plane = "\u{f072}" - case planeArrival = "\u{f5af}" - case planeDeparture = "\u{f5b0}" - case play = "\u{f04b}" - case playCircle = "\u{f144}" - case plug = "\u{f1e6}" - case plus = "\u{f067}" - case plusCircle = "\u{f055}" - case plusSquare = "\u{f0fe}" - case podcast = "\u{f2ce}" - case poll = "\u{f681}" - case pollH = "\u{f682}" - case poo = "\u{f2fe}" - case poop = "\u{f619}" - case portrait = "\u{f3e0}" - case poundSign = "\u{f154}" - case powerOff = "\u{f011}" - case pray = "\u{f683}" - case prayingHands = "\u{f684}" - case prescription = "\u{f5b1}" - case prescriptionBottle = "\u{f485}" - case prescriptionBottleAlt = "\u{f486}" - case print = "\u{f02f}" - case procedures = "\u{f487}" - case projectDiagram = "\u{f542}" - case puzzlePiece = "\u{f12e}" - case qrcode = "\u{f029}" - case question = "\u{f128}" - case questionCircle = "\u{f059}" - case quidditch = "\u{f458}" - case quoteLeft = "\u{f10d}" - case quoteRight = "\u{f10e}" - case quran = "\u{f687}" - case random = "\u{f074}" - case receipt = "\u{f543}" - case recycle = "\u{f1b8}" - case redo = "\u{f01e}" - case redoAlt = "\u{f2f9}" - case registered = "\u{f25d}" - case reply = "\u{f3e5}" - case replyAll = "\u{f122}" - case retweet = "\u{f079}" - case ribbon = "\u{f4d6}" - case ring = "\u{f70b}" - case road = "\u{f018}" - case robot = "\u{f544}" - case rocket = "\u{f135}" - case route = "\u{f4d7}" - case rss = "\u{f09e}" - case rssSquare = "\u{f143}" - case rubleSign = "\u{f158}" - case ruler = "\u{f545}" - case rulerCombined = "\u{f546}" - case rulerHorizontal = "\u{f547}" - case rulerVertical = "\u{f548}" - case running = "\u{f70c}" - case rupeeSign = "\u{f156}" - case sadCry = "\u{f5b3}" - case sadTear = "\u{f5b4}" - case save = "\u{f0c7}" - case school = "\u{f549}" - case screwdriver = "\u{f54a}" - case scroll = "\u{f70e}" - case search = "\u{f002}" - case searchDollar = "\u{f688}" - case searchLocation = "\u{f689}" - case searchMinus = "\u{f010}" - case searchPlus = "\u{f00e}" - case seedling = "\u{f4d8}" - case server = "\u{f233}" - case shapes = "\u{f61f}" - case share = "\u{f064}" - case shareAlt = "\u{f1e0}" - case shareAltSquare = "\u{f1e1}" - case shareSquare = "\u{f14d}" - case shekelSign = "\u{f20b}" - case shieldAlt = "\u{f3ed}" - case ship = "\u{f21a}" - case shippingFast = "\u{f48b}" - case shoePrints = "\u{f54b}" - case shoppingBag = "\u{f290}" - case shoppingBasket = "\u{f291}" - case shoppingCart = "\u{f07a}" - case shower = "\u{f2cc}" - case shuttleVan = "\u{f5b6}" - case sign = "\u{f4d9}" - case signInAlt = "\u{f2f6}" - case signLanguage = "\u{f2a7}" - case signOutAlt = "\u{f2f5}" - case signal = "\u{f012}" - case signature = "\u{f5b7}" - case sitemap = "\u{f0e8}" - case skull = "\u{f54c}" - case skullCrossbones = "\u{f714}" - case slash = "\u{f715}" - case slidersH = "\u{f1de}" - case smile = "\u{f118}" - case smileBeam = "\u{f5b8}" - case smileWink = "\u{f4da}" - case smoking = "\u{f48d}" - case smokingBan = "\u{f54d}" - case snowflake = "\u{f2dc}" - case socks = "\u{f696}" - case solarPanel = "\u{f5ba}" - case sort = "\u{f0dc}" - case sortAlphaDown = "\u{f15d}" - case sortAlphaUp = "\u{f15e}" - case sortAmountDown = "\u{f160}" - case sortAmountUp = "\u{f161}" - case sortDown = "\u{f0dd}" - case sortNumericDown = "\u{f162}" - case sortNumericUp = "\u{f163}" - case sortUp = "\u{f0de}" - case spa = "\u{f5bb}" - case spaceShuttle = "\u{f197}" - case spider = "\u{f717}" - case spinner = "\u{f110}" - case splotch = "\u{f5bc}" - case sprayCan = "\u{f5bd}" - case square = "\u{f0c8}" - case squareFull = "\u{f45c}" - case squareRootAlt = "\u{f698}" - case stamp = "\u{f5bf}" - case star = "\u{f005}" - case starAndCrescent = "\u{f699}" - case starHalf = "\u{f089}" - case starHalfAlt = "\u{f5c0}" - case starOfDavid = "\u{f69a}" - case starOfLife = "\u{f621}" - case stepBackward = "\u{f048}" - case stepForward = "\u{f051}" - case stethoscope = "\u{f0f1}" - case stickyNote = "\u{f249}" - case stop = "\u{f04d}" - case stopCircle = "\u{f28d}" - case stopwatch = "\u{f2f2}" - case store = "\u{f54e}" - case storeAlt = "\u{f54f}" - case stream = "\u{f550}" - case streetView = "\u{f21d}" - case strikethrough = "\u{f0cc}" - case stroopwafel = "\u{f551}" - case `subscript` = "\u{f12c}" - case subway = "\u{f239}" - case suitcase = "\u{f0f2}" - case suitcaseRolling = "\u{f5c1}" - case sun = "\u{f185}" - case superscript = "\u{f12b}" - case surprise = "\u{f5c2}" - case swatchbook = "\u{f5c3}" - case swimmer = "\u{f5c4}" - case swimmingPool = "\u{f5c5}" - case synagogue = "\u{f69b}" - case sync = "\u{f021}" - case syncAlt = "\u{f2f1}" - case syringe = "\u{f48e}" - case table = "\u{f0ce}" - case tableTennis = "\u{f45d}" - case tablet = "\u{f10a}" - case tabletAlt = "\u{f3fa}" - case tablets = "\u{f490}" - case tachometerAlt = "\u{f3fd}" - case tag = "\u{f02b}" - case tags = "\u{f02c}" - case tape = "\u{f4db}" - case tasks = "\u{f0ae}" - case taxi = "\u{f1ba}" - case teeth = "\u{f62e}" - case teethOpen = "\u{f62f}" - case terminal = "\u{f120}" - case textHeight = "\u{f034}" - case textWidth = "\u{f035}" - case th = "\u{f00a}" - case thLarge = "\u{f009}" - case thList = "\u{f00b}" - case theaterMasks = "\u{f630}" - case thermometer = "\u{f491}" - case thermometerEmpty = "\u{f2cb}" - case thermometerFull = "\u{f2c7}" - case thermometerHalf = "\u{f2c9}" - case thermometerQuarter = "\u{f2ca}" - case thermometerThreeQuarters = "\u{f2c8}" - case thumbsDown = "\u{f165}" - case thumbsUp = "\u{f164}" - case thumbtack = "\u{f08d}" - case ticketAlt = "\u{f3ff}" - case times = "\u{f00d}" - case timesCircle = "\u{f057}" - case tint = "\u{f043}" - case tintSlash = "\u{f5c7}" - case tired = "\u{f5c8}" - case toggleOff = "\u{f204}" - case toggleOn = "\u{f205}" - case toiletPaper = "\u{f71e}" - case toolbox = "\u{f552}" - case tooth = "\u{f5c9}" - case torah = "\u{f6a0}" - case toriiGate = "\u{f6a1}" - case tractor = "\u{f722}" - case trademark = "\u{f25c}" - case trafficLight = "\u{f637}" - case train = "\u{f238}" - case transgender = "\u{f224}" - case transgenderAlt = "\u{f225}" - case trash = "\u{f1f8}" - case trashAlt = "\u{f2ed}" - case tree = "\u{f1bb}" - case trophy = "\u{f091}" - case truck = "\u{f0d1}" - case truckLoading = "\u{f4de}" - case truckMonster = "\u{f63b}" - case truckMoving = "\u{f4df}" - case truckPickup = "\u{f63c}" - case tshirt = "\u{f553}" - case tty = "\u{f1e4}" - case tv = "\u{f26c}" - case umbrella = "\u{f0e9}" - case umbrellaBeach = "\u{f5ca}" - case underline = "\u{f0cd}" - case undo = "\u{f0e2}" - case undoAlt = "\u{f2ea}" - case universalAccess = "\u{f29a}" - case university = "\u{f19c}" - case unlink = "\u{f127}" - case unlock = "\u{f09c}" - case unlockAlt = "\u{f13e}" - case upload = "\u{f093}" - case user = "\u{f007}" - case userAlt = "\u{f406}" - case userAltSlash = "\u{f4fa}" - case userAstronaut = "\u{f4fb}" - case userCheck = "\u{f4fc}" - case userCircle = "\u{f2bd}" - case userClock = "\u{f4fd}" - case userCog = "\u{f4fe}" - case userEdit = "\u{f4ff}" - case userFriends = "\u{f500}" - case userGraduate = "\u{f501}" - case userInjured = "\u{f728}" - case userLock = "\u{f502}" - case userMd = "\u{f0f0}" - case userMinus = "\u{f503}" - case userNinja = "\u{f504}" - case userPlus = "\u{f234}" - case userSecret = "\u{f21b}" - case userShield = "\u{f505}" - case userSlash = "\u{f506}" - case userTag = "\u{f507}" - case userTie = "\u{f508}" - case userTimes = "\u{f235}" - case users = "\u{f0c0}" - case usersCog = "\u{f509}" - case utensilSpoon = "\u{f2e5}" - case utensils = "\u{f2e7}" - case vectorSquare = "\u{f5cb}" - case venus = "\u{f221}" - case venusDouble = "\u{f226}" - case venusMars = "\u{f228}" - case vial = "\u{f492}" - case vials = "\u{f493}" - case video = "\u{f03d}" - case videoSlash = "\u{f4e2}" - case vihara = "\u{f6a7}" - case volleyballBall = "\u{f45f}" - case volumeDown = "\u{f027}" - case volumeMute = "\u{f6a9}" - case volumeOff = "\u{f026}" - case volumeUp = "\u{f028}" - case vrCardboard = "\u{f729}" - case walking = "\u{f554}" - case wallet = "\u{f555}" - case warehouse = "\u{f494}" - case weight = "\u{f496}" - case weightHanging = "\u{f5cd}" - case wheelchair = "\u{f193}" - case wifi = "\u{f1eb}" - case wind = "\u{f72e}" - case windowClose = "\u{f410}" - case windowMaximize = "\u{f2d0}" - case windowMinimize = "\u{f2d1}" - case windowRestore = "\u{f2d2}" - case wineBottle = "\u{f72f}" - case wineGlass = "\u{f4e3}" - case wineGlassAlt = "\u{f5ce}" - case wonSign = "\u{f159}" - case wrench = "\u{f0ad}" - case xRay = "\u{f497}" - case yenSign = "\u{f157}" - case yinYang = "\u{f6ad}" - - public var fontType: AwesomeFont { - return Awesome.Font.solid - } - } - - @available(*, deprecated, renamed: "Brand") - public typealias brand = Brand public enum Brand: String, CaseIterable, Amazing { case fa500px = "\u{f26e}" case accessibleIcon = "\u{f368}" @@ -1267,77 +404,516 @@ public struct Awesome { case zhihu = "\u{f63f}" public var fontType: AwesomeFont { - return Awesome.Font.brand + return Awesome.Font.brand + } + } + + public enum Regular: String, CaseIterable, Amazing { + case addressBook = "\u{f2b9}" + case addressCard = "\u{f2bb}" + case angry = "\u{f556}" + case arrowAltCircleDown = "\u{f358}" + case arrowAltCircleLeft = "\u{f359}" + case arrowAltCircleRight = "\u{f35a}" + case arrowAltCircleUp = "\u{f35b}" + case bell = "\u{f0f3}" + case bellSlash = "\u{f1f6}" + case bookmark = "\u{f02e}" + case building = "\u{f1ad}" + case calendar = "\u{f133}" + case calendarAlt = "\u{f073}" + case calendarCheck = "\u{f274}" + case calendarMinus = "\u{f272}" + case calendarPlus = "\u{f271}" + case calendarTimes = "\u{f273}" + case caretSquareDown = "\u{f150}" + case caretSquareLeft = "\u{f191}" + case caretSquareRight = "\u{f152}" + case caretSquareUp = "\u{f151}" + case chartBar = "\u{f080}" + case checkCircle = "\u{f058}" + case checkSquare = "\u{f14a}" + case circle = "\u{f111}" + case clipboard = "\u{f328}" + case clock = "\u{f017}" + case clone = "\u{f24d}" + case closedCaptioning = "\u{f20a}" + case comment = "\u{f075}" + case commentAlt = "\u{f27a}" + case commentDots = "\u{f4ad}" + case comments = "\u{f086}" + case compass = "\u{f14e}" + case copy = "\u{f0c5}" + case copyright = "\u{f1f9}" + case creditCard = "\u{f09d}" + case dizzy = "\u{f567}" + case dotCircle = "\u{f192}" + case edit = "\u{f044}" + case envelope = "\u{f0e0}" + case envelopeOpen = "\u{f2b6}" + case eye = "\u{f06e}" + case eyeSlash = "\u{f070}" + case file = "\u{f15b}" + case fileAlt = "\u{f15c}" + case fileArchive = "\u{f1c6}" + case fileAudio = "\u{f1c7}" + case fileCode = "\u{f1c9}" + case fileExcel = "\u{f1c3}" + case fileImage = "\u{f1c5}" + case filePdf = "\u{f1c1}" + case filePowerpoint = "\u{f1c4}" + case fileVideo = "\u{f1c8}" + case fileWord = "\u{f1c2}" + case flag = "\u{f024}" + case flushed = "\u{f579}" + case folder = "\u{f07b}" + case folderOpen = "\u{f07c}" + case fontAwesomeLogoFull = "\u{f4e6}" + case frown = "\u{f119}" + case frownOpen = "\u{f57a}" + case futbol = "\u{f1e3}" + case gem = "\u{f3a5}" + case grimace = "\u{f57f}" + case grin = "\u{f580}" + case grinAlt = "\u{f581}" + case grinBeam = "\u{f582}" + case grinBeamSweat = "\u{f583}" + case grinHearts = "\u{f584}" + case grinSquint = "\u{f585}" + case grinSquintTears = "\u{f586}" + case grinStars = "\u{f587}" + case grinTears = "\u{f588}" + case grinTongue = "\u{f589}" + case grinTongueSquint = "\u{f58a}" + case grinTongueWink = "\u{f58b}" + case grinWink = "\u{f58c}" + case handLizard = "\u{f258}" + case handPaper = "\u{f256}" + case handPeace = "\u{f25b}" + case handPointDown = "\u{f0a7}" + case handPointLeft = "\u{f0a5}" + case handPointRight = "\u{f0a4}" + case handPointUp = "\u{f0a6}" + case handPointer = "\u{f25a}" + case handRock = "\u{f255}" + case handScissors = "\u{f257}" + case handSpock = "\u{f259}" + case handshake = "\u{f2b5}" + case hdd = "\u{f0a0}" + case heart = "\u{f004}" + case hospital = "\u{f0f8}" + case hourglass = "\u{f254}" + case idBadge = "\u{f2c1}" + case idCard = "\u{f2c2}" + case image = "\u{f03e}" + case images = "\u{f302}" + case keyboard = "\u{f11c}" + case kiss = "\u{f596}" + case kissBeam = "\u{f597}" + case kissWinkHeart = "\u{f598}" + case laugh = "\u{f599}" + case laughBeam = "\u{f59a}" + case laughSquint = "\u{f59b}" + case laughWink = "\u{f59c}" + case lemon = "\u{f094}" + case lifeRing = "\u{f1cd}" + case lightbulb = "\u{f0eb}" + case listAlt = "\u{f022}" + case map = "\u{f279}" + case meh = "\u{f11a}" + case mehBlank = "\u{f5a4}" + case mehRollingEyes = "\u{f5a5}" + case minusSquare = "\u{f146}" + case moneyBillAlt = "\u{f3d1}" + case moon = "\u{f186}" + case newspaper = "\u{f1ea}" + case objectGroup = "\u{f247}" + case objectUngroup = "\u{f248}" + case paperPlane = "\u{f1d8}" + case pauseCircle = "\u{f28b}" + case playCircle = "\u{f144}" + case plusSquare = "\u{f0fe}" + case questionCircle = "\u{f059}" + case registered = "\u{f25d}" + case sadCry = "\u{f5b3}" + case sadTear = "\u{f5b4}" + case save = "\u{f0c7}" + case shareSquare = "\u{f14d}" + case smile = "\u{f118}" + case smileBeam = "\u{f5b8}" + case smileWink = "\u{f4da}" + case snowflake = "\u{f2dc}" + case square = "\u{f0c8}" + case star = "\u{f005}" + case starHalf = "\u{f089}" + case stickyNote = "\u{f249}" + case stopCircle = "\u{f28d}" + case sun = "\u{f185}" + case surprise = "\u{f5c2}" + case thumbsDown = "\u{f165}" + case thumbsUp = "\u{f164}" + case timesCircle = "\u{f057}" + case tired = "\u{f5c8}" + case trashAlt = "\u{f2ed}" + case user = "\u{f007}" + case userCircle = "\u{f2bd}" + case windowClose = "\u{f410}" + case windowMaximize = "\u{f2d0}" + case windowMinimize = "\u{f2d1}" + case windowRestore = "\u{f2d2}" + + public var fontType: AwesomeFont { + return Awesome.Font.regular } } - @available(*, deprecated, renamed: "Regular") - public typealias regular = Regular - public enum Regular: String, CaseIterable, Amazing { + public enum Solid: String, CaseIterable, Amazing { + case ad = "\u{f641}" case addressBook = "\u{f2b9}" case addressCard = "\u{f2bb}" + case adjust = "\u{f042}" + case airFreshener = "\u{f5d0}" + case alignCenter = "\u{f037}" + case alignJustify = "\u{f039}" + case alignLeft = "\u{f036}" + case alignRight = "\u{f038}" + case allergies = "\u{f461}" + case ambulance = "\u{f0f9}" + case americanSignLanguageInterpreting = "\u{f2a3}" + case anchor = "\u{f13d}" + case angleDoubleDown = "\u{f103}" + case angleDoubleLeft = "\u{f100}" + case angleDoubleRight = "\u{f101}" + case angleDoubleUp = "\u{f102}" + case angleDown = "\u{f107}" + case angleLeft = "\u{f104}" + case angleRight = "\u{f105}" + case angleUp = "\u{f106}" case angry = "\u{f556}" + case ankh = "\u{f644}" + case appleAlt = "\u{f5d1}" + case archive = "\u{f187}" + case archway = "\u{f557}" case arrowAltCircleDown = "\u{f358}" case arrowAltCircleLeft = "\u{f359}" case arrowAltCircleRight = "\u{f35a}" case arrowAltCircleUp = "\u{f35b}" + case arrowCircleDown = "\u{f0ab}" + case arrowCircleLeft = "\u{f0a8}" + case arrowCircleRight = "\u{f0a9}" + case arrowCircleUp = "\u{f0aa}" + case arrowDown = "\u{f063}" + case arrowLeft = "\u{f060}" + case arrowRight = "\u{f061}" + case arrowUp = "\u{f062}" + case arrowsAlt = "\u{f0b2}" + case arrowsAltH = "\u{f337}" + case arrowsAltV = "\u{f338}" + case assistiveListeningSystems = "\u{f2a2}" + case asterisk = "\u{f069}" + case at = "\u{f1fa}" + case atlas = "\u{f558}" + case atom = "\u{f5d2}" + case audioDescription = "\u{f29e}" + case award = "\u{f559}" + case backspace = "\u{f55a}" + case backward = "\u{f04a}" + case balanceScale = "\u{f24e}" + case ban = "\u{f05e}" + case bandAid = "\u{f462}" + case barcode = "\u{f02a}" + case bars = "\u{f0c9}" + case baseballBall = "\u{f433}" + case basketballBall = "\u{f434}" + case bath = "\u{f2cd}" + case batteryEmpty = "\u{f244}" + case batteryFull = "\u{f240}" + case batteryHalf = "\u{f242}" + case batteryQuarter = "\u{f243}" + case batteryThreeQuarters = "\u{f241}" + case bed = "\u{f236}" + case beer = "\u{f0fc}" case bell = "\u{f0f3}" case bellSlash = "\u{f1f6}" + case bezierCurve = "\u{f55b}" + case bible = "\u{f647}" + case bicycle = "\u{f206}" + case binoculars = "\u{f1e5}" + case birthdayCake = "\u{f1fd}" + case blender = "\u{f517}" + case blenderPhone = "\u{f6b6}" + case blind = "\u{f29d}" + case bold = "\u{f032}" + case bolt = "\u{f0e7}" + case bomb = "\u{f1e2}" + case bone = "\u{f5d7}" + case bong = "\u{f55c}" + case book = "\u{f02d}" + case bookDead = "\u{f6b7}" + case bookOpen = "\u{f518}" + case bookReader = "\u{f5da}" case bookmark = "\u{f02e}" + case bowlingBall = "\u{f436}" + case box = "\u{f466}" + case boxOpen = "\u{f49e}" + case boxes = "\u{f468}" + case braille = "\u{f2a1}" + case brain = "\u{f5dc}" + case briefcase = "\u{f0b1}" + case briefcaseMedical = "\u{f469}" + case broadcastTower = "\u{f519}" + case broom = "\u{f51a}" + case brush = "\u{f55d}" + case bug = "\u{f188}" case building = "\u{f1ad}" + case bullhorn = "\u{f0a1}" + case bullseye = "\u{f140}" + case burn = "\u{f46a}" + case bus = "\u{f207}" + case busAlt = "\u{f55e}" + case businessTime = "\u{f64a}" + case calculator = "\u{f1ec}" case calendar = "\u{f133}" case calendarAlt = "\u{f073}" case calendarCheck = "\u{f274}" case calendarMinus = "\u{f272}" case calendarPlus = "\u{f271}" case calendarTimes = "\u{f273}" + case camera = "\u{f030}" + case cameraRetro = "\u{f083}" + case campground = "\u{f6bb}" + case cannabis = "\u{f55f}" + case capsules = "\u{f46b}" + case car = "\u{f1b9}" + case carAlt = "\u{f5de}" + case carBattery = "\u{f5df}" + case carCrash = "\u{f5e1}" + case carSide = "\u{f5e4}" + case caretDown = "\u{f0d7}" + case caretLeft = "\u{f0d9}" + case caretRight = "\u{f0da}" case caretSquareDown = "\u{f150}" case caretSquareLeft = "\u{f191}" case caretSquareRight = "\u{f152}" case caretSquareUp = "\u{f151}" + case caretUp = "\u{f0d8}" + case cartArrowDown = "\u{f218}" + case cartPlus = "\u{f217}" + case cat = "\u{f6be}" + case certificate = "\u{f0a3}" + case chair = "\u{f6c0}" + case chalkboard = "\u{f51b}" + case chalkboardTeacher = "\u{f51c}" + case chargingStation = "\u{f5e7}" + case chartArea = "\u{f1fe}" case chartBar = "\u{f080}" + case chartLine = "\u{f201}" + case chartPie = "\u{f200}" + case check = "\u{f00c}" case checkCircle = "\u{f058}" + case checkDouble = "\u{f560}" case checkSquare = "\u{f14a}" + case chess = "\u{f439}" + case chessBishop = "\u{f43a}" + case chessBoard = "\u{f43c}" + case chessKing = "\u{f43f}" + case chessKnight = "\u{f441}" + case chessPawn = "\u{f443}" + case chessQueen = "\u{f445}" + case chessRook = "\u{f447}" + case chevronCircleDown = "\u{f13a}" + case chevronCircleLeft = "\u{f137}" + case chevronCircleRight = "\u{f138}" + case chevronCircleUp = "\u{f139}" + case chevronDown = "\u{f078}" + case chevronLeft = "\u{f053}" + case chevronRight = "\u{f054}" + case chevronUp = "\u{f077}" + case child = "\u{f1ae}" + case church = "\u{f51d}" case circle = "\u{f111}" + case circleNotch = "\u{f1ce}" + case city = "\u{f64f}" case clipboard = "\u{f328}" + case clipboardCheck = "\u{f46c}" + case clipboardList = "\u{f46d}" case clock = "\u{f017}" case clone = "\u{f24d}" case closedCaptioning = "\u{f20a}" + case cloud = "\u{f0c2}" + case cloudDownloadAlt = "\u{f381}" + case cloudMoon = "\u{f6c3}" + case cloudSun = "\u{f6c4}" + case cloudUploadAlt = "\u{f382}" + case cocktail = "\u{f561}" + case code = "\u{f121}" + case codeBranch = "\u{f126}" + case coffee = "\u{f0f4}" + case cog = "\u{f013}" + case cogs = "\u{f085}" + case coins = "\u{f51e}" + case columns = "\u{f0db}" case comment = "\u{f075}" case commentAlt = "\u{f27a}" + case commentDollar = "\u{f651}" case commentDots = "\u{f4ad}" + case commentSlash = "\u{f4b3}" case comments = "\u{f086}" + case commentsDollar = "\u{f653}" + case compactDisc = "\u{f51f}" case compass = "\u{f14e}" + case compress = "\u{f066}" + case conciergeBell = "\u{f562}" + case cookie = "\u{f563}" + case cookieBite = "\u{f564}" case copy = "\u{f0c5}" case copyright = "\u{f1f9}" + case couch = "\u{f4b8}" case creditCard = "\u{f09d}" + case crop = "\u{f125}" + case cropAlt = "\u{f565}" + case cross = "\u{f654}" + case crosshairs = "\u{f05b}" + case crow = "\u{f520}" + case crown = "\u{f521}" + case cube = "\u{f1b2}" + case cubes = "\u{f1b3}" + case cut = "\u{f0c4}" + case database = "\u{f1c0}" + case deaf = "\u{f2a4}" + case desktop = "\u{f108}" + case dharmachakra = "\u{f655}" + case diagnoses = "\u{f470}" + case dice = "\u{f522}" + case diceD20 = "\u{f6cf}" + case diceD6 = "\u{f6d1}" + case diceFive = "\u{f523}" + case diceFour = "\u{f524}" + case diceOne = "\u{f525}" + case diceSix = "\u{f526}" + case diceThree = "\u{f527}" + case diceTwo = "\u{f528}" + case digitalTachograph = "\u{f566}" + case directions = "\u{f5eb}" + case divide = "\u{f529}" case dizzy = "\u{f567}" + case dna = "\u{f471}" + case dog = "\u{f6d3}" + case dollarSign = "\u{f155}" + case dolly = "\u{f472}" + case dollyFlatbed = "\u{f474}" + case donate = "\u{f4b9}" + case doorClosed = "\u{f52a}" + case doorOpen = "\u{f52b}" case dotCircle = "\u{f192}" + case dove = "\u{f4ba}" + case download = "\u{f019}" + case draftingCompass = "\u{f568}" + case dragon = "\u{f6d5}" + case drawPolygon = "\u{f5ee}" + case drum = "\u{f569}" + case drumSteelpan = "\u{f56a}" + case drumstickBite = "\u{f6d7}" + case dumbbell = "\u{f44b}" + case dungeon = "\u{f6d9}" case edit = "\u{f044}" + case eject = "\u{f052}" + case ellipsisH = "\u{f141}" + case ellipsisV = "\u{f142}" case envelope = "\u{f0e0}" case envelopeOpen = "\u{f2b6}" + case envelopeOpenText = "\u{f658}" + case envelopeSquare = "\u{f199}" + case equals = "\u{f52c}" + case eraser = "\u{f12d}" + case euroSign = "\u{f153}" + case exchangeAlt = "\u{f362}" + case exclamation = "\u{f12a}" + case exclamationCircle = "\u{f06a}" + case exclamationTriangle = "\u{f071}" + case expand = "\u{f065}" + case expandArrowsAlt = "\u{f31e}" + case externalLinkAlt = "\u{f35d}" + case externalLinkSquareAlt = "\u{f360}" case eye = "\u{f06e}" + case eyeDropper = "\u{f1fb}" case eyeSlash = "\u{f070}" + case fastBackward = "\u{f049}" + case fastForward = "\u{f050}" + case fax = "\u{f1ac}" + case feather = "\u{f52d}" + case featherAlt = "\u{f56b}" + case female = "\u{f182}" + case fighterJet = "\u{f0fb}" case file = "\u{f15b}" case fileAlt = "\u{f15c}" case fileArchive = "\u{f1c6}" case fileAudio = "\u{f1c7}" case fileCode = "\u{f1c9}" + case fileContract = "\u{f56c}" + case fileCsv = "\u{f6dd}" + case fileDownload = "\u{f56d}" case fileExcel = "\u{f1c3}" + case fileExport = "\u{f56e}" case fileImage = "\u{f1c5}" + case fileImport = "\u{f56f}" + case fileInvoice = "\u{f570}" + case fileInvoiceDollar = "\u{f571}" + case fileMedical = "\u{f477}" + case fileMedicalAlt = "\u{f478}" case filePdf = "\u{f1c1}" case filePowerpoint = "\u{f1c4}" + case filePrescription = "\u{f572}" + case fileSignature = "\u{f573}" + case fileUpload = "\u{f574}" case fileVideo = "\u{f1c8}" case fileWord = "\u{f1c2}" + case fill = "\u{f575}" + case fillDrip = "\u{f576}" + case film = "\u{f008}" + case filter = "\u{f0b0}" + case fingerprint = "\u{f577}" + case fire = "\u{f06d}" + case fireExtinguisher = "\u{f134}" + case firstAid = "\u{f479}" + case fish = "\u{f578}" + case fistRaised = "\u{f6de}" case flag = "\u{f024}" + case flagCheckered = "\u{f11e}" + case flask = "\u{f0c3}" case flushed = "\u{f579}" case folder = "\u{f07b}" + case folderMinus = "\u{f65d}" case folderOpen = "\u{f07c}" + case folderPlus = "\u{f65e}" + case font = "\u{f031}" case fontAwesomeLogoFull = "\u{f4e6}" + case footballBall = "\u{f44e}" + case forward = "\u{f04e}" + case frog = "\u{f52e}" case frown = "\u{f119}" case frownOpen = "\u{f57a}" + case funnelDollar = "\u{f662}" case futbol = "\u{f1e3}" + case gamepad = "\u{f11b}" + case gasPump = "\u{f52f}" + case gavel = "\u{f0e3}" case gem = "\u{f3a5}" + case genderless = "\u{f22d}" + case ghost = "\u{f6e2}" + case gift = "\u{f06b}" + case glassMartini = "\u{f000}" + case glassMartiniAlt = "\u{f57b}" + case glasses = "\u{f530}" + case globe = "\u{f0ac}" + case globeAfrica = "\u{f57c}" + case globeAmericas = "\u{f57d}" + case globeAsia = "\u{f57e}" + case golfBall = "\u{f450}" + case gopuram = "\u{f664}" + case graduationCap = "\u{f19d}" + case greaterThan = "\u{f531}" + case greaterThanEqual = "\u{f532}" case grimace = "\u{f57f}" case grin = "\u{f580}" case grinAlt = "\u{f581}" @@ -1352,6 +928,14 @@ public struct Awesome { case grinTongueSquint = "\u{f58a}" case grinTongueWink = "\u{f58b}" case grinWink = "\u{f58c}" + case gripHorizontal = "\u{f58d}" + case gripVertical = "\u{f58e}" + case hSquare = "\u{f0fd}" + case hammer = "\u{f6e3}" + case hamsa = "\u{f665}" + case handHolding = "\u{f4bd}" + case handHoldingHeart = "\u{f4be}" + case handHoldingUsd = "\u{f4c0}" case handLizard = "\u{f258}" case handPaper = "\u{f256}" case handPeace = "\u{f25b}" @@ -1363,72 +947,482 @@ public struct Awesome { case handRock = "\u{f255}" case handScissors = "\u{f257}" case handSpock = "\u{f259}" + case hands = "\u{f4c2}" + case handsHelping = "\u{f4c4}" case handshake = "\u{f2b5}" + case hanukiah = "\u{f6e6}" + case hashtag = "\u{f292}" + case hatWizard = "\u{f6e8}" + case haykal = "\u{f666}" case hdd = "\u{f0a0}" + case heading = "\u{f1dc}" + case headphones = "\u{f025}" + case headphonesAlt = "\u{f58f}" + case headset = "\u{f590}" case heart = "\u{f004}" + case heartbeat = "\u{f21e}" + case helicopter = "\u{f533}" + case highlighter = "\u{f591}" + case hiking = "\u{f6ec}" + case hippo = "\u{f6ed}" + case history = "\u{f1da}" + case hockeyPuck = "\u{f453}" + case home = "\u{f015}" + case horse = "\u{f6f0}" case hospital = "\u{f0f8}" + case hospitalAlt = "\u{f47d}" + case hospitalSymbol = "\u{f47e}" + case hotTub = "\u{f593}" + case hotel = "\u{f594}" case hourglass = "\u{f254}" + case hourglassEnd = "\u{f253}" + case hourglassHalf = "\u{f252}" + case hourglassStart = "\u{f251}" + case houseDamage = "\u{f6f1}" + case hryvnia = "\u{f6f2}" + case iCursor = "\u{f246}" case idBadge = "\u{f2c1}" case idCard = "\u{f2c2}" + case idCardAlt = "\u{f47f}" case image = "\u{f03e}" case images = "\u{f302}" + case inbox = "\u{f01c}" + case indent = "\u{f03c}" + case industry = "\u{f275}" + case infinity = "\u{f534}" + case info = "\u{f129}" + case infoCircle = "\u{f05a}" + case italic = "\u{f033}" + case jedi = "\u{f669}" + case joint = "\u{f595}" + case journalWhills = "\u{f66a}" + case kaaba = "\u{f66b}" + case key = "\u{f084}" case keyboard = "\u{f11c}" + case khanda = "\u{f66d}" case kiss = "\u{f596}" case kissBeam = "\u{f597}" case kissWinkHeart = "\u{f598}" + case kiwiBird = "\u{f535}" + case landmark = "\u{f66f}" + case language = "\u{f1ab}" + case laptop = "\u{f109}" + case laptopCode = "\u{f5fc}" case laugh = "\u{f599}" case laughBeam = "\u{f59a}" case laughSquint = "\u{f59b}" case laughWink = "\u{f59c}" + case layerGroup = "\u{f5fd}" + case leaf = "\u{f06c}" case lemon = "\u{f094}" + case lessThan = "\u{f536}" + case lessThanEqual = "\u{f537}" + case levelDownAlt = "\u{f3be}" + case levelUpAlt = "\u{f3bf}" case lifeRing = "\u{f1cd}" case lightbulb = "\u{f0eb}" + case link = "\u{f0c1}" + case liraSign = "\u{f195}" + case list = "\u{f03a}" case listAlt = "\u{f022}" + case listOl = "\u{f0cb}" + case listUl = "\u{f0ca}" + case locationArrow = "\u{f124}" + case lock = "\u{f023}" + case lockOpen = "\u{f3c1}" + case longArrowAltDown = "\u{f309}" + case longArrowAltLeft = "\u{f30a}" + case longArrowAltRight = "\u{f30b}" + case longArrowAltUp = "\u{f30c}" + case lowVision = "\u{f2a8}" + case luggageCart = "\u{f59d}" + case magic = "\u{f0d0}" + case magnet = "\u{f076}" + case mailBulk = "\u{f674}" + case male = "\u{f183}" case map = "\u{f279}" + case mapMarked = "\u{f59f}" + case mapMarkedAlt = "\u{f5a0}" + case mapMarker = "\u{f041}" + case mapMarkerAlt = "\u{f3c5}" + case mapPin = "\u{f276}" + case mapSigns = "\u{f277}" + case marker = "\u{f5a1}" + case mars = "\u{f222}" + case marsDouble = "\u{f227}" + case marsStroke = "\u{f229}" + case marsStrokeH = "\u{f22b}" + case marsStrokeV = "\u{f22a}" + case mask = "\u{f6fa}" + case medal = "\u{f5a2}" + case medkit = "\u{f0fa}" case meh = "\u{f11a}" case mehBlank = "\u{f5a4}" case mehRollingEyes = "\u{f5a5}" + case memory = "\u{f538}" + case menorah = "\u{f676}" + case mercury = "\u{f223}" + case microchip = "\u{f2db}" + case microphone = "\u{f130}" + case microphoneAlt = "\u{f3c9}" + case microphoneAltSlash = "\u{f539}" + case microphoneSlash = "\u{f131}" + case microscope = "\u{f610}" + case minus = "\u{f068}" + case minusCircle = "\u{f056}" case minusSquare = "\u{f146}" + case mobile = "\u{f10b}" + case mobileAlt = "\u{f3cd}" + case moneyBill = "\u{f0d6}" case moneyBillAlt = "\u{f3d1}" + case moneyBillWave = "\u{f53a}" + case moneyBillWaveAlt = "\u{f53b}" + case moneyCheck = "\u{f53c}" + case moneyCheckAlt = "\u{f53d}" + case monument = "\u{f5a6}" case moon = "\u{f186}" + case mortarPestle = "\u{f5a7}" + case mosque = "\u{f678}" + case motorcycle = "\u{f21c}" + case mountain = "\u{f6fc}" + case mousePointer = "\u{f245}" + case music = "\u{f001}" + case networkWired = "\u{f6ff}" + case neuter = "\u{f22c}" case newspaper = "\u{f1ea}" + case notEqual = "\u{f53e}" + case notesMedical = "\u{f481}" case objectGroup = "\u{f247}" case objectUngroup = "\u{f248}" + case oilCan = "\u{f613}" + case om = "\u{f679}" + case otter = "\u{f700}" + case outdent = "\u{f03b}" + case paintBrush = "\u{f1fc}" + case paintRoller = "\u{f5aa}" + case palette = "\u{f53f}" + case pallet = "\u{f482}" case paperPlane = "\u{f1d8}" + case paperclip = "\u{f0c6}" + case parachuteBox = "\u{f4cd}" + case paragraph = "\u{f1dd}" + case parking = "\u{f540}" + case passport = "\u{f5ab}" + case pastafarianism = "\u{f67b}" + case paste = "\u{f0ea}" + case pause = "\u{f04c}" case pauseCircle = "\u{f28b}" + case paw = "\u{f1b0}" + case peace = "\u{f67c}" + case pen = "\u{f304}" + case penAlt = "\u{f305}" + case penFancy = "\u{f5ac}" + case penNib = "\u{f5ad}" + case penSquare = "\u{f14b}" + case pencilAlt = "\u{f303}" + case pencilRuler = "\u{f5ae}" + case peopleCarry = "\u{f4ce}" + case percent = "\u{f295}" + case percentage = "\u{f541}" + case phone = "\u{f095}" + case phoneSlash = "\u{f3dd}" + case phoneSquare = "\u{f098}" + case phoneVolume = "\u{f2a0}" + case piggyBank = "\u{f4d3}" + case pills = "\u{f484}" + case placeOfWorship = "\u{f67f}" + case plane = "\u{f072}" + case planeArrival = "\u{f5af}" + case planeDeparture = "\u{f5b0}" + case play = "\u{f04b}" case playCircle = "\u{f144}" + case plug = "\u{f1e6}" + case plus = "\u{f067}" + case plusCircle = "\u{f055}" case plusSquare = "\u{f0fe}" + case podcast = "\u{f2ce}" + case poll = "\u{f681}" + case pollH = "\u{f682}" + case poo = "\u{f2fe}" + case poop = "\u{f619}" + case portrait = "\u{f3e0}" + case poundSign = "\u{f154}" + case powerOff = "\u{f011}" + case pray = "\u{f683}" + case prayingHands = "\u{f684}" + case prescription = "\u{f5b1}" + case prescriptionBottle = "\u{f485}" + case prescriptionBottleAlt = "\u{f486}" + case print = "\u{f02f}" + case procedures = "\u{f487}" + case projectDiagram = "\u{f542}" + case puzzlePiece = "\u{f12e}" + case qrcode = "\u{f029}" + case question = "\u{f128}" case questionCircle = "\u{f059}" + case quidditch = "\u{f458}" + case quoteLeft = "\u{f10d}" + case quoteRight = "\u{f10e}" + case quran = "\u{f687}" + case random = "\u{f074}" + case receipt = "\u{f543}" + case recycle = "\u{f1b8}" + case redo = "\u{f01e}" + case redoAlt = "\u{f2f9}" case registered = "\u{f25d}" + case reply = "\u{f3e5}" + case replyAll = "\u{f122}" + case retweet = "\u{f079}" + case ribbon = "\u{f4d6}" + case ring = "\u{f70b}" + case road = "\u{f018}" + case robot = "\u{f544}" + case rocket = "\u{f135}" + case route = "\u{f4d7}" + case rss = "\u{f09e}" + case rssSquare = "\u{f143}" + case rubleSign = "\u{f158}" + case ruler = "\u{f545}" + case rulerCombined = "\u{f546}" + case rulerHorizontal = "\u{f547}" + case rulerVertical = "\u{f548}" + case running = "\u{f70c}" + case rupeeSign = "\u{f156}" case sadCry = "\u{f5b3}" case sadTear = "\u{f5b4}" case save = "\u{f0c7}" + case school = "\u{f549}" + case screwdriver = "\u{f54a}" + case scroll = "\u{f70e}" + case search = "\u{f002}" + case searchDollar = "\u{f688}" + case searchLocation = "\u{f689}" + case searchMinus = "\u{f010}" + case searchPlus = "\u{f00e}" + case seedling = "\u{f4d8}" + case server = "\u{f233}" + case shapes = "\u{f61f}" + case share = "\u{f064}" + case shareAlt = "\u{f1e0}" + case shareAltSquare = "\u{f1e1}" case shareSquare = "\u{f14d}" + case shekelSign = "\u{f20b}" + case shieldAlt = "\u{f3ed}" + case ship = "\u{f21a}" + case shippingFast = "\u{f48b}" + case shoePrints = "\u{f54b}" + case shoppingBag = "\u{f290}" + case shoppingBasket = "\u{f291}" + case shoppingCart = "\u{f07a}" + case shower = "\u{f2cc}" + case shuttleVan = "\u{f5b6}" + case sign = "\u{f4d9}" + case signInAlt = "\u{f2f6}" + case signLanguage = "\u{f2a7}" + case signOutAlt = "\u{f2f5}" + case signal = "\u{f012}" + case signature = "\u{f5b7}" + case sitemap = "\u{f0e8}" + case skull = "\u{f54c}" + case skullCrossbones = "\u{f714}" + case slash = "\u{f715}" + case slidersH = "\u{f1de}" case smile = "\u{f118}" case smileBeam = "\u{f5b8}" case smileWink = "\u{f4da}" + case smoking = "\u{f48d}" + case smokingBan = "\u{f54d}" case snowflake = "\u{f2dc}" + case socks = "\u{f696}" + case solarPanel = "\u{f5ba}" + case sort = "\u{f0dc}" + case sortAlphaDown = "\u{f15d}" + case sortAlphaUp = "\u{f15e}" + case sortAmountDown = "\u{f160}" + case sortAmountUp = "\u{f161}" + case sortDown = "\u{f0dd}" + case sortNumericDown = "\u{f162}" + case sortNumericUp = "\u{f163}" + case sortUp = "\u{f0de}" + case spa = "\u{f5bb}" + case spaceShuttle = "\u{f197}" + case spider = "\u{f717}" + case spinner = "\u{f110}" + case splotch = "\u{f5bc}" + case sprayCan = "\u{f5bd}" case square = "\u{f0c8}" + case squareFull = "\u{f45c}" + case squareRootAlt = "\u{f698}" + case stamp = "\u{f5bf}" case star = "\u{f005}" + case starAndCrescent = "\u{f699}" case starHalf = "\u{f089}" + case starHalfAlt = "\u{f5c0}" + case starOfDavid = "\u{f69a}" + case starOfLife = "\u{f621}" + case stepBackward = "\u{f048}" + case stepForward = "\u{f051}" + case stethoscope = "\u{f0f1}" case stickyNote = "\u{f249}" + case stop = "\u{f04d}" case stopCircle = "\u{f28d}" + case stopwatch = "\u{f2f2}" + case store = "\u{f54e}" + case storeAlt = "\u{f54f}" + case stream = "\u{f550}" + case streetView = "\u{f21d}" + case strikethrough = "\u{f0cc}" + case stroopwafel = "\u{f551}" + case `subscript` = "\u{f12c}" + case subway = "\u{f239}" + case suitcase = "\u{f0f2}" + case suitcaseRolling = "\u{f5c1}" case sun = "\u{f185}" + case superscript = "\u{f12b}" case surprise = "\u{f5c2}" + case swatchbook = "\u{f5c3}" + case swimmer = "\u{f5c4}" + case swimmingPool = "\u{f5c5}" + case synagogue = "\u{f69b}" + case sync = "\u{f021}" + case syncAlt = "\u{f2f1}" + case syringe = "\u{f48e}" + case table = "\u{f0ce}" + case tableTennis = "\u{f45d}" + case tablet = "\u{f10a}" + case tabletAlt = "\u{f3fa}" + case tablets = "\u{f490}" + case tachometerAlt = "\u{f3fd}" + case tag = "\u{f02b}" + case tags = "\u{f02c}" + case tape = "\u{f4db}" + case tasks = "\u{f0ae}" + case taxi = "\u{f1ba}" + case teeth = "\u{f62e}" + case teethOpen = "\u{f62f}" + case terminal = "\u{f120}" + case textHeight = "\u{f034}" + case textWidth = "\u{f035}" + case th = "\u{f00a}" + case thLarge = "\u{f009}" + case thList = "\u{f00b}" + case theaterMasks = "\u{f630}" + case thermometer = "\u{f491}" + case thermometerEmpty = "\u{f2cb}" + case thermometerFull = "\u{f2c7}" + case thermometerHalf = "\u{f2c9}" + case thermometerQuarter = "\u{f2ca}" + case thermometerThreeQuarters = "\u{f2c8}" case thumbsDown = "\u{f165}" case thumbsUp = "\u{f164}" + case thumbtack = "\u{f08d}" + case ticketAlt = "\u{f3ff}" + case times = "\u{f00d}" case timesCircle = "\u{f057}" + case tint = "\u{f043}" + case tintSlash = "\u{f5c7}" case tired = "\u{f5c8}" + case toggleOff = "\u{f204}" + case toggleOn = "\u{f205}" + case toiletPaper = "\u{f71e}" + case toolbox = "\u{f552}" + case tooth = "\u{f5c9}" + case torah = "\u{f6a0}" + case toriiGate = "\u{f6a1}" + case tractor = "\u{f722}" + case trademark = "\u{f25c}" + case trafficLight = "\u{f637}" + case train = "\u{f238}" + case transgender = "\u{f224}" + case transgenderAlt = "\u{f225}" + case trash = "\u{f1f8}" case trashAlt = "\u{f2ed}" + case tree = "\u{f1bb}" + case trophy = "\u{f091}" + case truck = "\u{f0d1}" + case truckLoading = "\u{f4de}" + case truckMonster = "\u{f63b}" + case truckMoving = "\u{f4df}" + case truckPickup = "\u{f63c}" + case tshirt = "\u{f553}" + case tty = "\u{f1e4}" + case tv = "\u{f26c}" + case umbrella = "\u{f0e9}" + case umbrellaBeach = "\u{f5ca}" + case underline = "\u{f0cd}" + case undo = "\u{f0e2}" + case undoAlt = "\u{f2ea}" + case universalAccess = "\u{f29a}" + case university = "\u{f19c}" + case unlink = "\u{f127}" + case unlock = "\u{f09c}" + case unlockAlt = "\u{f13e}" + case upload = "\u{f093}" case user = "\u{f007}" + case userAlt = "\u{f406}" + case userAltSlash = "\u{f4fa}" + case userAstronaut = "\u{f4fb}" + case userCheck = "\u{f4fc}" case userCircle = "\u{f2bd}" + case userClock = "\u{f4fd}" + case userCog = "\u{f4fe}" + case userEdit = "\u{f4ff}" + case userFriends = "\u{f500}" + case userGraduate = "\u{f501}" + case userInjured = "\u{f728}" + case userLock = "\u{f502}" + case userMd = "\u{f0f0}" + case userMinus = "\u{f503}" + case userNinja = "\u{f504}" + case userPlus = "\u{f234}" + case userSecret = "\u{f21b}" + case userShield = "\u{f505}" + case userSlash = "\u{f506}" + case userTag = "\u{f507}" + case userTie = "\u{f508}" + case userTimes = "\u{f235}" + case users = "\u{f0c0}" + case usersCog = "\u{f509}" + case utensilSpoon = "\u{f2e5}" + case utensils = "\u{f2e7}" + case vectorSquare = "\u{f5cb}" + case venus = "\u{f221}" + case venusDouble = "\u{f226}" + case venusMars = "\u{f228}" + case vial = "\u{f492}" + case vials = "\u{f493}" + case video = "\u{f03d}" + case videoSlash = "\u{f4e2}" + case vihara = "\u{f6a7}" + case volleyballBall = "\u{f45f}" + case volumeDown = "\u{f027}" + case volumeMute = "\u{f6a9}" + case volumeOff = "\u{f026}" + case volumeUp = "\u{f028}" + case vrCardboard = "\u{f729}" + case walking = "\u{f554}" + case wallet = "\u{f555}" + case warehouse = "\u{f494}" + case weight = "\u{f496}" + case weightHanging = "\u{f5cd}" + case wheelchair = "\u{f193}" + case wifi = "\u{f1eb}" + case wind = "\u{f72e}" case windowClose = "\u{f410}" case windowMaximize = "\u{f2d0}" case windowMinimize = "\u{f2d1}" case windowRestore = "\u{f2d2}" + case wineBottle = "\u{f72f}" + case wineGlass = "\u{f4e3}" + case wineGlassAlt = "\u{f5ce}" + case wonSign = "\u{f159}" + case wrench = "\u{f0ad}" + case xRay = "\u{f497}" + case yenSign = "\u{f157}" + case yinYang = "\u{f6ad}" public var fontType: AwesomeFont { - return Awesome.Font.regular + return Awesome.Font.solid } } diff --git a/Classes/Enums/AwesomePro.swift b/Classes/Enums/AwesomePro.swift index f42c933..91f49c5 100644 --- a/Classes/Enums/AwesomePro.swift +++ b/Classes/Enums/AwesomePro.swift @@ -5,14 +5,12 @@ // Originally created by Ondrej Rafaj on 13/10/2017. // Copyright © 2017 manGoweb UK. All rights reserved. // -// This file has been auto-generated on 27/10/2018 18:12. +// This file has been auto-generated on 28/10/2018 08:25. import Foundation public struct AwesomePro { - @available(*, deprecated, renamed: "Brand") - public typealias brand = Brand public enum Brand: String, CaseIterable, Amazing { case fa500px = "\u{f26e}" case accessibleIcon = "\u{f368}" @@ -410,8 +408,6 @@ public struct AwesomePro { } } - @available(*, deprecated, renamed: "Light") - public typealias light = Light public enum Light: String, CaseIterable, Amazing { case abacus = "\u{f640}" case acorn = "\u{f6ae}" @@ -1743,8 +1739,6 @@ public struct AwesomePro { } } - @available(*, deprecated, renamed: "Solid") - public typealias solid = Solid public enum Solid: String, CaseIterable, Amazing { case abacus = "\u{f640}" case acorn = "\u{f6ae}" @@ -3076,8 +3070,6 @@ public struct AwesomePro { } } - @available(*, deprecated, renamed: "Regular") - public typealias regular = Regular public enum Regular: String, CaseIterable, Amazing { case abacus = "\u{f640}" case acorn = "\u{f6ae}" diff --git a/Classes/Extensions/Amazing+Tools.swift b/Classes/Extensions/Amazing+Tools.swift index 1d02a65..2319167 100755 --- a/Classes/Extensions/Amazing+Tools.swift +++ b/Classes/Extensions/Amazing+Tools.swift @@ -25,317 +25,90 @@ public extension Amazing { } -extension Awesome.Brand { +extension Awesome { + @available(*, deprecated, renamed: "Brand") + public typealias brand = Awesome.Brand - public var code: String { - return self.rawValue - } + @available(*, deprecated, renamed: "Regular") + public typealias regular = Awesome.Regular - public var key: String { - return String(describing: self) - } + @available(*, deprecated, renamed: "Solid") + public typealias solid = Awesome.Solid +} + +extension AwesomePro { + @available(*, deprecated, renamed: "Brand") + public typealias brand = AwesomePro.Brand - public var description: String { - return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") - } + @available(*, deprecated, renamed: "Regular") + public typealias regular = AwesomePro.Regular - public var name: String { - return self.key - } + @available(*, deprecated, renamed: "Solid") + public typealias solid = AwesomePro.Solid - public var label: String { - return self.description - } + @available(*, deprecated, renamed: "Light") + public typealias light = AwesomePro.Light +} + +extension Awesome.Brand { @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") public static var all: [Awesome.brand] { return allCases } - - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - + } extension Awesome.Regular { - public var code: String { - return self.rawValue - } - - public var key: String { - return String(describing: self) - } - - public var description: String { - return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") - } - - public var name: String { - return self.key - } - - public var label: String { - return self.description - } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") public static var all: [Awesome.regular] { return allCases } - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - } extension Awesome.Solid { - public var code: String { - return self.rawValue - } - - public var key: String { - return String(describing: self) - } - - public var description: String { - return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") - } - - public var name: String { - return self.key - } - - public var label: String { - return self.description - } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") public static var all: [Awesome.solid] { return allCases } - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - } extension AwesomePro.Brand { - public var code: String { - return self.rawValue - } - - public var key: String { - return String(describing: self) - } - - public var description: String { - return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") - } - - public var name: String { - return self.key - } - - public var label: String { - return self.description - } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") public static var all: [AwesomePro.brand] { return allCases } - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - } extension AwesomePro.Regular { - public var code: String { - return self.rawValue - } - - public var key: String { - return String(describing: self) - } - - public var description: String { - return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") - } - - public var name: String { - return self.key - } - - public var label: String { - return self.description - } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") public static var all: [AwesomePro.regular] { return allCases } - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - } extension AwesomePro.Solid { - public var code: String { - return self.rawValue - } - - public var key: String { - return String(describing: self) - } - - public var description: String { - return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") - } - - public var name: String { - return self.key - } - - public var label: String { - return self.description - } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") public static var all: [AwesomePro.solid] { return allCases } - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - } extension AwesomePro.Light { - public var code: String { - return self.rawValue - } - - public var key: String { - return String(describing: self) - } - - public var description: String { - return String(describing: self).split(separator: "-").map { $0.firstUppercased }.joined(separator: " ") - } - - public var name: String { - return self.key - } - - public var label: String { - return self.description - } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") public static var all: [AwesomePro.light] { return allCases } - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - } diff --git a/Classes/Extensions/Image+Awesome.swift b/Classes/Extensions/Image+Awesome.swift index 084ddc5..90312d2 100755 --- a/Classes/Extensions/Image+Awesome.swift +++ b/Classes/Extensions/Image+Awesome.swift @@ -16,7 +16,7 @@ import Foundation public extension Image { - public convenience init(icon: Amazing, size: CGSize, color: Color = Color.black, backgroundColor: Color = Color.clear) { + public convenience init(icon: AmazingType, size: CGSize, color: Color = .black, backgroundColor: Color = .clear) { let fontAspectRatio: CGFloat = 1.28571429 let fontSize = min(size.width / fontAspectRatio, size.height) let attributedString = NSAttributedString.awesome(icon: icon, fontSize: fontSize, color: color, backgroundColor: backgroundColor) @@ -53,14 +53,14 @@ public extension Image { #endif } - public convenience init(icon: Amazing, size: CGFloat, color: Color = Color.black, backgroundColor: Color = Color.clear) { + public convenience init(icon: AmazingType, size: CGFloat, color: Color = .black, backgroundColor: Color = .clear) { self.init(icon: icon, size: CGSize.init(width: size, height: size), color: color, backgroundColor: backgroundColor) } #if os(iOS) || os(watchOS) || os(tvOS) - public convenience init(topIcon: Amazing, bottomIcon: Amazing, topIconColor: Color = .black, bottomIconColor: Color = .black, backgroundColor: Color = .clear, size: CGSize? = nil) { + public convenience init(topIcon: AmazingType, bottomIcon: AmazingType, topIconColor: Color = .black, bottomIconColor: Color = .black, backgroundColor: Color = .clear, size: CGSize? = nil) { let bgSize: CGSize = size ?? CGSize(width: 32, height: 32) let topSize: CGSize = CGSize(width: 2 * bgSize.width, height: 2 * bgSize.height) @@ -88,5 +88,3 @@ public extension Image { #endif } - - diff --git a/Classes/Extensions/NSAttributedString+Awesome.swift b/Classes/Extensions/NSAttributedString+Awesome.swift index d2ddbf5..6f864cc 100644 --- a/Classes/Extensions/NSAttributedString+Awesome.swift +++ b/Classes/Extensions/NSAttributedString+Awesome.swift @@ -15,7 +15,7 @@ import Foundation public extension NSAttributedString { - public static func awesome(icon: Amazing, fontSize: CGFloat, color: Color = Color.black, backgroundColor: Color = Color.clear) -> NSAttributedString { + public static func awesome(icon: AmazingType, fontSize: CGFloat, color: Color = .black, backgroundColor: Color = .clear) -> NSAttributedString { Fonts.load(type: icon.fontType) guard let font = Font(name: icon.fontType.memberName, size: fontSize) else { diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index be5d0a6..fe3ff00 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -7,13 +7,10 @@ import Foundation -public protocol Amazing { +public protocol Amazing: RawRepresentable, CaseIterable where RawValue == String { - init?(rawValue: String) - var key: String { get } var description: String { get } - var rawValue: String { get } var fontType: AwesomeFont { get } static var allKeys: [String] { get } @@ -35,3 +32,64 @@ public protocol Amazing { var label: String { get } } + +extension Amazing { + + public var code: String { + return self.rawValue + } + + public var key: String { + + return String(reflecting: self) + .split(separator: ".") + .suffix(3) + .map { camelCaseToString(string: String($0), withSeparator: "-").lowercased() } + .joined(separator: ".") + + } + + public var description: String { + return camelCaseToString(string: String(describing: self)) + } + + public var name: String { + return camelCaseToString(string: String(describing: self), withSeparator: "-").lowercased() + } + + public var label: String { + return self.description + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + public static var keys: [String] { + return allKeys + } + + public static var labels: [String] { + return allDescriptions + } + + private func camelCaseToString(string: String, withSeparator: String = " ") -> String { + + let string = string.firstUppercased + let regex = try! NSRegularExpression(pattern: "([A-Z][a-z\\.]*)") + let range = NSRange(string.startIndex..., in: string) + + return regex.matches( + in: string, + options: .anchored, + range: range ) + .map { String(string[Range($0.range, in: string)!]) } + .joined(separator: withSeparator) + + } + +} diff --git a/Generator/Sources/Generator/EnumBuilder.swift b/Generator/Sources/Generator/EnumBuilder.swift index 763acd5..f85761d 100644 --- a/Generator/Sources/Generator/EnumBuilder.swift +++ b/Generator/Sources/Generator/EnumBuilder.swift @@ -12,9 +12,7 @@ func buildEnum (_ name: String, from styles: [String: [Icon]]) -> String { for (var style, list) in styles { if style == "brands" { style = "brand" } - content += "\n @available(*, deprecated, renamed: \"\(style.firstUppercased())\")" - content += "\n public typealias \(style) = \(style.firstUppercased())" - content += "\n public enum \(style.firstUppercased()): String, CaseIterable, Amazing {\n" + content += "\n public enum \(style.firstUppercased()): String, Amazing {\n" var names = [String]() for icon in list { var name = icon.name.split(separator: "-").map { $0.firstUppercased() }.joined(separator: "") From 963052fdb05bc5f3c5cff9e6569a1a7f9db0ddb1 Mon Sep 17 00:00:00 2001 From: David Walter Date: Sun, 28 Oct 2018 13:59:34 +0100 Subject: [PATCH 03/10] Make AwesomeFont a CustomStringConvertible --- Classes/Libs/Fonts.swift | 14 ++++++++++---- Classes/Protocols/AwesomeFont.swift | 5 +++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Classes/Libs/Fonts.swift b/Classes/Libs/Fonts.swift index 0dc6a0e..4178032 100644 --- a/Classes/Libs/Fonts.swift +++ b/Classes/Libs/Fonts.swift @@ -10,6 +10,12 @@ import CoreGraphics import CoreText +public extension AwesomeFont { + public var name: String { + return self.description + } +} + public extension Awesome { public enum Font: String, AwesomeFont { @@ -21,7 +27,7 @@ public extension Awesome { return rawValue } - public var name: String { + public var description: String { switch self { case .brand: return "Font Awesome 5 Brands" @@ -55,8 +61,8 @@ public extension AwesomePro { public var file: String { return rawValue } - - public var name: String { + + public var description: String { switch self { case .brand: return "Font Awesome 5 Brands" @@ -96,7 +102,7 @@ public extension AwesomePro { class Fonts { static func load(type: AwesomeFont, from bundle: Bundle? = nil) { - guard !Font.fontNames(forFamilyName: type.name).contains(type.memberName) else { + guard !Font.fontNames(forFamilyName: type.description).contains(type.memberName) else { return } diff --git a/Classes/Protocols/AwesomeFont.swift b/Classes/Protocols/AwesomeFont.swift index 05f7453..0d21940 100644 --- a/Classes/Protocols/AwesomeFont.swift +++ b/Classes/Protocols/AwesomeFont.swift @@ -7,10 +7,11 @@ import Foundation -public protocol AwesomeFont { +public protocol AwesomeFont: CustomStringConvertible { var file: String { get } - var name: String { get } var memberName: String { get } + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") + var name: String { get } } From 85d59fe1ad4f55600522c1cb34f0d95ffe37e57e Mon Sep 17 00:00:00 2001 From: David Walter Date: Sun, 28 Oct 2018 14:01:34 +0100 Subject: [PATCH 04/10] Cleanup --- AwesomeEnum.xcodeproj/project.pbxproj | 22 ++++-- Classes/Extensions/Amazing+Tools.swift | 51 ++++++++++++- Classes/Extensions/Image+Awesome.swift | 2 +- .../NSAttributedString+Awesome.swift | 6 +- Classes/Extensions/StringProtocol.swift | 21 ++++++ Classes/Protocols/Amazing.swift | 75 +------------------ 6 files changed, 94 insertions(+), 83 deletions(-) diff --git a/AwesomeEnum.xcodeproj/project.pbxproj b/AwesomeEnum.xcodeproj/project.pbxproj index a32f116..75821b3 100644 --- a/AwesomeEnum.xcodeproj/project.pbxproj +++ b/AwesomeEnum.xcodeproj/project.pbxproj @@ -40,6 +40,10 @@ 15116D6A20761F0A00BC08D3 /* Fonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15116D2B20761C3300BC08D3 /* Fonts.swift */; }; 15116D6B20761F0A00BC08D3 /* Crossplatform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15116D2C20761C3300BC08D3 /* Crossplatform.swift */; }; 15116D6C20761F0A00BC08D3 /* Amazing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15116D2E20761C3300BC08D3 /* Amazing.swift */; }; + 63202F172185E62B008928EF /* StringProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63202F162185E62B008928EF /* StringProtocol.swift */; }; + 63202F182185E62B008928EF /* StringProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63202F162185E62B008928EF /* StringProtocol.swift */; }; + 63202F192185E62B008928EF /* StringProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63202F162185E62B008928EF /* StringProtocol.swift */; }; + 63202F1A2185E62B008928EF /* StringProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63202F162185E62B008928EF /* StringProtocol.swift */; }; 639016C120F26235006F56AE /* AwesomeEnum_watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 639016BF20F26235006F56AE /* AwesomeEnum_watchOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 639016C520F2628F006F56AE /* fa-solid-900.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 15116D3020761C3300BC08D3 /* fa-solid-900.ttf */; }; 639016C620F2628F006F56AE /* fa-regular-400.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 15116D3120761C3300BC08D3 /* fa-regular-400.ttf */; }; @@ -84,6 +88,7 @@ 15116D6F2076203F00BC08D3 /* AwesomeEnum.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = AwesomeEnum.podspec; sourceTree = ""; }; 156225A9207B9FF90037CECA /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 156225AA207B9FF90037CECA /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 63202F162185E62B008928EF /* StringProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringProtocol.swift; sourceTree = ""; }; 639016BD20F26234006F56AE /* Awesome.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Awesome.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 639016BF20F26235006F56AE /* AwesomeEnum_watchOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AwesomeEnum_watchOS.h; sourceTree = ""; }; 639016C020F26235006F56AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -180,6 +185,7 @@ 15116D2720761C3300BC08D3 /* NSAttributedString+Awesome.swift */, 15116D2820761C3300BC08D3 /* Amazing+Tools.swift */, 15116D2920761C3300BC08D3 /* Image+Awesome.swift */, + 63202F162185E62B008928EF /* StringProtocol.swift */, ); path = Extensions; sourceTree = ""; @@ -466,6 +472,7 @@ 15116D3720761C3300BC08D3 /* Fonts.swift in Sources */, 15116D3920761C3300BC08D3 /* Amazing.swift in Sources */, 15116D3620761C3300BC08D3 /* Image+Awesome.swift in Sources */, + 63202F172185E62B008928EF /* StringProtocol.swift in Sources */, 15116D3820761C3300BC08D3 /* Crossplatform.swift in Sources */, 9D338AF620DA7A04001F8AEA /* AwesomePro.swift in Sources */, 9D338AFA20DA7A52001F8AEA /* AwesomeFont.swift in Sources */, @@ -482,6 +489,7 @@ 15116D6020761F0A00BC08D3 /* Fonts.swift in Sources */, 15116D6220761F0A00BC08D3 /* Amazing.swift in Sources */, 15116D5F20761F0A00BC08D3 /* Image+Awesome.swift in Sources */, + 63202F182185E62B008928EF /* StringProtocol.swift in Sources */, 15116D6120761F0A00BC08D3 /* Crossplatform.swift in Sources */, 9D338AF720DA7A04001F8AEA /* AwesomePro.swift in Sources */, 9D338AFB20DA7A52001F8AEA /* AwesomeFont.swift in Sources */, @@ -498,6 +506,7 @@ 15116D6A20761F0A00BC08D3 /* Fonts.swift in Sources */, 15116D6C20761F0A00BC08D3 /* Amazing.swift in Sources */, 15116D6920761F0A00BC08D3 /* Image+Awesome.swift in Sources */, + 63202F192185E62B008928EF /* StringProtocol.swift in Sources */, 15116D6B20761F0A00BC08D3 /* Crossplatform.swift in Sources */, 9D338AF820DA7A04001F8AEA /* AwesomePro.swift in Sources */, 9D338AFC20DA7A52001F8AEA /* AwesomeFont.swift in Sources */, @@ -514,6 +523,7 @@ 639016CC20F26298006F56AE /* Image+Awesome.swift in Sources */, 639016CB20F26298006F56AE /* Amazing+Tools.swift in Sources */, 639016CE20F2629B006F56AE /* Crossplatform.swift in Sources */, + 63202F1A2185E62B008928EF /* StringProtocol.swift in Sources */, 639016C820F26294006F56AE /* Awesome.swift in Sources */, 639016CD20F2629B006F56AE /* Fonts.swift in Sources */, 639016D020F2629F006F56AE /* AwesomeFont.swift in Sources */, @@ -718,7 +728,7 @@ PRODUCT_NAME = Awesome; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -745,7 +755,7 @@ PRODUCT_NAME = Awesome; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -769,7 +779,7 @@ PRODUCT_NAME = Awesome; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -795,7 +805,7 @@ PRODUCT_NAME = Awesome; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -823,7 +833,7 @@ PRODUCT_NAME = Awesome; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -851,7 +861,7 @@ PRODUCT_NAME = Awesome; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; diff --git a/Classes/Extensions/Amazing+Tools.swift b/Classes/Extensions/Amazing+Tools.swift index 2319167..d4a1345 100755 --- a/Classes/Extensions/Amazing+Tools.swift +++ b/Classes/Extensions/Amazing+Tools.swift @@ -20,7 +20,56 @@ public extension Amazing { } public func asAttributedText(fontSize: CGFloat, color: Color = Color.black, backgroundColor: Color = Color.clear) -> NSAttributedString { - return NSAttributedString.awesome(icon: self, fontSize: fontSize, color: color, backgroundColor: backgroundColor) + return NSAttributedString(icon: self, fontSize: fontSize, color: color, backgroundColor: backgroundColor) + } + +} + +extension Amazing { + + public var key: String { + return String(reflecting: self) + .split(separator: ".") + .suffix(3) + .map { String($0).camelCaseToString(with: "-").lowercased() } + .joined(separator: ".") + } + + public var description: String { + return String(describing: self).camelCaseToString() + } + + public static var allKeys: [String] { + return allCases.map { $0.key } + } + + public static var allDescriptions: [String] { + return allCases.map { $0.description } + } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allKeys instead") + public static var keys: [String] { + return allKeys + } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allDescriptions instead") + public static var labels: [String] { + return allDescriptions + } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .rawValue instead.") + public var code: String { + return self.rawValue + } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key instead.") + public var name: String { + return String(describing: self).camelCaseToString(with: "-").lowercased() + } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") + public var label: String { + return self.description } } diff --git a/Classes/Extensions/Image+Awesome.swift b/Classes/Extensions/Image+Awesome.swift index 90312d2..65f7a74 100755 --- a/Classes/Extensions/Image+Awesome.swift +++ b/Classes/Extensions/Image+Awesome.swift @@ -19,7 +19,7 @@ public extension Image { public convenience init(icon: AmazingType, size: CGSize, color: Color = .black, backgroundColor: Color = .clear) { let fontAspectRatio: CGFloat = 1.28571429 let fontSize = min(size.width / fontAspectRatio, size.height) - let attributedString = NSAttributedString.awesome(icon: icon, fontSize: fontSize, color: color, backgroundColor: backgroundColor) + let attributedString = NSAttributedString(icon: icon, fontSize: fontSize, color: color, backgroundColor: backgroundColor) #if os(iOS) || os(watchOS) || os(tvOS) UIGraphicsBeginImageContextWithOptions(size, false , 0.0) diff --git a/Classes/Extensions/NSAttributedString+Awesome.swift b/Classes/Extensions/NSAttributedString+Awesome.swift index 6f864cc..060c2a3 100644 --- a/Classes/Extensions/NSAttributedString+Awesome.swift +++ b/Classes/Extensions/NSAttributedString+Awesome.swift @@ -15,7 +15,7 @@ import Foundation public extension NSAttributedString { - public static func awesome(icon: AmazingType, fontSize: CGFloat, color: Color = .black, backgroundColor: Color = .clear) -> NSAttributedString { + public convenience init(icon: AmazingType, fontSize: CGFloat, color: Color = .black, backgroundColor: Color = .clear) { Fonts.load(type: icon.fontType) guard let font = Font(name: icon.fontType.memberName, size: fontSize) else { @@ -26,9 +26,7 @@ public extension NSAttributedString { paragraph.alignment = .center let attributes = [NSAttributedString.Key.font: font, .foregroundColor: color, .backgroundColor: backgroundColor, .paragraphStyle: paragraph] - let attributedString = NSAttributedString(string: icon.rawValue, attributes: attributes) - - return attributedString + self.init(string: icon.rawValue, attributes: attributes) } } diff --git a/Classes/Extensions/StringProtocol.swift b/Classes/Extensions/StringProtocol.swift index a126c3c..9daccb2 100644 --- a/Classes/Extensions/StringProtocol.swift +++ b/Classes/Extensions/StringProtocol.swift @@ -7,14 +7,35 @@ // import Foundation +#if os(iOS) || os(watchOS) || os(tvOS) + import UIKit +#elseif os(OSX) + import Cocoa +#endif extension StringProtocol { + var firstUppercased: String { guard let first = first else { return "" } return String(first).uppercased() + dropFirst() } + var firstCapitalized: String { guard let first = first else { return "" } return String(first).capitalized + dropFirst() } + + func camelCaseToString(with separator: String = " ") -> String { + let string = self.firstUppercased + let regex = try! NSRegularExpression(pattern: "([A-Z][a-z\\.]*)") + let range = NSRange(string.startIndex..., in: string) + + return regex.matches( + in: string, + options: .anchored, + range: range ) + .map { String(string[Range($0.range, in: string)!]) } + .joined(separator: separator) + } + } diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index fe3ff00..850fc71 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -12,84 +12,17 @@ public protocol Amazing: RawRepresentable, CaseIterable where RawValue == String var key: String { get } var description: String { get } var fontType: AwesomeFont { get } - + static var allKeys: [String] { get } static var allDescriptions: [String] { get } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allKeys instead") - static var keys: [String] { get } + // MARK: Deprecated - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allDescriptions instead") + static var keys: [String] { get } static var labels: [String] { get } - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .rawValue instead.") - var code: String { get } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key instead.") + var code: String { get } var name: String { get } - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") var label: String { get } } - -extension Amazing { - - public var code: String { - return self.rawValue - } - - public var key: String { - - return String(reflecting: self) - .split(separator: ".") - .suffix(3) - .map { camelCaseToString(string: String($0), withSeparator: "-").lowercased() } - .joined(separator: ".") - - } - - public var description: String { - return camelCaseToString(string: String(describing: self)) - } - - public var name: String { - return camelCaseToString(string: String(describing: self), withSeparator: "-").lowercased() - } - - public var label: String { - return self.description - } - - public static var allKeys: [String] { - return allCases.map { $0.key } - } - - public static var allDescriptions: [String] { - return allCases.map { $0.description } - } - - public static var keys: [String] { - return allKeys - } - - public static var labels: [String] { - return allDescriptions - } - - private func camelCaseToString(string: String, withSeparator: String = " ") -> String { - - let string = string.firstUppercased - let regex = try! NSRegularExpression(pattern: "([A-Z][a-z\\.]*)") - let range = NSRange(string.startIndex..., in: string) - - return regex.matches( - in: string, - options: .anchored, - range: range ) - .map { String(string[Range($0.range, in: string)!]) } - .joined(separator: withSeparator) - - } - -} From 2d740aa5b48fd887a0567810e05d3c5fdb6795a0 Mon Sep 17 00:00:00 2001 From: David Walter Date: Sun, 28 Oct 2018 14:06:01 +0100 Subject: [PATCH 05/10] Fix deprecated AwesomeFont --- Classes/Libs/Fonts.swift | 3 +++ Classes/Protocols/AwesomeFont.swift | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Libs/Fonts.swift b/Classes/Libs/Fonts.swift index 4178032..adeb665 100644 --- a/Classes/Libs/Fonts.swift +++ b/Classes/Libs/Fonts.swift @@ -11,9 +11,12 @@ import CoreText public extension AwesomeFont { + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") public var name: String { return self.description } + } public extension Awesome { diff --git a/Classes/Protocols/AwesomeFont.swift b/Classes/Protocols/AwesomeFont.swift index 0d21940..536db95 100644 --- a/Classes/Protocols/AwesomeFont.swift +++ b/Classes/Protocols/AwesomeFont.swift @@ -12,6 +12,7 @@ public protocol AwesomeFont: CustomStringConvertible { var file: String { get } var memberName: String { get } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") + // MARK: Deprecated + var name: String { get } } From 6c18d168a06922742571ee259de249e2fac546d3 Mon Sep 17 00:00:00 2001 From: Georg Date: Mon, 29 Oct 2018 12:40:33 +0000 Subject: [PATCH 06/10] Refactored PoiSelectionTableViewController with Generics --- Classes/Protocols/Amazing.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index 850fc71..1a32754 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -9,6 +9,7 @@ import Foundation public protocol Amazing: RawRepresentable, CaseIterable where RawValue == String { + // Test comment var key: String { get } var description: String { get } var fontType: AwesomeFont { get } From 5658a3197a89edfd1edc6485aaffac67d84be90a Mon Sep 17 00:00:00 2001 From: Georg Date: Mon, 29 Oct 2018 14:37:06 +0000 Subject: [PATCH 07/10] Documentation of public properties and methods; small fixed - Added documentation to all public interfaces - added .detailedKey and .allDetailedKeys to Amazing that contain a unique key with font name, style and icon name; .key now contains only the lowercased icon name - removed CaseIterable from enums as they inherit this from Amazing --- Classes/Enums/Awesome.swift | 324 +++++----- Classes/Enums/AwesomePro.swift | 808 ++++++++++++------------ Classes/Extensions/Amazing+Tools.swift | 33 +- Classes/Extensions/StringProtocol.swift | 3 + Classes/Protocols/Amazing.swift | 15 +- Classes/Protocols/AwesomeFont.swift | 3 + 6 files changed, 617 insertions(+), 569 deletions(-) diff --git a/Classes/Enums/Awesome.swift b/Classes/Enums/Awesome.swift index 04e5cb6..40d3b77 100644 --- a/Classes/Enums/Awesome.swift +++ b/Classes/Enums/Awesome.swift @@ -5,13 +5,172 @@ // Originally created by Ondrej Rafaj on 13/10/2017. // Copyright © 2017 manGoweb UK. All rights reserved. // -// This file has been auto-generated on 28/10/2018 08:25. +// This file has been auto-generated on 29/10/2018 14:17. import Foundation public struct Awesome { - public enum Brand: String, CaseIterable, Amazing { + public enum Regular: String, Amazing { + case addressBook = "\u{f2b9}" + case addressCard = "\u{f2bb}" + case angry = "\u{f556}" + case arrowAltCircleDown = "\u{f358}" + case arrowAltCircleLeft = "\u{f359}" + case arrowAltCircleRight = "\u{f35a}" + case arrowAltCircleUp = "\u{f35b}" + case bell = "\u{f0f3}" + case bellSlash = "\u{f1f6}" + case bookmark = "\u{f02e}" + case building = "\u{f1ad}" + case calendar = "\u{f133}" + case calendarAlt = "\u{f073}" + case calendarCheck = "\u{f274}" + case calendarMinus = "\u{f272}" + case calendarPlus = "\u{f271}" + case calendarTimes = "\u{f273}" + case caretSquareDown = "\u{f150}" + case caretSquareLeft = "\u{f191}" + case caretSquareRight = "\u{f152}" + case caretSquareUp = "\u{f151}" + case chartBar = "\u{f080}" + case checkCircle = "\u{f058}" + case checkSquare = "\u{f14a}" + case circle = "\u{f111}" + case clipboard = "\u{f328}" + case clock = "\u{f017}" + case clone = "\u{f24d}" + case closedCaptioning = "\u{f20a}" + case comment = "\u{f075}" + case commentAlt = "\u{f27a}" + case commentDots = "\u{f4ad}" + case comments = "\u{f086}" + case compass = "\u{f14e}" + case copy = "\u{f0c5}" + case copyright = "\u{f1f9}" + case creditCard = "\u{f09d}" + case dizzy = "\u{f567}" + case dotCircle = "\u{f192}" + case edit = "\u{f044}" + case envelope = "\u{f0e0}" + case envelopeOpen = "\u{f2b6}" + case eye = "\u{f06e}" + case eyeSlash = "\u{f070}" + case file = "\u{f15b}" + case fileAlt = "\u{f15c}" + case fileArchive = "\u{f1c6}" + case fileAudio = "\u{f1c7}" + case fileCode = "\u{f1c9}" + case fileExcel = "\u{f1c3}" + case fileImage = "\u{f1c5}" + case filePdf = "\u{f1c1}" + case filePowerpoint = "\u{f1c4}" + case fileVideo = "\u{f1c8}" + case fileWord = "\u{f1c2}" + case flag = "\u{f024}" + case flushed = "\u{f579}" + case folder = "\u{f07b}" + case folderOpen = "\u{f07c}" + case fontAwesomeLogoFull = "\u{f4e6}" + case frown = "\u{f119}" + case frownOpen = "\u{f57a}" + case futbol = "\u{f1e3}" + case gem = "\u{f3a5}" + case grimace = "\u{f57f}" + case grin = "\u{f580}" + case grinAlt = "\u{f581}" + case grinBeam = "\u{f582}" + case grinBeamSweat = "\u{f583}" + case grinHearts = "\u{f584}" + case grinSquint = "\u{f585}" + case grinSquintTears = "\u{f586}" + case grinStars = "\u{f587}" + case grinTears = "\u{f588}" + case grinTongue = "\u{f589}" + case grinTongueSquint = "\u{f58a}" + case grinTongueWink = "\u{f58b}" + case grinWink = "\u{f58c}" + case handLizard = "\u{f258}" + case handPaper = "\u{f256}" + case handPeace = "\u{f25b}" + case handPointDown = "\u{f0a7}" + case handPointLeft = "\u{f0a5}" + case handPointRight = "\u{f0a4}" + case handPointUp = "\u{f0a6}" + case handPointer = "\u{f25a}" + case handRock = "\u{f255}" + case handScissors = "\u{f257}" + case handSpock = "\u{f259}" + case handshake = "\u{f2b5}" + case hdd = "\u{f0a0}" + case heart = "\u{f004}" + case hospital = "\u{f0f8}" + case hourglass = "\u{f254}" + case idBadge = "\u{f2c1}" + case idCard = "\u{f2c2}" + case image = "\u{f03e}" + case images = "\u{f302}" + case keyboard = "\u{f11c}" + case kiss = "\u{f596}" + case kissBeam = "\u{f597}" + case kissWinkHeart = "\u{f598}" + case laugh = "\u{f599}" + case laughBeam = "\u{f59a}" + case laughSquint = "\u{f59b}" + case laughWink = "\u{f59c}" + case lemon = "\u{f094}" + case lifeRing = "\u{f1cd}" + case lightbulb = "\u{f0eb}" + case listAlt = "\u{f022}" + case map = "\u{f279}" + case meh = "\u{f11a}" + case mehBlank = "\u{f5a4}" + case mehRollingEyes = "\u{f5a5}" + case minusSquare = "\u{f146}" + case moneyBillAlt = "\u{f3d1}" + case moon = "\u{f186}" + case newspaper = "\u{f1ea}" + case objectGroup = "\u{f247}" + case objectUngroup = "\u{f248}" + case paperPlane = "\u{f1d8}" + case pauseCircle = "\u{f28b}" + case playCircle = "\u{f144}" + case plusSquare = "\u{f0fe}" + case questionCircle = "\u{f059}" + case registered = "\u{f25d}" + case sadCry = "\u{f5b3}" + case sadTear = "\u{f5b4}" + case save = "\u{f0c7}" + case shareSquare = "\u{f14d}" + case smile = "\u{f118}" + case smileBeam = "\u{f5b8}" + case smileWink = "\u{f4da}" + case snowflake = "\u{f2dc}" + case square = "\u{f0c8}" + case star = "\u{f005}" + case starHalf = "\u{f089}" + case stickyNote = "\u{f249}" + case stopCircle = "\u{f28d}" + case sun = "\u{f185}" + case surprise = "\u{f5c2}" + case thumbsDown = "\u{f165}" + case thumbsUp = "\u{f164}" + case timesCircle = "\u{f057}" + case tired = "\u{f5c8}" + case trashAlt = "\u{f2ed}" + case user = "\u{f007}" + case userCircle = "\u{f2bd}" + case windowClose = "\u{f410}" + case windowMaximize = "\u{f2d0}" + case windowMinimize = "\u{f2d1}" + case windowRestore = "\u{f2d2}" + + public var fontType: AwesomeFont { + return Awesome.Font.regular + } + } + + public enum Brand: String, Amazing { case fa500px = "\u{f26e}" case accessibleIcon = "\u{f368}" case accusoft = "\u{f369}" @@ -408,166 +567,7 @@ public struct Awesome { } } - public enum Regular: String, CaseIterable, Amazing { - case addressBook = "\u{f2b9}" - case addressCard = "\u{f2bb}" - case angry = "\u{f556}" - case arrowAltCircleDown = "\u{f358}" - case arrowAltCircleLeft = "\u{f359}" - case arrowAltCircleRight = "\u{f35a}" - case arrowAltCircleUp = "\u{f35b}" - case bell = "\u{f0f3}" - case bellSlash = "\u{f1f6}" - case bookmark = "\u{f02e}" - case building = "\u{f1ad}" - case calendar = "\u{f133}" - case calendarAlt = "\u{f073}" - case calendarCheck = "\u{f274}" - case calendarMinus = "\u{f272}" - case calendarPlus = "\u{f271}" - case calendarTimes = "\u{f273}" - case caretSquareDown = "\u{f150}" - case caretSquareLeft = "\u{f191}" - case caretSquareRight = "\u{f152}" - case caretSquareUp = "\u{f151}" - case chartBar = "\u{f080}" - case checkCircle = "\u{f058}" - case checkSquare = "\u{f14a}" - case circle = "\u{f111}" - case clipboard = "\u{f328}" - case clock = "\u{f017}" - case clone = "\u{f24d}" - case closedCaptioning = "\u{f20a}" - case comment = "\u{f075}" - case commentAlt = "\u{f27a}" - case commentDots = "\u{f4ad}" - case comments = "\u{f086}" - case compass = "\u{f14e}" - case copy = "\u{f0c5}" - case copyright = "\u{f1f9}" - case creditCard = "\u{f09d}" - case dizzy = "\u{f567}" - case dotCircle = "\u{f192}" - case edit = "\u{f044}" - case envelope = "\u{f0e0}" - case envelopeOpen = "\u{f2b6}" - case eye = "\u{f06e}" - case eyeSlash = "\u{f070}" - case file = "\u{f15b}" - case fileAlt = "\u{f15c}" - case fileArchive = "\u{f1c6}" - case fileAudio = "\u{f1c7}" - case fileCode = "\u{f1c9}" - case fileExcel = "\u{f1c3}" - case fileImage = "\u{f1c5}" - case filePdf = "\u{f1c1}" - case filePowerpoint = "\u{f1c4}" - case fileVideo = "\u{f1c8}" - case fileWord = "\u{f1c2}" - case flag = "\u{f024}" - case flushed = "\u{f579}" - case folder = "\u{f07b}" - case folderOpen = "\u{f07c}" - case fontAwesomeLogoFull = "\u{f4e6}" - case frown = "\u{f119}" - case frownOpen = "\u{f57a}" - case futbol = "\u{f1e3}" - case gem = "\u{f3a5}" - case grimace = "\u{f57f}" - case grin = "\u{f580}" - case grinAlt = "\u{f581}" - case grinBeam = "\u{f582}" - case grinBeamSweat = "\u{f583}" - case grinHearts = "\u{f584}" - case grinSquint = "\u{f585}" - case grinSquintTears = "\u{f586}" - case grinStars = "\u{f587}" - case grinTears = "\u{f588}" - case grinTongue = "\u{f589}" - case grinTongueSquint = "\u{f58a}" - case grinTongueWink = "\u{f58b}" - case grinWink = "\u{f58c}" - case handLizard = "\u{f258}" - case handPaper = "\u{f256}" - case handPeace = "\u{f25b}" - case handPointDown = "\u{f0a7}" - case handPointLeft = "\u{f0a5}" - case handPointRight = "\u{f0a4}" - case handPointUp = "\u{f0a6}" - case handPointer = "\u{f25a}" - case handRock = "\u{f255}" - case handScissors = "\u{f257}" - case handSpock = "\u{f259}" - case handshake = "\u{f2b5}" - case hdd = "\u{f0a0}" - case heart = "\u{f004}" - case hospital = "\u{f0f8}" - case hourglass = "\u{f254}" - case idBadge = "\u{f2c1}" - case idCard = "\u{f2c2}" - case image = "\u{f03e}" - case images = "\u{f302}" - case keyboard = "\u{f11c}" - case kiss = "\u{f596}" - case kissBeam = "\u{f597}" - case kissWinkHeart = "\u{f598}" - case laugh = "\u{f599}" - case laughBeam = "\u{f59a}" - case laughSquint = "\u{f59b}" - case laughWink = "\u{f59c}" - case lemon = "\u{f094}" - case lifeRing = "\u{f1cd}" - case lightbulb = "\u{f0eb}" - case listAlt = "\u{f022}" - case map = "\u{f279}" - case meh = "\u{f11a}" - case mehBlank = "\u{f5a4}" - case mehRollingEyes = "\u{f5a5}" - case minusSquare = "\u{f146}" - case moneyBillAlt = "\u{f3d1}" - case moon = "\u{f186}" - case newspaper = "\u{f1ea}" - case objectGroup = "\u{f247}" - case objectUngroup = "\u{f248}" - case paperPlane = "\u{f1d8}" - case pauseCircle = "\u{f28b}" - case playCircle = "\u{f144}" - case plusSquare = "\u{f0fe}" - case questionCircle = "\u{f059}" - case registered = "\u{f25d}" - case sadCry = "\u{f5b3}" - case sadTear = "\u{f5b4}" - case save = "\u{f0c7}" - case shareSquare = "\u{f14d}" - case smile = "\u{f118}" - case smileBeam = "\u{f5b8}" - case smileWink = "\u{f4da}" - case snowflake = "\u{f2dc}" - case square = "\u{f0c8}" - case star = "\u{f005}" - case starHalf = "\u{f089}" - case stickyNote = "\u{f249}" - case stopCircle = "\u{f28d}" - case sun = "\u{f185}" - case surprise = "\u{f5c2}" - case thumbsDown = "\u{f165}" - case thumbsUp = "\u{f164}" - case timesCircle = "\u{f057}" - case tired = "\u{f5c8}" - case trashAlt = "\u{f2ed}" - case user = "\u{f007}" - case userCircle = "\u{f2bd}" - case windowClose = "\u{f410}" - case windowMaximize = "\u{f2d0}" - case windowMinimize = "\u{f2d1}" - case windowRestore = "\u{f2d2}" - - public var fontType: AwesomeFont { - return Awesome.Font.regular - } - } - - public enum Solid: String, CaseIterable, Amazing { + public enum Solid: String, Amazing { case ad = "\u{f641}" case addressBook = "\u{f2b9}" case addressCard = "\u{f2bb}" diff --git a/Classes/Enums/AwesomePro.swift b/Classes/Enums/AwesomePro.swift index 91f49c5..760ba26 100644 --- a/Classes/Enums/AwesomePro.swift +++ b/Classes/Enums/AwesomePro.swift @@ -5,410 +5,13 @@ // Originally created by Ondrej Rafaj on 13/10/2017. // Copyright © 2017 manGoweb UK. All rights reserved. // -// This file has been auto-generated on 28/10/2018 08:25. +// This file has been auto-generated on 29/10/2018 14:17. import Foundation public struct AwesomePro { - public enum Brand: String, CaseIterable, Amazing { - case fa500px = "\u{f26e}" - case accessibleIcon = "\u{f368}" - case accusoft = "\u{f369}" - case acquisitionsIncorporated = "\u{f6af}" - case adn = "\u{f170}" - case adversal = "\u{f36a}" - case affiliatetheme = "\u{f36b}" - case algolia = "\u{f36c}" - case alipay = "\u{f642}" - case amazon = "\u{f270}" - case amazonPay = "\u{f42c}" - case amilia = "\u{f36d}" - case android = "\u{f17b}" - case angellist = "\u{f209}" - case angrycreative = "\u{f36e}" - case angular = "\u{f420}" - case appStore = "\u{f36f}" - case appStoreIos = "\u{f370}" - case apper = "\u{f371}" - case apple = "\u{f179}" - case applePay = "\u{f415}" - case asymmetrik = "\u{f372}" - case audible = "\u{f373}" - case autoprefixer = "\u{f41c}" - case avianex = "\u{f374}" - case aviato = "\u{f421}" - case aws = "\u{f375}" - case bandcamp = "\u{f2d5}" - case behance = "\u{f1b4}" - case behanceSquare = "\u{f1b5}" - case bimobject = "\u{f378}" - case bitbucket = "\u{f171}" - case bitcoin = "\u{f379}" - case bity = "\u{f37a}" - case blackTie = "\u{f27e}" - case blackberry = "\u{f37b}" - case blogger = "\u{f37c}" - case bloggerB = "\u{f37d}" - case bluetooth = "\u{f293}" - case bluetoothB = "\u{f294}" - case btc = "\u{f15a}" - case buromobelexperte = "\u{f37f}" - case buysellads = "\u{f20d}" - case ccAmazonPay = "\u{f42d}" - case ccAmex = "\u{f1f3}" - case ccApplePay = "\u{f416}" - case ccDinersClub = "\u{f24c}" - case ccDiscover = "\u{f1f2}" - case ccJcb = "\u{f24b}" - case ccMastercard = "\u{f1f1}" - case ccPaypal = "\u{f1f4}" - case ccStripe = "\u{f1f5}" - case ccVisa = "\u{f1f0}" - case centercode = "\u{f380}" - case chrome = "\u{f268}" - case cloudscale = "\u{f383}" - case cloudsmith = "\u{f384}" - case cloudversify = "\u{f385}" - case codepen = "\u{f1cb}" - case codiepie = "\u{f284}" - case connectdevelop = "\u{f20e}" - case contao = "\u{f26d}" - case cpanel = "\u{f388}" - case creativeCommons = "\u{f25e}" - case creativeCommonsBy = "\u{f4e7}" - case creativeCommonsNc = "\u{f4e8}" - case creativeCommonsNcEu = "\u{f4e9}" - case creativeCommonsNcJp = "\u{f4ea}" - case creativeCommonsNd = "\u{f4eb}" - case creativeCommonsPd = "\u{f4ec}" - case creativeCommonsPdAlt = "\u{f4ed}" - case creativeCommonsRemix = "\u{f4ee}" - case creativeCommonsSa = "\u{f4ef}" - case creativeCommonsSampling = "\u{f4f0}" - case creativeCommonsSamplingPlus = "\u{f4f1}" - case creativeCommonsShare = "\u{f4f2}" - case creativeCommonsZero = "\u{f4f3}" - case criticalRole = "\u{f6c9}" - case css3 = "\u{f13c}" - case css3Alt = "\u{f38b}" - case cuttlefish = "\u{f38c}" - case dAndD = "\u{f38d}" - case dAndDBeyond = "\u{f6ca}" - case dashcube = "\u{f210}" - case delicious = "\u{f1a5}" - case deploydog = "\u{f38e}" - case deskpro = "\u{f38f}" - case dev = "\u{f6cc}" - case deviantart = "\u{f1bd}" - case digg = "\u{f1a6}" - case digitalOcean = "\u{f391}" - case discord = "\u{f392}" - case discourse = "\u{f393}" - case dochub = "\u{f394}" - case docker = "\u{f395}" - case draft2digital = "\u{f396}" - case dribbble = "\u{f17d}" - case dribbbleSquare = "\u{f397}" - case dropbox = "\u{f16b}" - case drupal = "\u{f1a9}" - case dyalog = "\u{f399}" - case earlybirds = "\u{f39a}" - case ebay = "\u{f4f4}" - case edge = "\u{f282}" - case elementor = "\u{f430}" - case ello = "\u{f5f1}" - case ember = "\u{f423}" - case empire = "\u{f1d1}" - case envira = "\u{f299}" - case erlang = "\u{f39d}" - case ethereum = "\u{f42e}" - case etsy = "\u{f2d7}" - case expeditedssl = "\u{f23e}" - case facebook = "\u{f09a}" - case facebookF = "\u{f39e}" - case facebookMessenger = "\u{f39f}" - case facebookSquare = "\u{f082}" - case fantasyFlightGames = "\u{f6dc}" - case firefox = "\u{f269}" - case firstOrder = "\u{f2b0}" - case firstOrderAlt = "\u{f50a}" - case firstdraft = "\u{f3a1}" - case flickr = "\u{f16e}" - case flipboard = "\u{f44d}" - case fly = "\u{f417}" - case fontAwesome = "\u{f2b4}" - case fontAwesomeAlt = "\u{f35c}" - case fontAwesomeFlag = "\u{f425}" - case fontAwesomeLogoFull = "\u{f4e6}" - case fonticons = "\u{f280}" - case fonticonsFi = "\u{f3a2}" - case fortAwesome = "\u{f286}" - case fortAwesomeAlt = "\u{f3a3}" - case forumbee = "\u{f211}" - case foursquare = "\u{f180}" - case freeCodeCamp = "\u{f2c5}" - case freebsd = "\u{f3a4}" - case fulcrum = "\u{f50b}" - case galacticRepublic = "\u{f50c}" - case galacticSenate = "\u{f50d}" - case getPocket = "\u{f265}" - case gg = "\u{f260}" - case ggCircle = "\u{f261}" - case git = "\u{f1d3}" - case gitSquare = "\u{f1d2}" - case github = "\u{f09b}" - case githubAlt = "\u{f113}" - case githubSquare = "\u{f092}" - case gitkraken = "\u{f3a6}" - case gitlab = "\u{f296}" - case gitter = "\u{f426}" - case glide = "\u{f2a5}" - case glideG = "\u{f2a6}" - case gofore = "\u{f3a7}" - case goodreads = "\u{f3a8}" - case goodreadsG = "\u{f3a9}" - case google = "\u{f1a0}" - case googleDrive = "\u{f3aa}" - case googlePlay = "\u{f3ab}" - case googlePlus = "\u{f2b3}" - case googlePlusG = "\u{f0d5}" - case googlePlusSquare = "\u{f0d4}" - case googleWallet = "\u{f1ee}" - case gratipay = "\u{f184}" - case grav = "\u{f2d6}" - case gripfire = "\u{f3ac}" - case grunt = "\u{f3ad}" - case gulp = "\u{f3ae}" - case hackerNews = "\u{f1d4}" - case hackerNewsSquare = "\u{f3af}" - case hackerrank = "\u{f5f7}" - case hips = "\u{f452}" - case hireAHelper = "\u{f3b0}" - case hooli = "\u{f427}" - case hornbill = "\u{f592}" - case hotjar = "\u{f3b1}" - case houzz = "\u{f27c}" - case html5 = "\u{f13b}" - case hubspot = "\u{f3b2}" - case imdb = "\u{f2d8}" - case instagram = "\u{f16d}" - case internetExplorer = "\u{f26b}" - case ioxhost = "\u{f208}" - case itunes = "\u{f3b4}" - case itunesNote = "\u{f3b5}" - case java = "\u{f4e4}" - case jediOrder = "\u{f50e}" - case jenkins = "\u{f3b6}" - case joget = "\u{f3b7}" - case joomla = "\u{f1aa}" - case js = "\u{f3b8}" - case jsSquare = "\u{f3b9}" - case jsfiddle = "\u{f1cc}" - case kaggle = "\u{f5fa}" - case keybase = "\u{f4f5}" - case keycdn = "\u{f3ba}" - case kickstarter = "\u{f3bb}" - case kickstarterK = "\u{f3bc}" - case korvue = "\u{f42f}" - case laravel = "\u{f3bd}" - case lastfm = "\u{f202}" - case lastfmSquare = "\u{f203}" - case leanpub = "\u{f212}" - case less = "\u{f41d}" - case line = "\u{f3c0}" - case linkedin = "\u{f08c}" - case linkedinIn = "\u{f0e1}" - case linode = "\u{f2b8}" - case linux = "\u{f17c}" - case lyft = "\u{f3c3}" - case magento = "\u{f3c4}" - case mailchimp = "\u{f59e}" - case mandalorian = "\u{f50f}" - case markdown = "\u{f60f}" - case mastodon = "\u{f4f6}" - case maxcdn = "\u{f136}" - case medapps = "\u{f3c6}" - case medium = "\u{f23a}" - case mediumM = "\u{f3c7}" - case medrt = "\u{f3c8}" - case meetup = "\u{f2e0}" - case megaport = "\u{f5a3}" - case microsoft = "\u{f3ca}" - case mix = "\u{f3cb}" - case mixcloud = "\u{f289}" - case mizuni = "\u{f3cc}" - case modx = "\u{f285}" - case monero = "\u{f3d0}" - case napster = "\u{f3d2}" - case neos = "\u{f612}" - case nimblr = "\u{f5a8}" - case nintendoSwitch = "\u{f418}" - case node = "\u{f419}" - case nodeJs = "\u{f3d3}" - case npm = "\u{f3d4}" - case ns8 = "\u{f3d5}" - case nutritionix = "\u{f3d6}" - case odnoklassniki = "\u{f263}" - case odnoklassnikiSquare = "\u{f264}" - case oldRepublic = "\u{f510}" - case opencart = "\u{f23d}" - case openid = "\u{f19b}" - case opera = "\u{f26a}" - case optinMonster = "\u{f23c}" - case osi = "\u{f41a}" - case page4 = "\u{f3d7}" - case pagelines = "\u{f18c}" - case palfed = "\u{f3d8}" - case patreon = "\u{f3d9}" - case paypal = "\u{f1ed}" - case pennyArcade = "\u{f704}" - case periscope = "\u{f3da}" - case phabricator = "\u{f3db}" - case phoenixFramework = "\u{f3dc}" - case phoenixSquadron = "\u{f511}" - case php = "\u{f457}" - case piedPiper = "\u{f2ae}" - case piedPiperAlt = "\u{f1a8}" - case piedPiperHat = "\u{f4e5}" - case piedPiperPp = "\u{f1a7}" - case pinterest = "\u{f0d2}" - case pinterestP = "\u{f231}" - case pinterestSquare = "\u{f0d3}" - case playstation = "\u{f3df}" - case productHunt = "\u{f288}" - case pushed = "\u{f3e1}" - case python = "\u{f3e2}" - case qq = "\u{f1d6}" - case quinscape = "\u{f459}" - case quora = "\u{f2c4}" - case rProject = "\u{f4f7}" - case ravelry = "\u{f2d9}" - case react = "\u{f41b}" - case readme = "\u{f4d5}" - case rebel = "\u{f1d0}" - case redRiver = "\u{f3e3}" - case reddit = "\u{f1a1}" - case redditAlien = "\u{f281}" - case redditSquare = "\u{f1a2}" - case renren = "\u{f18b}" - case replyd = "\u{f3e6}" - case researchgate = "\u{f4f8}" - case resolving = "\u{f3e7}" - case rev = "\u{f5b2}" - case rocketchat = "\u{f3e8}" - case rockrms = "\u{f3e9}" - case safari = "\u{f267}" - case sass = "\u{f41e}" - case schlix = "\u{f3ea}" - case scribd = "\u{f28a}" - case searchengin = "\u{f3eb}" - case sellcast = "\u{f2da}" - case sellsy = "\u{f213}" - case servicestack = "\u{f3ec}" - case shirtsinbulk = "\u{f214}" - case shopware = "\u{f5b5}" - case simplybuilt = "\u{f215}" - case sistrix = "\u{f3ee}" - case sith = "\u{f512}" - case skyatlas = "\u{f216}" - case skype = "\u{f17e}" - case slack = "\u{f198}" - case slackHash = "\u{f3ef}" - case slideshare = "\u{f1e7}" - case snapchat = "\u{f2ab}" - case snapchatGhost = "\u{f2ac}" - case snapchatSquare = "\u{f2ad}" - case soundcloud = "\u{f1be}" - case speakap = "\u{f3f3}" - case spotify = "\u{f1bc}" - case squarespace = "\u{f5be}" - case stackExchange = "\u{f18d}" - case stackOverflow = "\u{f16c}" - case staylinked = "\u{f3f5}" - case steam = "\u{f1b6}" - case steamSquare = "\u{f1b7}" - case steamSymbol = "\u{f3f6}" - case stickerMule = "\u{f3f7}" - case strava = "\u{f428}" - case stripe = "\u{f429}" - case stripeS = "\u{f42a}" - case studiovinari = "\u{f3f8}" - case stumbleupon = "\u{f1a4}" - case stumbleuponCircle = "\u{f1a3}" - case superpowers = "\u{f2dd}" - case supple = "\u{f3f9}" - case teamspeak = "\u{f4f9}" - case telegram = "\u{f2c6}" - case telegramPlane = "\u{f3fe}" - case tencentWeibo = "\u{f1d5}" - case theRedYeti = "\u{f69d}" - case themeco = "\u{f5c6}" - case themeisle = "\u{f2b2}" - case thinkPeaks = "\u{f731}" - case tradeFederation = "\u{f513}" - case trello = "\u{f181}" - case tripadvisor = "\u{f262}" - case tumblr = "\u{f173}" - case tumblrSquare = "\u{f174}" - case twitch = "\u{f1e8}" - case twitter = "\u{f099}" - case twitterSquare = "\u{f081}" - case typo3 = "\u{f42b}" - case uber = "\u{f402}" - case uikit = "\u{f403}" - case uniregistry = "\u{f404}" - case untappd = "\u{f405}" - case usb = "\u{f287}" - case ussunnah = "\u{f407}" - case vaadin = "\u{f408}" - case viacoin = "\u{f237}" - case viadeo = "\u{f2a9}" - case viadeoSquare = "\u{f2aa}" - case viber = "\u{f409}" - case vimeo = "\u{f40a}" - case vimeoSquare = "\u{f194}" - case vimeoV = "\u{f27d}" - case vine = "\u{f1ca}" - case vk = "\u{f189}" - case vnv = "\u{f40b}" - case vuejs = "\u{f41f}" - case weebly = "\u{f5cc}" - case weibo = "\u{f18a}" - case weixin = "\u{f1d7}" - case whatsapp = "\u{f232}" - case whatsappSquare = "\u{f40c}" - case whmcs = "\u{f40d}" - case wikipediaW = "\u{f266}" - case windows = "\u{f17a}" - case wix = "\u{f5cf}" - case wizardsOfTheCoast = "\u{f730}" - case wolfPackBattalion = "\u{f514}" - case wordpress = "\u{f19a}" - case wordpressSimple = "\u{f411}" - case wpbeginner = "\u{f297}" - case wpexplorer = "\u{f2de}" - case wpforms = "\u{f298}" - case wpressr = "\u{f3e4}" - case xbox = "\u{f412}" - case xing = "\u{f168}" - case xingSquare = "\u{f169}" - case yCombinator = "\u{f23b}" - case yahoo = "\u{f19e}" - case yandex = "\u{f413}" - case yandexInternational = "\u{f414}" - case yelp = "\u{f1e9}" - case yoast = "\u{f2b1}" - case youtube = "\u{f167}" - case youtubeSquare = "\u{f431}" - case zhihu = "\u{f63f}" - - public var fontType: AwesomeFont { - return AwesomePro.Font.brand - } - } - - public enum Light: String, CaseIterable, Amazing { + public enum Solid: String, Amazing { case abacus = "\u{f640}" case acorn = "\u{f6ae}" case ad = "\u{f641}" @@ -1735,11 +1338,11 @@ public struct AwesomePro { case yinYang = "\u{f6ad}" public var fontType: AwesomeFont { - return AwesomePro.Font.light + return AwesomePro.Font.solid } } - public enum Solid: String, CaseIterable, Amazing { + public enum Light: String, Amazing { case abacus = "\u{f640}" case acorn = "\u{f6ae}" case ad = "\u{f641}" @@ -3066,11 +2669,11 @@ public struct AwesomePro { case yinYang = "\u{f6ad}" public var fontType: AwesomeFont { - return AwesomePro.Font.solid + return AwesomePro.Font.light } } - public enum Regular: String, CaseIterable, Amazing { + public enum Regular: String, Amazing { case abacus = "\u{f640}" case acorn = "\u{f6ae}" case ad = "\u{f641}" @@ -4397,7 +4000,404 @@ public struct AwesomePro { case yinYang = "\u{f6ad}" public var fontType: AwesomeFont { - return AwesomePro.Font.regular + return AwesomePro.Font.regular + } + } + + public enum Brand: String, Amazing { + case fa500px = "\u{f26e}" + case accessibleIcon = "\u{f368}" + case accusoft = "\u{f369}" + case acquisitionsIncorporated = "\u{f6af}" + case adn = "\u{f170}" + case adversal = "\u{f36a}" + case affiliatetheme = "\u{f36b}" + case algolia = "\u{f36c}" + case alipay = "\u{f642}" + case amazon = "\u{f270}" + case amazonPay = "\u{f42c}" + case amilia = "\u{f36d}" + case android = "\u{f17b}" + case angellist = "\u{f209}" + case angrycreative = "\u{f36e}" + case angular = "\u{f420}" + case appStore = "\u{f36f}" + case appStoreIos = "\u{f370}" + case apper = "\u{f371}" + case apple = "\u{f179}" + case applePay = "\u{f415}" + case asymmetrik = "\u{f372}" + case audible = "\u{f373}" + case autoprefixer = "\u{f41c}" + case avianex = "\u{f374}" + case aviato = "\u{f421}" + case aws = "\u{f375}" + case bandcamp = "\u{f2d5}" + case behance = "\u{f1b4}" + case behanceSquare = "\u{f1b5}" + case bimobject = "\u{f378}" + case bitbucket = "\u{f171}" + case bitcoin = "\u{f379}" + case bity = "\u{f37a}" + case blackTie = "\u{f27e}" + case blackberry = "\u{f37b}" + case blogger = "\u{f37c}" + case bloggerB = "\u{f37d}" + case bluetooth = "\u{f293}" + case bluetoothB = "\u{f294}" + case btc = "\u{f15a}" + case buromobelexperte = "\u{f37f}" + case buysellads = "\u{f20d}" + case ccAmazonPay = "\u{f42d}" + case ccAmex = "\u{f1f3}" + case ccApplePay = "\u{f416}" + case ccDinersClub = "\u{f24c}" + case ccDiscover = "\u{f1f2}" + case ccJcb = "\u{f24b}" + case ccMastercard = "\u{f1f1}" + case ccPaypal = "\u{f1f4}" + case ccStripe = "\u{f1f5}" + case ccVisa = "\u{f1f0}" + case centercode = "\u{f380}" + case chrome = "\u{f268}" + case cloudscale = "\u{f383}" + case cloudsmith = "\u{f384}" + case cloudversify = "\u{f385}" + case codepen = "\u{f1cb}" + case codiepie = "\u{f284}" + case connectdevelop = "\u{f20e}" + case contao = "\u{f26d}" + case cpanel = "\u{f388}" + case creativeCommons = "\u{f25e}" + case creativeCommonsBy = "\u{f4e7}" + case creativeCommonsNc = "\u{f4e8}" + case creativeCommonsNcEu = "\u{f4e9}" + case creativeCommonsNcJp = "\u{f4ea}" + case creativeCommonsNd = "\u{f4eb}" + case creativeCommonsPd = "\u{f4ec}" + case creativeCommonsPdAlt = "\u{f4ed}" + case creativeCommonsRemix = "\u{f4ee}" + case creativeCommonsSa = "\u{f4ef}" + case creativeCommonsSampling = "\u{f4f0}" + case creativeCommonsSamplingPlus = "\u{f4f1}" + case creativeCommonsShare = "\u{f4f2}" + case creativeCommonsZero = "\u{f4f3}" + case criticalRole = "\u{f6c9}" + case css3 = "\u{f13c}" + case css3Alt = "\u{f38b}" + case cuttlefish = "\u{f38c}" + case dAndD = "\u{f38d}" + case dAndDBeyond = "\u{f6ca}" + case dashcube = "\u{f210}" + case delicious = "\u{f1a5}" + case deploydog = "\u{f38e}" + case deskpro = "\u{f38f}" + case dev = "\u{f6cc}" + case deviantart = "\u{f1bd}" + case digg = "\u{f1a6}" + case digitalOcean = "\u{f391}" + case discord = "\u{f392}" + case discourse = "\u{f393}" + case dochub = "\u{f394}" + case docker = "\u{f395}" + case draft2digital = "\u{f396}" + case dribbble = "\u{f17d}" + case dribbbleSquare = "\u{f397}" + case dropbox = "\u{f16b}" + case drupal = "\u{f1a9}" + case dyalog = "\u{f399}" + case earlybirds = "\u{f39a}" + case ebay = "\u{f4f4}" + case edge = "\u{f282}" + case elementor = "\u{f430}" + case ello = "\u{f5f1}" + case ember = "\u{f423}" + case empire = "\u{f1d1}" + case envira = "\u{f299}" + case erlang = "\u{f39d}" + case ethereum = "\u{f42e}" + case etsy = "\u{f2d7}" + case expeditedssl = "\u{f23e}" + case facebook = "\u{f09a}" + case facebookF = "\u{f39e}" + case facebookMessenger = "\u{f39f}" + case facebookSquare = "\u{f082}" + case fantasyFlightGames = "\u{f6dc}" + case firefox = "\u{f269}" + case firstOrder = "\u{f2b0}" + case firstOrderAlt = "\u{f50a}" + case firstdraft = "\u{f3a1}" + case flickr = "\u{f16e}" + case flipboard = "\u{f44d}" + case fly = "\u{f417}" + case fontAwesome = "\u{f2b4}" + case fontAwesomeAlt = "\u{f35c}" + case fontAwesomeFlag = "\u{f425}" + case fontAwesomeLogoFull = "\u{f4e6}" + case fonticons = "\u{f280}" + case fonticonsFi = "\u{f3a2}" + case fortAwesome = "\u{f286}" + case fortAwesomeAlt = "\u{f3a3}" + case forumbee = "\u{f211}" + case foursquare = "\u{f180}" + case freeCodeCamp = "\u{f2c5}" + case freebsd = "\u{f3a4}" + case fulcrum = "\u{f50b}" + case galacticRepublic = "\u{f50c}" + case galacticSenate = "\u{f50d}" + case getPocket = "\u{f265}" + case gg = "\u{f260}" + case ggCircle = "\u{f261}" + case git = "\u{f1d3}" + case gitSquare = "\u{f1d2}" + case github = "\u{f09b}" + case githubAlt = "\u{f113}" + case githubSquare = "\u{f092}" + case gitkraken = "\u{f3a6}" + case gitlab = "\u{f296}" + case gitter = "\u{f426}" + case glide = "\u{f2a5}" + case glideG = "\u{f2a6}" + case gofore = "\u{f3a7}" + case goodreads = "\u{f3a8}" + case goodreadsG = "\u{f3a9}" + case google = "\u{f1a0}" + case googleDrive = "\u{f3aa}" + case googlePlay = "\u{f3ab}" + case googlePlus = "\u{f2b3}" + case googlePlusG = "\u{f0d5}" + case googlePlusSquare = "\u{f0d4}" + case googleWallet = "\u{f1ee}" + case gratipay = "\u{f184}" + case grav = "\u{f2d6}" + case gripfire = "\u{f3ac}" + case grunt = "\u{f3ad}" + case gulp = "\u{f3ae}" + case hackerNews = "\u{f1d4}" + case hackerNewsSquare = "\u{f3af}" + case hackerrank = "\u{f5f7}" + case hips = "\u{f452}" + case hireAHelper = "\u{f3b0}" + case hooli = "\u{f427}" + case hornbill = "\u{f592}" + case hotjar = "\u{f3b1}" + case houzz = "\u{f27c}" + case html5 = "\u{f13b}" + case hubspot = "\u{f3b2}" + case imdb = "\u{f2d8}" + case instagram = "\u{f16d}" + case internetExplorer = "\u{f26b}" + case ioxhost = "\u{f208}" + case itunes = "\u{f3b4}" + case itunesNote = "\u{f3b5}" + case java = "\u{f4e4}" + case jediOrder = "\u{f50e}" + case jenkins = "\u{f3b6}" + case joget = "\u{f3b7}" + case joomla = "\u{f1aa}" + case js = "\u{f3b8}" + case jsSquare = "\u{f3b9}" + case jsfiddle = "\u{f1cc}" + case kaggle = "\u{f5fa}" + case keybase = "\u{f4f5}" + case keycdn = "\u{f3ba}" + case kickstarter = "\u{f3bb}" + case kickstarterK = "\u{f3bc}" + case korvue = "\u{f42f}" + case laravel = "\u{f3bd}" + case lastfm = "\u{f202}" + case lastfmSquare = "\u{f203}" + case leanpub = "\u{f212}" + case less = "\u{f41d}" + case line = "\u{f3c0}" + case linkedin = "\u{f08c}" + case linkedinIn = "\u{f0e1}" + case linode = "\u{f2b8}" + case linux = "\u{f17c}" + case lyft = "\u{f3c3}" + case magento = "\u{f3c4}" + case mailchimp = "\u{f59e}" + case mandalorian = "\u{f50f}" + case markdown = "\u{f60f}" + case mastodon = "\u{f4f6}" + case maxcdn = "\u{f136}" + case medapps = "\u{f3c6}" + case medium = "\u{f23a}" + case mediumM = "\u{f3c7}" + case medrt = "\u{f3c8}" + case meetup = "\u{f2e0}" + case megaport = "\u{f5a3}" + case microsoft = "\u{f3ca}" + case mix = "\u{f3cb}" + case mixcloud = "\u{f289}" + case mizuni = "\u{f3cc}" + case modx = "\u{f285}" + case monero = "\u{f3d0}" + case napster = "\u{f3d2}" + case neos = "\u{f612}" + case nimblr = "\u{f5a8}" + case nintendoSwitch = "\u{f418}" + case node = "\u{f419}" + case nodeJs = "\u{f3d3}" + case npm = "\u{f3d4}" + case ns8 = "\u{f3d5}" + case nutritionix = "\u{f3d6}" + case odnoklassniki = "\u{f263}" + case odnoklassnikiSquare = "\u{f264}" + case oldRepublic = "\u{f510}" + case opencart = "\u{f23d}" + case openid = "\u{f19b}" + case opera = "\u{f26a}" + case optinMonster = "\u{f23c}" + case osi = "\u{f41a}" + case page4 = "\u{f3d7}" + case pagelines = "\u{f18c}" + case palfed = "\u{f3d8}" + case patreon = "\u{f3d9}" + case paypal = "\u{f1ed}" + case pennyArcade = "\u{f704}" + case periscope = "\u{f3da}" + case phabricator = "\u{f3db}" + case phoenixFramework = "\u{f3dc}" + case phoenixSquadron = "\u{f511}" + case php = "\u{f457}" + case piedPiper = "\u{f2ae}" + case piedPiperAlt = "\u{f1a8}" + case piedPiperHat = "\u{f4e5}" + case piedPiperPp = "\u{f1a7}" + case pinterest = "\u{f0d2}" + case pinterestP = "\u{f231}" + case pinterestSquare = "\u{f0d3}" + case playstation = "\u{f3df}" + case productHunt = "\u{f288}" + case pushed = "\u{f3e1}" + case python = "\u{f3e2}" + case qq = "\u{f1d6}" + case quinscape = "\u{f459}" + case quora = "\u{f2c4}" + case rProject = "\u{f4f7}" + case ravelry = "\u{f2d9}" + case react = "\u{f41b}" + case readme = "\u{f4d5}" + case rebel = "\u{f1d0}" + case redRiver = "\u{f3e3}" + case reddit = "\u{f1a1}" + case redditAlien = "\u{f281}" + case redditSquare = "\u{f1a2}" + case renren = "\u{f18b}" + case replyd = "\u{f3e6}" + case researchgate = "\u{f4f8}" + case resolving = "\u{f3e7}" + case rev = "\u{f5b2}" + case rocketchat = "\u{f3e8}" + case rockrms = "\u{f3e9}" + case safari = "\u{f267}" + case sass = "\u{f41e}" + case schlix = "\u{f3ea}" + case scribd = "\u{f28a}" + case searchengin = "\u{f3eb}" + case sellcast = "\u{f2da}" + case sellsy = "\u{f213}" + case servicestack = "\u{f3ec}" + case shirtsinbulk = "\u{f214}" + case shopware = "\u{f5b5}" + case simplybuilt = "\u{f215}" + case sistrix = "\u{f3ee}" + case sith = "\u{f512}" + case skyatlas = "\u{f216}" + case skype = "\u{f17e}" + case slack = "\u{f198}" + case slackHash = "\u{f3ef}" + case slideshare = "\u{f1e7}" + case snapchat = "\u{f2ab}" + case snapchatGhost = "\u{f2ac}" + case snapchatSquare = "\u{f2ad}" + case soundcloud = "\u{f1be}" + case speakap = "\u{f3f3}" + case spotify = "\u{f1bc}" + case squarespace = "\u{f5be}" + case stackExchange = "\u{f18d}" + case stackOverflow = "\u{f16c}" + case staylinked = "\u{f3f5}" + case steam = "\u{f1b6}" + case steamSquare = "\u{f1b7}" + case steamSymbol = "\u{f3f6}" + case stickerMule = "\u{f3f7}" + case strava = "\u{f428}" + case stripe = "\u{f429}" + case stripeS = "\u{f42a}" + case studiovinari = "\u{f3f8}" + case stumbleupon = "\u{f1a4}" + case stumbleuponCircle = "\u{f1a3}" + case superpowers = "\u{f2dd}" + case supple = "\u{f3f9}" + case teamspeak = "\u{f4f9}" + case telegram = "\u{f2c6}" + case telegramPlane = "\u{f3fe}" + case tencentWeibo = "\u{f1d5}" + case theRedYeti = "\u{f69d}" + case themeco = "\u{f5c6}" + case themeisle = "\u{f2b2}" + case thinkPeaks = "\u{f731}" + case tradeFederation = "\u{f513}" + case trello = "\u{f181}" + case tripadvisor = "\u{f262}" + case tumblr = "\u{f173}" + case tumblrSquare = "\u{f174}" + case twitch = "\u{f1e8}" + case twitter = "\u{f099}" + case twitterSquare = "\u{f081}" + case typo3 = "\u{f42b}" + case uber = "\u{f402}" + case uikit = "\u{f403}" + case uniregistry = "\u{f404}" + case untappd = "\u{f405}" + case usb = "\u{f287}" + case ussunnah = "\u{f407}" + case vaadin = "\u{f408}" + case viacoin = "\u{f237}" + case viadeo = "\u{f2a9}" + case viadeoSquare = "\u{f2aa}" + case viber = "\u{f409}" + case vimeo = "\u{f40a}" + case vimeoSquare = "\u{f194}" + case vimeoV = "\u{f27d}" + case vine = "\u{f1ca}" + case vk = "\u{f189}" + case vnv = "\u{f40b}" + case vuejs = "\u{f41f}" + case weebly = "\u{f5cc}" + case weibo = "\u{f18a}" + case weixin = "\u{f1d7}" + case whatsapp = "\u{f232}" + case whatsappSquare = "\u{f40c}" + case whmcs = "\u{f40d}" + case wikipediaW = "\u{f266}" + case windows = "\u{f17a}" + case wix = "\u{f5cf}" + case wizardsOfTheCoast = "\u{f730}" + case wolfPackBattalion = "\u{f514}" + case wordpress = "\u{f19a}" + case wordpressSimple = "\u{f411}" + case wpbeginner = "\u{f297}" + case wpexplorer = "\u{f2de}" + case wpforms = "\u{f298}" + case wpressr = "\u{f3e4}" + case xbox = "\u{f412}" + case xing = "\u{f168}" + case xingSquare = "\u{f169}" + case yCombinator = "\u{f23b}" + case yahoo = "\u{f19e}" + case yandex = "\u{f413}" + case yandexInternational = "\u{f414}" + case yelp = "\u{f1e9}" + case yoast = "\u{f2b1}" + case youtube = "\u{f167}" + case youtubeSquare = "\u{f431}" + case zhihu = "\u{f63f}" + + public var fontType: AwesomeFont { + return AwesomePro.Font.brand } } diff --git a/Classes/Extensions/Amazing+Tools.swift b/Classes/Extensions/Amazing+Tools.swift index d4a1345..8c34401 100755 --- a/Classes/Extensions/Amazing+Tools.swift +++ b/Classes/Extensions/Amazing+Tools.swift @@ -11,14 +11,35 @@ import CoreGraphics public extension Amazing { + /// Returns an image with the selected icon + /// + /// - Parameters: + /// - size: the size of the returned image + /// - color: the foreground color of the icon + /// - backgroundColor: the background color of the icon + /// - Returns: an image that contains the selected icon public func asImage(size: CGSize, color: Color = Color.black, backgroundColor: Color = Color.clear) -> Image { return Image(icon: self, size: size, color: color, backgroundColor: backgroundColor) } + /// Returns a square image with the selected icon + /// + /// - Parameters: + /// - size: the height and width of the returned image + /// - color: the foreground color of the icon + /// - backgroundColor: the background color of the icon + /// - Returns: a square image that contains the selected icon public func asImage(size: CGFloat, color: Color = Color.black, backgroundColor: Color = Color.clear) -> Image { return Image(icon: self, size: CGSize(width: size, height: size), color: color, backgroundColor: backgroundColor) } + /// Returns an attributed string with the selected icon + /// + /// - Parameters: + /// - fontSize: the size of the font used in the string + /// - color: the foreground color of the selected icon + /// - backgroundColor: the background color of the selected icon + /// - Returns: an attributed string that contains the selected icon public func asAttributedText(fontSize: CGFloat, color: Color = Color.black, backgroundColor: Color = Color.clear) -> NSAttributedString { return NSAttributedString(icon: self, fontSize: fontSize, color: color, backgroundColor: backgroundColor) } @@ -27,7 +48,7 @@ public extension Amazing { extension Amazing { - public var key: String { + public var detailedKey: String { return String(reflecting: self) .split(separator: ".") .suffix(3) @@ -35,6 +56,10 @@ extension Amazing { .joined(separator: ".") } + public var key: String { + return String(describing: self).lowercased() + } + public var description: String { return String(describing: self).camelCaseToString() } @@ -42,6 +67,10 @@ extension Amazing { public static var allKeys: [String] { return allCases.map { $0.key } } + + public static var allDetailedKeys: [String] { + return allCases.map { $0.detailedKey } + } public static var allDescriptions: [String] { return allCases.map { $0.description } @@ -62,7 +91,7 @@ extension Amazing { return self.rawValue } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key instead.") + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key or .detailedKey instead.") public var name: String { return String(describing: self).camelCaseToString(with: "-").lowercased() } diff --git a/Classes/Extensions/StringProtocol.swift b/Classes/Extensions/StringProtocol.swift index 9daccb2..4f242f1 100644 --- a/Classes/Extensions/StringProtocol.swift +++ b/Classes/Extensions/StringProtocol.swift @@ -15,16 +15,19 @@ import Foundation extension StringProtocol { + /// Returns a new string with the first letter in upper case var firstUppercased: String { guard let first = first else { return "" } return String(first).uppercased() + dropFirst() } + /// Returns a new string with the first letter capitalized var firstCapitalized: String { guard let first = first else { return "" } return String(first).capitalized + dropFirst() } + /// Returns a new string where the separator has been prepended to each camel case func camelCaseToString(with separator: String = " ") -> String { let string = self.firstUppercased let regex = try! NSRegularExpression(pattern: "([A-Z][a-z\\.]*)") diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index 1a32754..dbf7c75 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -9,12 +9,25 @@ import Foundation public protocol Amazing: RawRepresentable, CaseIterable where RawValue == String { - // Test comment + /// Returns an unique identifier string that contains the icon name var key: String { get } + + /// Returns an unique identifier string that contains the font name, font style and icon name + var detailedKey: String { get } + + /// Returns a human readable string that describes the icon var description: String { get } + + /// Retuns an object with information about the font used by the icon var fontType: AwesomeFont { get } + /// An array with all keys of all icons of the font style static var allKeys: [String] { get } + + /// An array with all detailed keys of all icons of the font style + static var allDetailedKeys: [String] { get } + + /// An array with all human readable descriptions of all icons of the font style static var allDescriptions: [String] { get } // MARK: Deprecated diff --git a/Classes/Protocols/AwesomeFont.swift b/Classes/Protocols/AwesomeFont.swift index 536db95..0c0bde1 100644 --- a/Classes/Protocols/AwesomeFont.swift +++ b/Classes/Protocols/AwesomeFont.swift @@ -9,7 +9,10 @@ import Foundation public protocol AwesomeFont: CustomStringConvertible { + /// The file name that contains the font var file: String { get } + + /// A unique string that describes the font, version and style var memberName: String { get } // MARK: Deprecated From 77000616fd414b8b16dfd0df7dbeb72f344b360d Mon Sep 17 00:00:00 2001 From: Georg Date: Mon, 29 Oct 2018 15:54:11 +0000 Subject: [PATCH 08/10] Added autocomplete hints to Amazing extension --- Classes/Extensions/Amazing+Tools.swift | 6 ++++++ Classes/Protocols/Amazing.swift | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Classes/Extensions/Amazing+Tools.swift b/Classes/Extensions/Amazing+Tools.swift index 8c34401..a58960c 100755 --- a/Classes/Extensions/Amazing+Tools.swift +++ b/Classes/Extensions/Amazing+Tools.swift @@ -48,6 +48,7 @@ public extension Amazing { extension Amazing { + /// Returns an unique identifier string that contains the font name, font style and icon name public var detailedKey: String { return String(reflecting: self) .split(separator: ".") @@ -56,22 +57,27 @@ extension Amazing { .joined(separator: ".") } + /// Returns an unique identifier string that contains the icon name public var key: String { return String(describing: self).lowercased() } + /// Returns a human readable string that describes the icon public var description: String { return String(describing: self).camelCaseToString() } + /// An array with all keys of all icons of the font style public static var allKeys: [String] { return allCases.map { $0.key } } + /// An array with all detailed keys of all icons of the font style public static var allDetailedKeys: [String] { return allCases.map { $0.detailedKey } } + /// An array with all human readable descriptions of all icons of the font style public static var allDescriptions: [String] { return allCases.map { $0.description } } diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index dbf7c75..8f05f97 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -18,7 +18,7 @@ public protocol Amazing: RawRepresentable, CaseIterable where RawValue == String /// Returns a human readable string that describes the icon var description: String { get } - /// Retuns an object with information about the font used by the icon + /// Returns an object with information about the font used by the icon var fontType: AwesomeFont { get } /// An array with all keys of all icons of the font style From 3d78a618077526cfb3cb2a5fb6e413413aa87635 Mon Sep 17 00:00:00 2001 From: Georg Date: Mon, 29 Oct 2018 16:03:05 +0000 Subject: [PATCH 09/10] Added deprecation warnings to Amazing Protocol --- Classes/Protocols/Amazing.swift | 8 ++++++++ Classes/Protocols/AwesomeFont.swift | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index 8f05f97..7ff00f6 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -32,11 +32,19 @@ public protocol Amazing: RawRepresentable, CaseIterable where RawValue == String // MARK: Deprecated + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allKeys instead") static var keys: [String] { get } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allDescriptions instead") static var labels: [String] { get } + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .rawValue instead.") var code: String { get } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key or .detailedKey instead.") var name: String { get } + + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") var label: String { get } } diff --git a/Classes/Protocols/AwesomeFont.swift b/Classes/Protocols/AwesomeFont.swift index 0c0bde1..cd4a3a8 100644 --- a/Classes/Protocols/AwesomeFont.swift +++ b/Classes/Protocols/AwesomeFont.swift @@ -17,5 +17,7 @@ public protocol AwesomeFont: CustomStringConvertible { // MARK: Deprecated + @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") var name: String { get } + } From 34dd167f8eb979120c448f7edd07bca25eef451d Mon Sep 17 00:00:00 2001 From: Georg Date: Tue, 30 Oct 2018 11:04:00 +0000 Subject: [PATCH 10/10] Breaking downward compatibility with compiler hints --- Classes/Extensions/Amazing+Tools.swift | 102 ++++++++++++++++--------- Classes/Libs/Fonts.swift | 8 +- Classes/Protocols/Amazing.swift | 19 +---- Classes/Protocols/AwesomeFont.swift | 5 -- 4 files changed, 70 insertions(+), 64 deletions(-) diff --git a/Classes/Extensions/Amazing+Tools.swift b/Classes/Extensions/Amazing+Tools.swift index a58960c..d84eac0 100755 --- a/Classes/Extensions/Amazing+Tools.swift +++ b/Classes/Extensions/Amazing+Tools.swift @@ -82,117 +82,143 @@ extension Amazing { return allCases.map { $0.description } } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allKeys instead") + // MARK: - Removed + + @available(*, unavailable, renamed: "allKeys") public static var keys: [String] { - return allKeys + get { + fatalError() + } } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allDescriptions instead") + @available(*, unavailable, renamed: "allDescriptions") public static var labels: [String] { - return allDescriptions + get { + fatalError() + } } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .rawValue instead.") + @available(*, unavailable, renamed: "rawValue") public var code: String { - return self.rawValue + get { + fatalError() + } } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key or .detailedKey instead.") + @available(*, unavailable, renamed: "key") public var name: String { - return String(describing: self).camelCaseToString(with: "-").lowercased() + get { + fatalError() + } } - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") + @available(*, unavailable, renamed: "description") public var label: String { - return self.description + get { + fatalError() + } } } extension Awesome { - @available(*, deprecated, renamed: "Brand") + @available(*, unavailable, renamed: "Brand") public typealias brand = Awesome.Brand - @available(*, deprecated, renamed: "Regular") + @available(*, unavailable, renamed: "Regular") public typealias regular = Awesome.Regular - @available(*, deprecated, renamed: "Solid") + @available(*, unavailable, renamed: "Solid") public typealias solid = Awesome.Solid } extension AwesomePro { - @available(*, deprecated, renamed: "Brand") + @available(*, unavailable, renamed: "Brand") public typealias brand = AwesomePro.Brand - @available(*, deprecated, renamed: "Regular") + @available(*, unavailable, renamed: "Regular") public typealias regular = AwesomePro.Regular - @available(*, deprecated, renamed: "Solid") + @available(*, unavailable, renamed: "Solid") public typealias solid = AwesomePro.Solid - @available(*, deprecated, renamed: "Light") + @available(*, unavailable, renamed: "Light") public typealias light = AwesomePro.Light } extension Awesome.Brand { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") - public static var all: [Awesome.brand] { - return allCases + @available(*, unavailable, renamed: "allCases") + public static var all: [Awesome.Brand] { + get { + fatalError() + } } } extension Awesome.Regular { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") - public static var all: [Awesome.regular] { - return allCases + @available(*, unavailable, renamed: "allCases") + public static var all: [Awesome.Regular] { + get { + fatalError() + } } } extension Awesome.Solid { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") - public static var all: [Awesome.solid] { - return allCases + @available(*, unavailable, renamed: "allCases") + public static var all: [Awesome.Solid] { + get { + fatalError() + } } } extension AwesomePro.Brand { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") - public static var all: [AwesomePro.brand] { - return allCases + @available(*, unavailable, renamed: "allCases") + public static var all: [AwesomePro.Brand] { + get { + fatalError() + } } } extension AwesomePro.Regular { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") - public static var all: [AwesomePro.regular] { - return allCases + @available(*, unavailable, renamed: "allCases") + public static var all: [AwesomePro.Regular] { + get { + fatalError() + } } } extension AwesomePro.Solid { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") - public static var all: [AwesomePro.solid] { - return allCases + @available(*, unavailable, renamed: "allCases") + public static var all: [AwesomePro.Solid] { + get { + fatalError() + } } } extension AwesomePro.Light { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allCases instead") - public static var all: [AwesomePro.light] { - return allCases + @available(*, unavailable, renamed: "allCases") + public static var all: [AwesomePro.Light] { + get { + fatalError() + } } } diff --git a/Classes/Libs/Fonts.swift b/Classes/Libs/Fonts.swift index adeb665..4a0c9a8 100644 --- a/Classes/Libs/Fonts.swift +++ b/Classes/Libs/Fonts.swift @@ -9,12 +9,13 @@ import Foundation import CoreGraphics import CoreText - public extension AwesomeFont { - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") + @available(*, unavailable, renamed: "description") public var name: String { - return self.description + get { + fatalError() + } } } @@ -22,6 +23,7 @@ public extension AwesomeFont { public extension Awesome { public enum Font: String, AwesomeFont { + case brand = "fa-brands-400" case regular = "fa-regular-400" case solid = "fa-solid-900" diff --git a/Classes/Protocols/Amazing.swift b/Classes/Protocols/Amazing.swift index 7ff00f6..a523232 100644 --- a/Classes/Protocols/Amazing.swift +++ b/Classes/Protocols/Amazing.swift @@ -29,22 +29,5 @@ public protocol Amazing: RawRepresentable, CaseIterable where RawValue == String /// An array with all human readable descriptions of all icons of the font style static var allDescriptions: [String] { get } - - // MARK: Deprecated - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allKeys instead") - static var keys: [String] { get } - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .allDescriptions instead") - static var labels: [String] { get } - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .rawValue instead.") - var code: String { get } - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .key or .detailedKey instead.") - var name: String { get } - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") - var label: String { get } - + } diff --git a/Classes/Protocols/AwesomeFont.swift b/Classes/Protocols/AwesomeFont.swift index cd4a3a8..95b6645 100644 --- a/Classes/Protocols/AwesomeFont.swift +++ b/Classes/Protocols/AwesomeFont.swift @@ -14,10 +14,5 @@ public protocol AwesomeFont: CustomStringConvertible { /// A unique string that describes the font, version and style var memberName: String { get } - - // MARK: Deprecated - - @available(swift, deprecated: 4.2, message: "This will be removed in the future. Please use .description instead.") - var name: String { get } }