Skip to content

Commit

Permalink
Annotate NimbusCore for extension availability
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjmoore committed Jan 16, 2015
1 parent dc439ec commit b3c8b1e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/core/src/NICommonMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "NIPreprocessorMacros.h"

#if defined __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -144,7 +146,7 @@ NSTimeInterval NIStatusBarBoundsChangeAnimationDuration(void);
*
* This is generally 20 when the status bar is its normal height.
*/
CGFloat NIStatusBarHeight(void);
CGFloat NIStatusBarHeight(void) NI_EXTENSION_UNAVAILABLE_IOS("");

/**
* The animation duration when the device is rotating to a new orientation.
Expand Down
4 changes: 3 additions & 1 deletion src/core/src/NIDeviceOrientation.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "NIPreprocessorMacros.h"

#if defined __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -62,7 +64,7 @@ BOOL NIIsSupportedOrientation(UIInterfaceOrientation orientation);
*
* @returns The current interface orientation.
*/
UIInterfaceOrientation NIInterfaceOrientation(void);
UIInterfaceOrientation NIInterfaceOrientation(void) NI_EXTENSION_UNAVAILABLE_IOS("");

/**
* Returns YES if the device is a phone and the orientation is landscape.
Expand Down
4 changes: 3 additions & 1 deletion src/core/src/NINetworkActivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#import <Foundation/Foundation.h>

#import "NIPreprocessorMacros.h"

#if defined __cplusplus
extern "C" {
#endif
Expand All @@ -41,7 +43,7 @@ extern "C" {
*
* This method is threadsafe.
*/
void NINetworkActivityTaskDidStart(void);
void NINetworkActivityTaskDidStart(void) NI_EXTENSION_UNAVAILABLE_IOS("");

/**
* Decrement the number of active network tasks.
Expand Down
3 changes: 2 additions & 1 deletion src/core/src/NINetworkActivity.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "NINetworkActivity.h"

#import "NIDebuggingTools.h"
#import "NIPreprocessorMacros.h"

#if defined(DEBUG) || defined(NI_DEBUG)
#import "NIRuntimeClassModifications.h"
Expand Down Expand Up @@ -44,7 +45,7 @@ @implementation NINetworkActivity
// Called after a certain amount of time has passed since all network activity has stopped.
// By delaying the turnoff of the network activity we avoid "flickering" effects when network
// activity is starting and stopping rapidly.
+ (void)disableNetworkActivity {
+ (void)disableNetworkActivity NI_EXTENSION_UNAVAILABLE_IOS("") {
pthread_mutex_lock(&gMutex);
if (nil != gScheduledDelayTimer) {
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
Expand Down
13 changes: 13 additions & 0 deletions src/core/src/NIPreprocessorMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ NI_FIX_CATEGORY_BUG(UIViewController_MyCustomCategory);
*/
#define __NI_DEPRECATED_METHOD __attribute__((deprecated))

/**
* Mark APIs as unavailable in app extensions.
*
* Use of unavailable methods, classes, or functions produces a compile error when built as part
* of an app extension target. If the method, class or function using the unavailable API has also
* been marked as unavailable in app extensions, the error will be suppressed.
*/
#ifdef NS_EXTENSION_UNAVAILABLE_IOS
#define NI_EXTENSION_UNAVAILABLE_IOS(msg) NS_EXTENSION_UNAVAILABLE_IOS(msg)
#else
#define NI_EXTENSION_UNAVAILABLE_IOS(msg)
#endif

/**
* Force a category to be loaded when an app starts up.
*
Expand Down

0 comments on commit b3c8b1e

Please sign in to comment.