I have Got this waning while using this code
-(void) drawPlaceholderInRect:(CGRect)rect {
// [[UIColor ] setFill];
BOOL currentdevice=[[UIDevice currentDevice].model hasPrefix:@"iPhone"];
if(currentdevice)
{
[[self placeholder] drawInRect:rect withAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont fontWithName:@"OpenSans" size:15] }];
}
else
{
[[self placeholder] drawInRect:rect withAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont fontWithName:@"OpenSans" size:20]}];
}
}
To Stop the warning message i am using this code
@implementation UITextField (placeholder)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
// do your override
-(void) drawPlaceholderInRect:(CGRect)rect {
// [[UIColor ] setFill];
BOOL currentdevice=[[UIDevice currentDevice].model hasPrefix:@"iPhone"];
if(currentdevice)
{
[[self placeholder] drawInRect:rect withAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont fontWithName:@"OpenSans" size:15] }];
}
else
{
[[self placeholder] drawInRect:rect withAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont fontWithName:@"OpenSans" size:20]}];
}
}
#pragma clang diagnostic pop
is there any problem if i use like this ..
or please give me exact way to override the method thanks....