Xcode code snippets for the Swift Composable Architecture (TCA)
Creates snippets for the reducer, view and preview for a feature
Figure.1 | Figure.2 |
---|---|
Creates scenario test method for a feature. You should use the completion inside of the test class.
Figure.1 | Figure.2 |
---|---|
- 다음 경로에 자동으로
Reducer
와View
,Preview
까지 생성하는 코드 스니펫 파일이 있습니다.
/XcodeSnippets/FeatureTemplate.codesnippet
- 터미널을 열고 다음 명령어를 실행하여 Xcode에 코드 스니펫 관리 폴더를 엽니다.
$ open Library/Developer/Xcode/UserData/CodeSnippets/
-
폴더에 코드 스니펫 파일을 복사 붙여넣기 합니다.
-
Xcode를 실행한 후
.swift
파일에서feature
를 입력하면 자동완성 목록에 뜨는 걸 확인할 수 있습니다.
IMPORTANT Xcode 를 실행중이라면 종료 후 재시작합니다.
- You have an auto-generated code snippet file at the following path:
/XcodeSnippets/FeatureTemplate.codesnippet
- Open your terminal and execute the following command to open the code snippet management folder in Xcode:
$ open Library/Developer/Xcode/UserData/CodeSnippets/
-
Copy and paste the code snippet file into this folder.
-
After opening Xcode, if it's running, please restart it. Then, when you type feature in a .swift file, you will see it in the auto-completion list.
- 您在以下路径有一个自动生成的代码片段文件:
/XcodeSnippets/FeatureTemplate.codesnippet
- 打开终端并执行以下命令,以打开Xcode中的代码片段管理文件夹:
$ open Library/Developer/Xcode/UserData/CodeSnippets/
-
复制并粘贴代码片段文件到这个文件夹中。
-
在打开Xcode后,如果它正在运行,请重新启动它。然后,在
.swift
文件中键入feature
,您将在自动完成列表中看到它。
- 次のパスに自動生成されたコードスニペットファイルがあります。
/XcodeSnippets/FeatureTemplate.codesnippet
- ターミナルを開き、Xcodeのコードスニペット管理フォルダを開くには、次のコマンドを実行してください。
$ open Library/Developer/Xcode/UserData/CodeSnippets/
-
コードスニペットファイルをこのフォルダにコピーして貼り付けます。
-
Xcodeを開いた後、実行中であれば終了し、再起動してください。その後、
.swift
ファイルでfeature
を入力すると、自動補完リストに表示されるはずです。