mardi 4 août 2015

Automatic class generator Xcode

I want to create some class generator with dependencies of user action. For example,

  1. every time I create a new CoreData Entity class I want to create a category class for it with some content already.
  2. Every time i create a sublass of existing class i want some method to be appear in .m file already (like drawInRect: when you create a new UIView sublass.

Example (.h)

@interface MyFavouriteClassSubclass : MyFavouriteClass

(.m):

@implementation MyFavouriteClassSubclass

-(void)someMethodInMyParentClass {
  [super someMethodInMyParentClass];
}

Can that be done?

I was think about some shell script to achive that, but the problem with it, that I already need to have a file, and it can run as a cronjob. I don't think is a good aproach for that.

Aucun commentaire:

Enregistrer un commentaire