mirror of https://github.com/oxen-io/session-ios
parent
0d7e2d2f20
commit
9240a095ae
@ -1,4 +1,5 @@
|
|||||||
language: objective-c
|
language: objective-c
|
||||||
cache: cocoapods
|
xcode_sdk: iphonesimulator7.1
|
||||||
|
install: true
|
||||||
script: xcodebuild test -workspace Signal.xcworkspace -scheme Signal -sdk iphonesimulator ONLY_ACTIVE_ARCH=YES
|
xcode_workspace: Signal.xcworkspace
|
||||||
|
xcode_scheme: Signal
|
||||||
|
@ -0,0 +1,96 @@
|
|||||||
|
//
|
||||||
|
// iOSVersions.h
|
||||||
|
// Signal
|
||||||
|
//
|
||||||
|
// Created by Frederic Jacobs on 03/08/14.
|
||||||
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#include <Availability.h>
|
||||||
|
|
||||||
|
// Source: https://github.com/carlj/CJAMacros/blob/master/CJAMacros/CJAMacros.h
|
||||||
|
|
||||||
|
/**
|
||||||
|
Runtime check for the current version Nummer.
|
||||||
|
checks ( CURRENT_VERSION_NUMBR == GIVEN_VERSION_NUMBER)
|
||||||
|
@_gVersion - the given Version Number. aka (_iOS_7_0 or NSFoundationVersionNumber_iOS_7_0 and so on)
|
||||||
|
*/
|
||||||
|
#define SYSTEM_VERSION_EQUAL_TO(_gVersion) ( floor(NSFoundationVersionNumber) == _gVersion )
|
||||||
|
|
||||||
|
/**
|
||||||
|
Runtime check for the current version Nummer.
|
||||||
|
checks CURRENT_VERSION_NUMBER > GIVEN_VERSION_NUMBER
|
||||||
|
@_gVersion - the given Version Number. aka (_iOS_7_0 or NSFoundationVersionNumber_iOS_7_0 and so on)
|
||||||
|
*/
|
||||||
|
#define SYSTEM_VERSION_GREATER_THAN(_gVersion) ( floor(NSFoundationVersionNumber) > _gVersion )
|
||||||
|
|
||||||
|
/**
|
||||||
|
Runtime check for the current version Nummer.
|
||||||
|
checks CURRENT_VERSION_NUMBER >= GIVEN_VERSION_NUMBER
|
||||||
|
@_gVersion - the given Version Number. aka (_iOS_7_0 or NSFoundationVersionNumber_iOS_7_0 and so on)
|
||||||
|
*/
|
||||||
|
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(_gVersion) ( floor(NSFoundationVersionNumber) >= _gVersion )
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Runtime check for the current version Nummer.
|
||||||
|
checks CURRENT_VERSION_NUMBER < GIVEN_VERSION_NUMBER
|
||||||
|
@_gVersion - the given Version Number. aka (_iOS_7_0 or NSFoundationVersionNumber_iOS_7_0 and so on)
|
||||||
|
*/
|
||||||
|
#define SYSTEM_VERSION_LESS_THAN(_gVersion) ( floor(NSFoundationVersionNumber) < _gVersion )
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Runtime check for the current version Nummer.
|
||||||
|
checks CURRENT_VERSION_NUMBER <= GIVEN_VERSION_NUMBER
|
||||||
|
@_gVersion - the given Version Number. aka (_iOS_7_0 or NSFoundationVersionNumber_iOS_7_0 and so on)
|
||||||
|
*/
|
||||||
|
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(_gVersion) ( floor(NSFoundationVersionNumber) <= _gVersion )
|
||||||
|
|
||||||
|
|
||||||
|
//If the symbol for iOS 7 isnt defined, define it.
|
||||||
|
#ifndef NSFoundationVersionNumber_iOS_7_0
|
||||||
|
#define NSFoundationVersionNumber_iOS_7_0 1047.00 //extracted from iOS 7 Header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NSFoundationVersionNumber_iOS_7_0
|
||||||
|
#define _iOS_7_0 NSFoundationVersionNumber_iOS_7_0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//If the symbol for iOS 7.1 isnt defined, define it.
|
||||||
|
#ifndef NSFoundationVersionNumber_iOS_7_1
|
||||||
|
#define NSFoundationVersionNumber_iOS_7_1 1047.25 //extracted from iOS 8 Header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NSFoundationVersionNumber_iOS_7_1
|
||||||
|
#define _iOS_7_1 NSFoundationVersionNumber_iOS_7_1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//If the symbol for iOS 8 isnt defined, define it.
|
||||||
|
#ifndef NSFoundationVersionNumber_iOS_8_0
|
||||||
|
#define NSFoundationVersionNumber_iOS_8_0 1134.10 //extracted with NSLog(@"%f", NSFoundationVersionNumber)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NSFoundationVersionNumber_iOS_8_0
|
||||||
|
#define _iOS_8_0 NSFoundationVersionNumber_iOS_8_0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Add a Singelton implementation to the .m File
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MacrosSingletonImplemantion \
|
||||||
|
+ (instancetype)sharedInstance { \
|
||||||
|
\
|
||||||
|
static dispatch_once_t onceToken; \
|
||||||
|
static id sharedInstance = nil; \
|
||||||
|
dispatch_once(&onceToken, ^{ \
|
||||||
|
sharedInstance = [self.class new]; \
|
||||||
|
}); \
|
||||||
|
\
|
||||||
|
return sharedInstance; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CJAMacrosSingletonInterface + (instancetype)sharedInstance;
|
Loading…
Reference in New Issue