Code Monkey home page Code Monkey logo

viewcodetemplate's Introduction

View Code Template

xctemplate for create view code based in protocols

UseCase Template

xctemplate for create new UseCase code based in protocols and RxSwift

What is it?

This repo stores XCode templates, that allows you to create View Code with protocols in Swift.

How to use?

If you are using Xcode just go to ~/Library/Developer/Xcode/ folder, Create the folder 'Templates', Then inside Templates create folder 'File Templates'. add View Code Template.xctemplate and UseCase Template.xctemplate there. That's it. Now you can find your template in XCode -> New File -> iOS -> File Templates

Issues

Some of you may have already noticed that something is wrong with the folder created. The color signals that it’s not a group and if you try to instantiate the View from somewhere in the rest of the app, you will be unable to do so.

This is happening because the template creates just a folder and not actually an Xcode group, so all the files inside the module are not members of the app target. Sadly, after some research, it seems that it is not currently possible to create a new group when you use a new file template, only when creating a template for a new project. A quick solution is to create the group from the folder and then delete the reference to the initial folder.

Point to the parent folder, right click and choose “Add files to “…””.

Image 1

A new window will pop up. There, choose the root folder of your module, and pick “Create groups” for the field “Added folders”. Then press “Add”.

Image 2

The new group is created, and now we can safely right click on the old folder of our module, choose “Delete” and pick the option “Remove reference”.

Image 3

This is structure created for UseCase Image 4

The new module is ready to be used!

viewcodetemplate's People

Contributors

pabloruan0710 avatar wladmirjunior avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.