Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conforming protocol privately

Is there any way to hide protocol conforming from an end user? I'll try to describe in details what I want. I have class let's call it EndUserClass which conforms some protocol let's say HiddenClassDelegate and this protocol I'd like to hide from end user. The code looks like as it follows:

@interface EndUserClass : NSObject  <HiddenClassDelegate>
{
  // .....
}   

@end

and I want to keep the same functionality with the following declaration:

@interface EndUserClass : NSObject  
{
  // .....
}   

@end

Is there any way to conform the protocol privately? I know that I can skip delegate in class declaration but it gives compiler warning which I don't want to have

like image 823
Dmytro Avatar asked Sep 28 '10 13:09

Dmytro


1 Answers

You can do that by declaring custom class category in implementation file:

// .m file
@interface EndUserClass() <HiddenClassDelegate>

@end
like image 90
Vladimir Avatar answered Oct 23 '22 06:10

Vladimir