From 4fb464bd4294698cbe00c5087a0187ba84d846da Mon Sep 17 00:00:00 2001 From: Jaewe Heo Date: Tue, 22 Feb 2022 14:02:05 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Create=20'TCA=20Service.xctemplate'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TCA Service.xctemplate/TemplateIcon.png | Bin 0 -> 1258 bytes .../TemplateIcon@2x.png | Bin 0 -> 2585 bytes .../TCA Service.xctemplate/TemplateInfo.plist | 20 +++++++ .../___FILEBASENAME___Service.swift | 53 ++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 templates/TCA Service.xctemplate/TemplateIcon.png create mode 100644 templates/TCA Service.xctemplate/TemplateIcon@2x.png create mode 100644 templates/TCA Service.xctemplate/TemplateInfo.plist create mode 100644 templates/TCA Service.xctemplate/___FILEBASENAME___Service.swift diff --git a/templates/TCA Service.xctemplate/TemplateIcon.png b/templates/TCA Service.xctemplate/TemplateIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..e47998066f1219c8d45f2687c932a3198cac97bf GIT binary patch literal 1258 zcmVPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NGR7pfZRA>e5SxZY>K@>j5Xp@-w zimxizcB2*Cb*HVRG^L2Yz#_PD@4|)PA8_HH5Elwb8|*F{aUpJmqV<7-NT{#k6D=zB zmGpd5Cq%t>;=OZY6nfxfCNpQwoNvy&?ir#-PC55vzwAe*iIjd*^C`u5%Swet(x?OH zGP|zwoY*3%3u&DB;wnWRWE+J0Uwgw}bmrOF+4+{ApC2@oxI28DZoLb&Q8%3E=efl#Y*&@!y@BoBKKt2t*eb7h72b z{YVd?i6v42K%LK$HUnV^0HY58Ddb@gp}D!aPh4gjgbDygMK#4zY*A+cf~Sp`MmHoq zm6esD+1c5TTy6`53IO^72yFrY3Bo{`x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BNs(=LdIJ6^)@-xgq$HWRq&ON zOzzqq9EDN_<{fhHh;8FN_D#t&prHMeHdg0T%A89OivgNT{4UeZ!^WDst=T>40)$oU z0Alj=Mhg3ZO-M+{ExGW5J=egOS^9YPq!?)zOksW%Y#+>7`?CPn`{KpzL}9tzqjoqb zwz;L{c@Z(AaABmGWLRIRZJbhCg+HzqT-)UtWIVRUmNI#YMwZ^C>AFo0%uI>uB$1 za?JN{quOwGzVgK=k=s9ZSN1!CWW8lk6H4F3@pc_f(5(c0t=KoW{iCC!e@iZ8%YgOs zqb*v(uc>Ugjr>ivXJ3vU@_KFN&zp(?4pFBwu{`SL`cun?CwjLj>UC+>WeHE?PJmdtIN2Oz!MdsWoqw{AFca9VfFxVyPdEWM=G@=<)Y;F4j9l1jNL|i*Ek( zaZ5_H4u*(Wy>heK@Vy7rq}e3!@3+MzoZ=T>BG1j~yge)hqdSmSnOD|4`TKn{?$df) z5Ba4k5fH@$y(M$Nt!rB}G)znd%0A0ki#%rhxY%a^L6UagvFgY#qAhL5?G?lUR-bz3 zwgCfr`pOm&0_}Lg2ggj0To~e?#KXE73v@751>&jz&HbL?Z6gvY2{q}avn3IL@_+h^ zh*UOcB|(nFfo!~D^j`g1`ApFi0y_u~2ojsj82hx#Zgg6wVmSUd+g)NRz0aU>O!mq% pr=6cevu{9^vm@Uf8yOwnhMbt+E{s5|DF1592-fz;t1QX%e*pt5p6vht literal 0 HcmV?d00001 diff --git a/templates/TCA Service.xctemplate/TemplateInfo.plist b/templates/TCA Service.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..be3b450 --- /dev/null +++ b/templates/TCA Service.xctemplate/TemplateInfo.plist @@ -0,0 +1,20 @@ + + + + + SupportsSwiftPackage + + Kind + Xcode.IDEFoundation.TextSubstitutionFileTemplateKind + SortOrder + 1 + AllowedTypes + + public.swift-source + + Platforms + + DefaultCompletionName + YourService + + diff --git a/templates/TCA Service.xctemplate/___FILEBASENAME___Service.swift b/templates/TCA Service.xctemplate/___FILEBASENAME___Service.swift new file mode 100644 index 0000000..098bed0 --- /dev/null +++ b/templates/TCA Service.xctemplate/___FILEBASENAME___Service.swift @@ -0,0 +1,53 @@ +//___FILEHEADER___ + +import ComposableArchitecture + +protocol ___FILEBASENAMEASIDENTIFIER___ { + func greeting() -> Effect +} + +final class ___FILEBASENAMEASIDENTIFIER___Live: ___FILEBASENAMEASIDENTIFIER___ { + func greeting() -> Effect { + .fireAndForget { + print("Hello") + } + } +} + +extension ___FILEBASENAMEASIDENTIFIER___ where Self == ___FILEBASENAMEASIDENTIFIER___Live { + static var live: Self { + .init() + } +} + +#if DEBUG +struct ___FILEBASENAMEASIDENTIFIER___Mock: ___FILEBASENAMEASIDENTIFIER___ { + let greetingEffect: Effect + + func greeting() -> Effect { greetingEffect } +} + +extension ___FILEBASENAMEASIDENTIFIER___ where Self == ___FILEBASENAMEASIDENTIFIER___Mock { + static func mock( + greeting: Effect = .none + ) -> Self { + .init( + greetingEffect: greeting + ) + } + + static var noop: Self { + .init( + greetingEffect: .none + ) + } + + static var failing: Self { + .init( + greetingEffect: .fireAndForget { + fatalError("Not implemented yet") + } + ) + } +} +#endif