iOS 定义全局文件

2018-06-16  本文已影响3人  CaptainRoy
#import <Foundation/Foundation.h>

extern NSString * const Terminal;
extern NSString * const Nationality;

// 职业
typedef NS_ENUM(NSUInteger,EmployeeType) {
    EmployeeTypeEngineer, // 工程师
    EmployeeTypeDesigner, // 设计师
    EmployeeTypeFinance, // 财务
};

// 网络状态
typedef NS_ENUM(NSUInteger,NETConnectionState) {
    NETConnectionStateDisconnected,
    NETConnectionStateConnecting = 3,
    NETConnectionStateConnected
};

@interface Common : NSObject

@end
#import "Common.h"

NSString * const Terminal = @"iPhone";
NSString * const Nationality = @"中国";

@implementation Common

@end
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import "Common.h"

#endif

至此即可全局引用定义的一些常量和一些枚举

上一篇下一篇

猜你喜欢

热点阅读