micheleaiello
micheleaiello
Reputation Top 1%
Michele Aiello
2 Snippets  (221st place)
Published
1 Channel
Created
1 Channel
Following
2736 points  (31st place)
Reputation
Junior Code Generator
Junior Publisher
Junior Topic Creator
Junior Topic Hub
Junior Trend Maker
Junior Popular Coder
Junior Autobiographer
Serious Autobiographer
Senior Autobiographer
Master Autobiographer
Junior Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by micheleaiello

public by micheleaiello  2749  0  5  0

Open Settings (iOS 8 or above)

BOOL canOpenSettings = (&UIApplicationOpenSettingsURLString != NULL);
if (canOpenSettings) {
  NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
  [[UIApplication sharedApplication] openURL:settingsURL];
}
;

public by micheleaiello  263133  0  6  1

Mark methods as deprecated

Mark a method (or a whole class) as deprecated. Works in Xcode v4.2 and higher.
__attribute((deprecated("Use xxx: instead")))

examples:

@interface MyClass : NSObject
  - (void)myOldMethod:(id)param __attribute__((deprecated));
@end

__attribute__((deprecated))
@interface MyOldClass : NSObject
@end

__attribute__((deprecated))
void myOldFunction(...) {
}
;