Swift 5 VIPER template generator (Permission denied)

1.5k Views Asked by At

I found this viper template generator. I inhaled everything but now I faced with an permission issue.

When I try to execute swift template generate MyModule --use viper-module command I got this:

error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/
XcodeDefault.xctoolchain/usr/bin/swift-template (Permission denied)

Before this error I got another one:

error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-template (No such file or directory)

Not sure if I am on a right way but I just copied swift-template folder into the path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/

1

There are 1 best solutions below

0
On

I found this one work for VIPER Template in Swift 5.

https://github.com/zafarivaev/VIPER-Template

How To Install

  1. Clone the repository
  2. Navigate to Xcode Templates folder: ~/Library/Developer/Xcode/Templates/. If 3. Templates folder doesn't exist, create it
  3. Copy and paste the VIPER Module.xctemplate in Templates folder

Use

  1. Open Xcode
  2. File -> New -> File or ⌘ N
  3. Scroll down till you see VIPER Module template and choose it.
  4. Set a name for your module. Examples: Home, Auth, SignIn

enter image description here