Skip to content

Instantly share code, notes, and snippets.

@dbarden
Last active August 29, 2015 14:23
Show Gist options
  • Save dbarden/4179325e6ea9913abc37 to your computer and use it in GitHub Desktop.
Save dbarden/4179325e6ea9913abc37 to your computer and use it in GitHub Desktop.
AppCode convert to property refactor

Suppose I have the following scenario

// In my .h

@interface TestClass
@end
// In my .m
@interface ()
@end

@implementation TestClass
{
  NSString *someVariable;
}
@end

If I convert someVariable to a property, it will create the propert on the header file.

// In my .h

@interface TestClass
@property (nonatomic, copy) NSString *someVariable
@end

What I would like to know if it is possible is to, instead of adding to the header, add it to the implementation file, in the @interface () class extension. Because I don't want these variables to be public.

// In my .m
@interface ()
@property (nonatomic, copy) NSString *someVariable
@end

@implementation TestClass
{
}
@end

Right now, I'm converting to property, going to the header file and copying it to the class extension.

It would be more practical if I could refactor it directly to the class extension.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment