Commit 3b2b6dcb authored by Fabio Pelosin's avatar Fabio Pelosin

[Integration] Actually add the result of the install_custom_workspace check

parent b97b6d50
platform :ios, '6.0'
workspace 'Workspace.xcworkspace'
# TODO: remove
xcodeproj 'SampleApp_1.xcodeproj'
target 'SampleApp_1' do
xcodeproj 'SampleApp_1.xcodeproj'
pod "Reachability", "3.1.0"
end
target :'SampleApp_2' do
xcodeproj 'SampleApp_2.xcodeproj'
pod "Reachability"
end
../../Reachability/Reachability.h
\ No newline at end of file
# Acknowledgements
This application makes use of the following third party libraries:
## Reachability
Copyright (c) 2011, Tony Million.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Generated by CocoaPods - http://cocoapods.org
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2011, Tony Million.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</string>
<key>Title</key>
<string>Reachability</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>
@interface PodsDummy_Pods_SampleApp_1 : NSObject
@end
@implementation PodsDummy_Pods_SampleApp_1
@end
// WARNING: This feature of CocoaPods is present for discussion purposes and might be discontinued or changed in future
#define __COCOA_PODS
#define __POD_Reachability
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "Pods-SampleApp_1-header.h"
#!/bin/sh
install_resource()
{
case $1 in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
echo "rsync -rp ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -rp "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodeld)
echo "xcrun momc ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd"
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd"
;;
*)
echo "cp -R ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
cp -R "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
;;
esac
}
ALWAYS_SEARCH_USER_PATHS = YES
HEADER_SEARCH_PATHS = ${PODS_HEADERS_SEARCH_PATHS}
OTHER_LDFLAGS = -ObjC -framework SystemConfiguration
PODS_BUILD_HEADERS_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/Reachability"
PODS_HEADERS_SEARCH_PATHS = ${PODS_PUBLIC_HEADERS_SEARCH_PATHS}
PODS_PUBLIC_HEADERS_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/Reachability"
PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file
# Acknowledgements
This application makes use of the following third party libraries:
## Reachability
Copyright (c) 2011, Tony Million.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Generated by CocoaPods - http://cocoapods.org
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2011, Tony Million.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</string>
<key>Title</key>
<string>Reachability</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>
@interface PodsDummy_Pods_SampleApp_2 : NSObject
@end
@implementation PodsDummy_Pods_SampleApp_2
@end
// WARNING: This feature of CocoaPods is present for discussion purposes and might be discontinued or changed in future
#define __COCOA_PODS
#define __POD_Reachability
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "Pods-SampleApp_2-header.h"
#!/bin/sh
install_resource()
{
case $1 in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
echo "rsync -rp ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -rp "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodeld)
echo "xcrun momc ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd"
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd"
;;
*)
echo "cp -R ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
cp -R "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
;;
esac
}
ALWAYS_SEARCH_USER_PATHS = YES
HEADER_SEARCH_PATHS = ${PODS_HEADERS_SEARCH_PATHS}
OTHER_LDFLAGS = -ObjC -framework SystemConfiguration
PODS_BUILD_HEADERS_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/Reachability"
PODS_HEADERS_SEARCH_PATHS = ${PODS_PUBLIC_HEADERS_SEARCH_PATHS}
PODS_PUBLIC_HEADERS_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/Reachability"
PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file
File References:
- Frameworks:
- Foundation.framework
- SystemConfiguration.framework
- Pods:
- Reachability:
- Reachability.h
- Reachability.m
- Products:
- libPods-SampleApp_1.a
- libPods-SampleApp_2.a
- Targets Support Files:
- Pods-SampleApp_1:
- Pods-SampleApp_1.xcconfig
- Pods-SampleApp_1-header.h
- Pods-SampleApp_1-prefix.pch
- Pods-SampleApp_1-resources.sh
- Pods-SampleApp_1-acknowledgements.plist
- Pods-SampleApp_1-acknowledgements.markdown
- Pods-SampleApp_1-dummy.m
- Pods-SampleApp_2:
- Pods-SampleApp_2.xcconfig
- Pods-SampleApp_2-header.h
- Pods-SampleApp_2-prefix.pch
- Pods-SampleApp_2-resources.sh
- Pods-SampleApp_2-acknowledgements.plist
- Pods-SampleApp_2-acknowledgements.markdown
- Pods-SampleApp_2-dummy.m
- Podfile
Targets:
- Pods-SampleApp_1:
Build Phases:
- SourcesBuildPhase:
- Reachability.m
- Pods-SampleApp_1-dummy.m
- FrameworksBuildPhase:
- Foundation.framework
- HeadersBuildPhase:
- Reachability.h
Build Configurations:
- Release:
Build Settings:
VALIDATE_PRODUCT: 'YES'
PUBLIC_HEADERS_FOLDER_PATH: $(TARGET_NAME)
DSTROOT: /tmp/xcodeproj.dst
GCC_PREFIX_HEADER: Pods-SampleApp_1-prefix.pch
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: ''
OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
COPY_PHASE_STRIP: 'YES'
PRODUCT_NAME: $(TARGET_NAME)
IPHONEOS_DEPLOYMENT_TARGET: '6.0'
INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods-SampleApp_1.xcconfig
- Debug:
Build Settings:
PUBLIC_HEADERS_FOLDER_PATH: $(TARGET_NAME)
DSTROOT: /tmp/xcodeproj.dst
GCC_PREPROCESSOR_DEFINITIONS:
- DEBUG=1
- $(inherited)
GCC_SYMBOLS_PRIVATE_EXTERN: 'NO'
GCC_PREFIX_HEADER: Pods-SampleApp_1-prefix.pch
GCC_OPTIMIZATION_LEVEL: '0'
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: ''
GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO'
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
COPY_PHASE_STRIP: 'NO'
SDKROOT: iphoneos
PRODUCT_NAME: $(TARGET_NAME)
GCC_DYNAMIC_NO_PIC: 'NO'
INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
IPHONEOS_DEPLOYMENT_TARGET: '6.0'
PODS_ROOT: ${SRCROOT}
ARCHS: $(ARCHS_STANDARD_32_BIT)
SKIP_INSTALL: 'YES'
Base Configuration: Pods-SampleApp_1.xcconfig
- Pods-SampleApp_2:
Build Phases:
- SourcesBuildPhase:
- Reachability.m
- Pods-SampleApp_2-dummy.m
- FrameworksBuildPhase:
- Foundation.framework
- HeadersBuildPhase:
- Reachability.h
Build Configurations:
- Release:
Build Settings:
VALIDATE_PRODUCT: 'YES'
PUBLIC_HEADERS_FOLDER_PATH: $(TARGET_NAME)
DSTROOT: /tmp/xcodeproj.dst
GCC_PREFIX_HEADER: Pods-SampleApp_2-prefix.pch
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: ''
OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
COPY_PHASE_STRIP: 'YES'
PRODUCT_NAME: $(TARGET_NAME)
IPHONEOS_DEPLOYMENT_TARGET: '6.0'
INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods-SampleApp_2.xcconfig
- Debug:
Build Settings:
PUBLIC_HEADERS_FOLDER_PATH: $(TARGET_NAME)
DSTROOT: /tmp/xcodeproj.dst
GCC_PREPROCESSOR_DEFINITIONS:
- DEBUG=1
- $(inherited)
GCC_SYMBOLS_PRIVATE_EXTERN: 'NO'
GCC_PREFIX_HEADER: Pods-SampleApp_2-prefix.pch
GCC_OPTIMIZATION_LEVEL: '0'
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: ''
GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO'
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
COPY_PHASE_STRIP: 'NO'
SDKROOT: iphoneos
PRODUCT_NAME: $(TARGET_NAME)
GCC_DYNAMIC_NO_PIC: 'NO'
INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
IPHONEOS_DEPLOYMENT_TARGET: '6.0'
PODS_ROOT: ${SRCROOT}
ARCHS: $(ARCHS_STANDARD_32_BIT)
SKIP_INSTALL: 'YES'
Base Configuration: Pods-SampleApp_2.xcconfig
Build Configurations:
- Release:
Build Settings: {}
- Debug:
Build Settings: {}
# Reachability
This is a drop-in replacement for Apples Reachability class. It is ARC compatible, uses the new GCD methods to notify of network interface changes.
In addition to the standard NSNotification it supports the use of Blocks for when the network becomes reachable and unreachable.
Finally you can specify wether or not a WWAN connection is considered "reachable".
## A Simple example
This sample uses Blocks to tell you when the interface state has changed. The blocks will be called on a BACKGROUND THREAD so you need to dispatch UI updates onto the main thread.
// allocate a reachability object
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
// set the blocks
reach.reachableBlock = ^(Reachability*reach)
{
NSLog(@"REACHABLE!");
};
reach.unreachableBlock = ^(Reachability*reach)
{
NSLog(@"UNREACHABLE!");
};
// start the notifier which will cause the reachability object to retain itself!
[reach startNotifier];
## Another simple example
This sample will use NSNotifications to tell you when the interface has changed, they will be delivered on the MAIN THREAD so you *can* do UI updates from within the function.
In addition it asks the Reachability object to consider the WWAN (3G/EDGE/CDMA) as a non-reachable connection (you might use this if you are writing a video streaming app, for example, to save the users data plan).
// allocate a reachability object
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
// tell the reachability that we DONT want to be reachable on 3G/EDGE/CDMA
reach.reachableOnWWAN = NO;
// here we set up a NSNotification observer. The Reachability that caused the notification
// is passed in the object parameter
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reachabilityChanged:)
name:kReachabilityChangedNotification
object:nil];
[reach startNotifier]
\ No newline at end of file
/*
Copyright (c) 2011, Tony Million.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <sys/socket.h>
#import <netinet/in.h>
#import <netinet6/in6.h>
#import <arpa/inet.h>
#import <ifaddrs.h>
#import <netdb.h>
/**
* Does ARC support support GCD objects?
* It does if the minimum deployment target is iOS 6+ or Mac OS X 8+
**/
#if TARGET_OS_IPHONE
// Compiling for iOS
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
#else // iOS 5.X or earlier
#define NEEDS_DISPATCH_RETAIN_RELEASE 1
#endif
#else
// Compiling for Mac OS X
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
#else
#define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
#endif
#endif
extern NSString *const kReachabilityChangedNotification;
typedef enum
{
// Apple NetworkStatus Compatible Names.
NotReachable = 0,
ReachableViaWiFi = 2,
ReachableViaWWAN = 1
} NetworkStatus;
@class Reachability;
typedef void (^NetworkReachable)(Reachability * reachability);
typedef void (^NetworkUnreachable)(Reachability * reachability);
@interface Reachability : NSObject
@property (nonatomic, copy) NetworkReachable reachableBlock;
@property (nonatomic, copy) NetworkUnreachable unreachableBlock;
@property (nonatomic, assign) BOOL reachableOnWWAN;
+(Reachability*)reachabilityWithHostname:(NSString*)hostname;
+(Reachability*)reachabilityForInternetConnection;
+(Reachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress;
+(Reachability*)reachabilityForLocalWiFi;
-(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref;
-(BOOL)startNotifier;
-(void)stopNotifier;
-(BOOL)isReachable;
-(BOOL)isReachableViaWWAN;
-(BOOL)isReachableViaWiFi;
// WWAN may be available, but not active until a connection has been established.
// WiFi may require a connection for VPN on Demand.
-(BOOL)isConnectionRequired; // Identical DDG variant.
-(BOOL)connectionRequired; // Apple's routine.
// Dynamic, on demand connection?
-(BOOL)isConnectionOnDemand;
// Is user intervention required?
-(BOOL)isInterventionRequired;
-(NetworkStatus)currentReachabilityStatus;
-(SCNetworkReachabilityFlags)reachabilityFlags;
-(NSString*)currentReachabilityString;
-(NSString*)currentReachabilityFlags;
@end
File References:
- SampleApp:
- CPAppDelegate.h
- CPAppDelegate.m
- MainMenu.xib:
- en
- Supporting Files:
- SampleApp-Info.plist
- InfoPlist.strings:
- en
- main.m
- SampleApp-Prefix.pch
- Credits.rtf:
- en
- Frameworks:
- Cocoa.framework
- Other Frameworks:
- AppKit.framework
- CoreData.framework
- Foundation.framework
- libPods-SampleApp_1.a
- Products:
- SampleApp.app
- Pods-SampleApp_1.xcconfig
Targets:
- SampleApp_1:
Build Phases:
- SourcesBuildPhase:
- main.m
- CPAppDelegate.m
- FrameworksBuildPhase:
- Cocoa.framework
- libPods-SampleApp_1.a
- ResourcesBuildPhase:
- InfoPlist.strings
- Credits.rtf
- MainMenu.xib
- Copy Pods Resources: []
Build Configurations:
- Debug:
Build Settings:
WRAPPER_EXTENSION: app
COMBINE_HIDPI_IMAGES: 'YES'
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
INFOPLIST_FILE: SampleApp/SampleApp-Info.plist
GCC_PREFIX_HEADER: SampleApp/SampleApp-Prefix.pch
PRODUCT_NAME: $(TARGET_NAME)
Base Configuration: Pods-SampleApp_1.xcconfig
- Release:
Build Settings:
WRAPPER_EXTENSION: app
COMBINE_HIDPI_IMAGES: 'YES'
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
INFOPLIST_FILE: SampleApp/SampleApp-Info.plist
GCC_PREFIX_HEADER: SampleApp/SampleApp-Prefix.pch
PRODUCT_NAME: $(TARGET_NAME)
Base Configuration: Pods-SampleApp_1.xcconfig
Build Configurations:
- Debug:
Build Settings:
CLANG_WARN_ENUM_CONVERSION: 'YES'
GCC_WARN_ABOUT_RETURN_TYPE: 'YES'
GCC_PREPROCESSOR_DEFINITIONS:
- DEBUG=1
- $(inherited)
ONLY_ACTIVE_ARCH: 'YES'
GCC_SYMBOLS_PRIVATE_EXTERN: 'NO'
GCC_WARN_UNINITIALIZED_AUTOS: 'YES'
CLANG_CXX_LANGUAGE_STANDARD: gnu++0x
CLANG_WARN_INT_CONVERSION: 'YES'
MACOSX_DEPLOYMENT_TARGET: '10.8'
CLANG_WARN_CONSTANT_CONVERSION: 'YES'
GCC_OPTIMIZATION_LEVEL: '0'
GCC_C_LANGUAGE_STANDARD: gnu99
CLANG_WARN__DUPLICATE_METHOD_MATCH: 'YES'
GCC_WARN_64_TO_32_BIT_CONVERSION: 'YES'
CLANG_WARN_EMPTY_BODY: 'YES'
ALWAYS_SEARCH_USER_PATHS: 'NO'
COPY_PHASE_STRIP: 'NO'
SDKROOT: macosx
GCC_DYNAMIC_NO_PIC: 'NO'
ARCHS: $(ARCHS_STANDARD_64_BIT)
GCC_ENABLE_OBJC_EXCEPTIONS: 'YES'
CLANG_CXX_LIBRARY: libc++
GCC_WARN_UNUSED_VARIABLE: 'YES'
- Release:
Build Settings:
DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
GCC_WARN_UNUSED_VARIABLE: 'YES'
GCC_C_LANGUAGE_STANDARD: gnu99
GCC_ENABLE_OBJC_EXCEPTIONS: 'YES'
GCC_WARN_UNINITIALIZED_AUTOS: 'YES'
MACOSX_DEPLOYMENT_TARGET: '10.8'
CLANG_WARN__DUPLICATE_METHOD_MATCH: 'YES'
CLANG_WARN_EMPTY_BODY: 'YES'
CLANG_CXX_LANGUAGE_STANDARD: gnu++0x
CLANG_WARN_INT_CONVERSION: 'YES'
CLANG_WARN_CONSTANT_CONVERSION: 'YES'
ARCHS: $(ARCHS_STANDARD_64_BIT)
ALWAYS_SEARCH_USER_PATHS: 'NO'
CLANG_WARN_ENUM_CONVERSION: 'YES'
GCC_WARN_64_TO_32_BIT_CONVERSION: 'YES'
GCC_WARN_ABOUT_RETURN_TYPE: 'YES'
SDKROOT: macosx
COPY_PHASE_STRIP: 'YES'
CLANG_CXX_LIBRARY: libc++
File References:
- SampleApp:
- CPAppDelegate.h
- CPAppDelegate.m
- MainMenu.xib:
- en
- Supporting Files:
- SampleApp-Info.plist
- InfoPlist.strings:
- en
- main.m
- SampleApp-Prefix.pch
- Credits.rtf:
- en
- Frameworks:
- Cocoa.framework
- Other Frameworks:
- AppKit.framework
- CoreData.framework
- Foundation.framework
- libPods-SampleApp_2.a
- Products:
- SampleApp.app
- Pods-SampleApp_2.xcconfig
Targets:
- SampleApp_2:
Build Phases:
- SourcesBuildPhase:
- main.m
- CPAppDelegate.m
- FrameworksBuildPhase:
- Cocoa.framework
- libPods-SampleApp_2.a
- ResourcesBuildPhase:
- InfoPlist.strings
- Credits.rtf
- MainMenu.xib
- Copy Pods Resources: []
- Copy Pods Resources: []
Build Configurations:
- Debug:
Build Settings:
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
INFOPLIST_FILE: SampleApp/SampleApp-Info.plist
COMBINE_HIDPI_IMAGES: 'YES'
GCC_PREFIX_HEADER: SampleApp/SampleApp-Prefix.pch
WRAPPER_EXTENSION: app
PRODUCT_NAME: $(TARGET_NAME)
Base Configuration: Pods-SampleApp_2.xcconfig
- Release:
Build Settings:
GCC_PRECOMPILE_PREFIX_HEADER: 'YES'
INFOPLIST_FILE: SampleApp/SampleApp-Info.plist
COMBINE_HIDPI_IMAGES: 'YES'
GCC_PREFIX_HEADER: SampleApp/SampleApp-Prefix.pch
WRAPPER_EXTENSION: app
PRODUCT_NAME: $(TARGET_NAME)
Base Configuration: Pods-SampleApp_2.xcconfig
Build Configurations:
- Debug:
Build Settings:
CLANG_WARN_ENUM_CONVERSION: 'YES'
GCC_WARN_ABOUT_RETURN_TYPE: 'YES'
GCC_PREPROCESSOR_DEFINITIONS:
- DEBUG=1
- $(inherited)
ONLY_ACTIVE_ARCH: 'YES'
GCC_SYMBOLS_PRIVATE_EXTERN: 'NO'
GCC_WARN_UNINITIALIZED_AUTOS: 'YES'
CLANG_CXX_LANGUAGE_STANDARD: gnu++0x
CLANG_WARN_INT_CONVERSION: 'YES'
MACOSX_DEPLOYMENT_TARGET: '10.8'
CLANG_WARN_CONSTANT_CONVERSION: 'YES'
GCC_OPTIMIZATION_LEVEL: '0'
GCC_C_LANGUAGE_STANDARD: gnu99
CLANG_WARN__DUPLICATE_METHOD_MATCH: 'YES'
GCC_WARN_64_TO_32_BIT_CONVERSION: 'YES'
CLANG_WARN_EMPTY_BODY: 'YES'
ALWAYS_SEARCH_USER_PATHS: 'NO'
COPY_PHASE_STRIP: 'NO'
SDKROOT: macosx
GCC_DYNAMIC_NO_PIC: 'NO'
ARCHS: $(ARCHS_STANDARD_64_BIT)
GCC_ENABLE_OBJC_EXCEPTIONS: 'YES'
CLANG_CXX_LIBRARY: libc++
GCC_WARN_UNUSED_VARIABLE: 'YES'
- Release:
Build Settings:
DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
GCC_WARN_UNUSED_VARIABLE: 'YES'
GCC_C_LANGUAGE_STANDARD: gnu99
GCC_ENABLE_OBJC_EXCEPTIONS: 'YES'
GCC_WARN_UNINITIALIZED_AUTOS: 'YES'
MACOSX_DEPLOYMENT_TARGET: '10.8'
CLANG_WARN__DUPLICATE_METHOD_MATCH: 'YES'
CLANG_CXX_LANGUAGE_STANDARD: gnu++0x
CLANG_WARN_INT_CONVERSION: 'YES'
CLANG_WARN_EMPTY_BODY: 'YES'
ALWAYS_SEARCH_USER_PATHS: 'NO'
CLANG_WARN_CONSTANT_CONVERSION: 'YES'
ARCHS: $(ARCHS_STANDARD_64_BIT)
CLANG_WARN_ENUM_CONVERSION: 'YES'
GCC_WARN_64_TO_32_BIT_CONVERSION: 'YES'
GCC_WARN_ABOUT_RETURN_TYPE: 'YES'
SDKROOT: macosx
COPY_PHASE_STRIP: 'YES'
CLANG_CXX_LIBRARY: libc++
$ pod install --no-update --no-doc --verbose --no-color 2>&1
Analyzing dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `Pods' (iOS 6.0)
Resolving dependencies for target `SampleApp_1' (iOS 6.0)
- Reachability (= 3.1.0)
Resolving dependencies for target `SampleApp_2' (iOS 6.0)
- Reachability
Comparing resolved specification to the sandbox manifest
A Reachability
Downloading dependencies
-> Installing Reachability (3.1.0)
> GitHub download
$ /usr/bin/git config core.bare
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/install_custom_workspace/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
$ /usr/bin/git fetch origin tags/v3.1.0 2>&1
From CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6
* tag v3.1.0 -> FETCH_HEAD
$ /usr/bin/git reset --hard FETCH_HEAD
HEAD is now at f7176f4 updated podspec
$ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit'
- Running pre install hooks
Generating Pods project
- Creating Pods project
- Adding source files to Pods project
- Adding resources to Pods project
- Linking headers
- Installing targets
- Installing target `Pods-SampleApp_1` iOS 6.0
- Adding Build files
- Generating xcconfig file at `Pods/Pods-SampleApp_1.xcconfig`
- Generating target header at `Pods/Pods-SampleApp_1-header.h`
- Generating prefix header at `Pods/Pods-SampleApp_1-prefix.pch`
- Generating copy resources script at `Pods/Pods-SampleApp_1-resources.sh`
- Generating acknowledgements at `Pods/Pods-SampleApp_1-acknowledgements.plist`
- Generating acknowledgements at `Pods/Pods-SampleApp_1-acknowledgements.markdown`
- Generating dummy source file at `Pods/Pods-SampleApp_1-dummy.m`
- Installing target `Pods-SampleApp_2` iOS 6.0
- Adding Build files
- Generating xcconfig file at `Pods/Pods-SampleApp_2.xcconfig`
- Generating target header at `Pods/Pods-SampleApp_2-header.h`
- Generating prefix header at `Pods/Pods-SampleApp_2-prefix.pch`
- Generating copy resources script at `Pods/Pods-SampleApp_2-resources.sh`
- Generating acknowledgements at `Pods/Pods-SampleApp_2-acknowledgements.plist`
- Generating acknowledgements at `Pods/Pods-SampleApp_2-acknowledgements.markdown`
- Generating dummy source file at `Pods/Pods-SampleApp_2-dummy.m`
- Running post install hooks
- Writing Xcode project file to `Pods/Pods.xcodeproj`
- Writing Lockfile in `Podfile.lock`
- Writing Manifest in `Pods/Manifest.lock`
Integrating client projects
[!] From now on use `Workspace.xcworkspace`.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment