Skip to content

Commit

Permalink
Merge pull request ReactiveCocoa#11 from Lightricks/feature/xcode-9
Browse files Browse the repository at this point in the history
ReactiveObjC: upgrade to Xcode 9.
  • Loading branch information
StatusReport committed Sep 14, 2017
2 parents 1da5aab + 98e6646 commit 4d6d1b3
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 19 deletions.
18 changes: 17 additions & 1 deletion ReactiveObjC.xcodeproj/project.pbxproj
Expand Up @@ -1952,7 +1952,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = GitHub;
TargetAttributes = {
57A4D1AF1BA13D7A00F7D4B1 = {
Expand Down Expand Up @@ -2764,6 +2764,10 @@
baseConfigurationReference = D047262919E49FE8006002AA /* Debug.xcconfig */;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CODE_SIGNING_REQUIRED = NO;
CURRENT_PROJECT_VERSION = 1;
ENABLE_TESTABILITY = YES;
Expand All @@ -2787,6 +2791,10 @@
baseConfigurationReference = D047262B19E49FE8006002AA /* Release.xcconfig */;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CODE_SIGNING_REQUIRED = NO;
CURRENT_PROJECT_VERSION = 1;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -2914,6 +2922,10 @@
baseConfigurationReference = D047262A19E49FE8006002AA /* Profile.xcconfig */;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CODE_SIGNING_REQUIRED = NO;
CURRENT_PROJECT_VERSION = 1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
Expand Down Expand Up @@ -2988,6 +3000,10 @@
baseConfigurationReference = D047262C19E49FE8006002AA /* Test.xcconfig */;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CODE_SIGNING_REQUIRED = NO;
CURRENT_PROJECT_VERSION = 1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down Expand Up @@ -68,6 +68,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
Expand Down Expand Up @@ -98,6 +99,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down Expand Up @@ -68,6 +68,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
Expand Down Expand Up @@ -98,6 +99,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down Expand Up @@ -68,6 +68,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
Expand Down Expand Up @@ -98,6 +99,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -45,6 +46,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion ReactiveObjC/NSObject+RACKVOWrapper.m
Expand Up @@ -54,7 +54,7 @@ - (RACDisposable *)rac_observeKeyPath:(NSString *)keyPath options:(NSKeyValueObs

BOOL isObject = attributes->objectClass != nil || strstr(attributes->type, @encode(id)) == attributes->type;
BOOL isProtocol = attributes->objectClass == NSClassFromString(@"Protocol");
BOOL isBlock = strcmp(attributes->type, @encode(void(^)())) == 0;
BOOL isBlock = strcmp(attributes->type, @encode(void(^)(void))) == 0;
BOOL isWeak = attributes->weak;

// If this property isn't actually an object (or is a Class object),
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/RACSequence.h
Expand Up @@ -259,7 +259,7 @@ typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable valu
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new sequence of reduced tuple values.
- (RACSequence *)reduceEach:(id _Nullable (^)())reduceBlock;
- (RACSequence *)reduceEach:(RACReduceBlock)reduceBlock;

/// Returns a sequence consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -309,7 +309,7 @@ typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable valu
///
/// Returns a new sequence containing the results from each invocation of
/// `reduceBlock`.
+ (RACSequence<ValueType> *)zip:(id<NSFastEnumeration>)sequences reduce:(id _Nullable (^)())reduceBlock;
+ (RACSequence<ValueType> *)zip:(id<NSFastEnumeration>)sequences reduce:(RACReduceBlock)reduceBlock;

/// Returns a sequence obtained by concatenating `sequences` in order.
+ (RACSequence<ValueType> *)concat:(id<NSFastEnumeration>)sequences;
Expand Down
7 changes: 6 additions & 1 deletion ReactiveObjC/RACSignal+Operations.h
Expand Up @@ -178,6 +178,11 @@ extern const NSInteger RACSignalErrorNoMatchingCase;
/// `error` events, and completes when all input signals complete.
+ (RACSignal<RACTuple *> *)combineLatest:(id<NSFastEnumeration>)signals RAC_WARN_UNUSED_RESULT;

_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wstrict-prototypes\"") \
typedef ValueType _Nullable (^RACReduceValueBlock)();
_Pragma("clang diagnostic pop")

/// Combines signals using +combineLatest:, then reduces the resulting tuples
/// into a single value using -reduceEach:.
///
Expand All @@ -197,7 +202,7 @@ extern const NSInteger RACSignalErrorNoMatchingCase;
///
/// Returns a signal which sends the results from each invocation of
/// `reduceBlock`.
+ (RACSignal<ValueType> *)combineLatest:(id<NSFastEnumeration>)signals reduce:(ValueType _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
+ (RACSignal<ValueType> *)combineLatest:(id<NSFastEnumeration>)signals reduce:(RACReduceValueBlock)reduceBlock RAC_WARN_UNUSED_RESULT;

/// Merges the receiver and the given signal with `+merge:` and returns the
/// resulting signal.
Expand Down
7 changes: 4 additions & 3 deletions ReactiveObjC/RACSignal+Operations.m
Expand Up @@ -331,7 +331,7 @@ - (RACSignal *)bufferWithTime:(NSTimeInterval)interval onScheduler:(RACScheduler
RACSerialDisposable *timerDisposable = [[RACSerialDisposable alloc] init];
NSMutableArray *values = [NSMutableArray array];

void (^flushValues)() = ^{
void (^flushValues)(void) = ^{
@synchronized (values) {
[timerDisposable.disposable dispose];

Expand Down Expand Up @@ -473,7 +473,7 @@ + (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals {
[lastValues addObject:[NSNull null]];
}

void (^sendNext)() = ^() {
void (^sendNext)(void) = ^() {
if (sentValues.count < signalsCount) return;
[subscriber sendNext:[RACTuple tupleWithObjectsFromArray:lastValues]];
};
Expand Down Expand Up @@ -505,7 +505,8 @@ + (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals {
}] setNameWithFormat:@"+combineLatest: %@", signals];
}

+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals reduce:(id (^)())reduceBlock {
+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals
reduce:(RACReduceValueBlock)reduceBlock {
NSCParameterAssert(reduceBlock != nil);

RACSignal *result = [self combineLatest:signals];
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/RACSignal.h
Expand Up @@ -218,7 +218,7 @@ typedef RACSignal * _Nullable (^RACSignalBindBlock)(ValueType _Nullable value, B
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new signal of reduced tuple values.
- (RACSignal *)reduceEach:(id _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
- (RACSignal *)reduceEach:(RACReduceBlock)reduceBlock RAC_WARN_UNUSED_RESULT;

/// Returns a signal consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -268,7 +268,7 @@ typedef RACSignal * _Nullable (^RACSignalBindBlock)(ValueType _Nullable value, B
///
/// Returns a new signal containing the results from each invocation of
/// `reduceBlock`.
+ (RACSignal<ValueType> *)zip:(id<NSFastEnumeration>)signals reduce:(id _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
+ (RACSignal<ValueType> *)zip:(id<NSFastEnumeration>)signals reduce:(RACReduceBlock)reduceBlock RAC_WARN_UNUSED_RESULT;

/// Returns a signal obtained by concatenating `signals` in order.
+ (RACSignal<ValueType> *)concat:(id<NSFastEnumeration>)signals RAC_WARN_UNUSED_RESULT;
Expand Down
9 changes: 7 additions & 2 deletions ReactiveObjC/RACStream.h
Expand Up @@ -162,6 +162,11 @@ typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, B
/// to `value`.
- (__kindof RACStream<ValueType> *)ignore:(nullable ValueType)value;

_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wstrict-prototypes\"") \
typedef id _Nullable (^RACReduceBlock)();
_Pragma("clang diagnostic pop")

/// Unpacks each RACTuple in the receiver and maps the values to a new value.
///
/// reduceBlock - The block which reduces each RACTuple's values into one value.
Expand All @@ -170,7 +175,7 @@ typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, B
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new stream of reduced tuple values.
- (__kindof RACStream *)reduceEach:(id _Nullable (^)())reduceBlock;
- (__kindof RACStream *)reduceEach:(RACReduceBlock)reduceBlock;

/// Returns a stream consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -221,7 +226,7 @@ typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, B
///
/// Returns a new stream containing the results from each invocation of
/// `reduceBlock`.
+ (__kindof RACStream<ValueType> *)zip:(id<NSFastEnumeration>)streams reduce:(id _Nullable (^)())reduceBlock;
+ (__kindof RACStream<ValueType> *)zip:(id<NSFastEnumeration>)streams reduce:(RACReduceBlock)reduceBlock;

/// Returns a stream obtained by concatenating `streams` in order.
+ (__kindof RACStream<ValueType> *)concat:(id<NSFastEnumeration>)streams;
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/RACStream.m
Expand Up @@ -139,7 +139,7 @@ - (__kindof RACStream *)ignore:(id)value {
}] setNameWithFormat:@"[%@] -ignore: %@", self.name, RACDescription(value)];
}

- (__kindof RACStream *)reduceEach:(id (^)())reduceBlock {
- (__kindof RACStream *)reduceEach:(RACReduceBlock)reduceBlock {
NSCParameterAssert(reduceBlock != nil);

__weak RACStream *stream __attribute__((unused)) = self;
Expand Down Expand Up @@ -234,7 +234,7 @@ + (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams {
}] setNameWithFormat:@"+zip: %@", streams];
}

+ (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams reduce:(id (^)())reduceBlock {
+ (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams reduce:(RACReduceBlock)reduceBlock {
NSCParameterAssert(reduceBlock != nil);

RACStream *result = [self zip:streams];
Expand Down
2 changes: 1 addition & 1 deletion ReactiveObjC/extobjc/EXTScope.h
Expand Up @@ -91,7 +91,7 @@
_Pragma("clang diagnostic pop")

/*** implementation details follow ***/
typedef void (^rac_cleanupBlock_t)();
typedef void (^rac_cleanupBlock_t)(void);

static inline void rac_executeCleanupBlock (__strong rac_cleanupBlock_t *block) {
(*block)();
Expand Down

0 comments on commit 4d6d1b3

Please sign in to comment.