Merge branch 'master' into 1ec5-metrics-opt-way-out

This commit is contained in:
Minh Nguyễn
2015-05-12 16:09:10 -07:00
263 changed files with 21691 additions and 91 deletions

View File

@@ -82,14 +82,20 @@ env:
- secure: "nQqSM8rd7OHtV4MqmNqVnkrVHqxKqQsaWRYk4/nPdhbeVWtTtkk0df711LrF1TUtbEPEewHxYUvTZ/UXmwJNeoKdzTHavI8hnatRkgjyxGERPn1il1Otelht9I+LQQHf+plrpRjVWBrNIW0Zox1B3cqn6d3NglpbXrEQ2EjYGNA="
- KIF_SCREENSHOTS="${TRAVIS_BUILD_DIR}/screenshots"
before_install:
- source ./scripts/travis_helper.sh
install:
- ./scripts/${FLAVOR}/install.sh
- source ./scripts/${FLAVOR}/install.sh
before_script:
- if [ -f ./scripts/${FLAVOR}/setup.sh ]; then source ./scripts/${FLAVOR}/setup.sh; fi
script:
- ./scripts/${FLAVOR}/run.sh
after_failure:
- "[ -f scripts/${FLAVOR}/run.sh ] && scripts/${FLAVOR}/run.sh"
- "[ -f ./scripts/${FLAVOR}/after_failure.sh ] && ./scripts/${FLAVOR}/after_failure.sh"
notifications:
slack:

View File

@@ -203,9 +203,10 @@ android-project: android-lib
render: Makefile/project
$(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) mbgl-render
.PHONY: xrender run-xrender
.PHONY: xrender
xrender: XCPRETTY := $(shell ./scripts/xcpretty.sh)
xrender: Xcode/project
xcodebuild -project ./build/osx/gyp/osx.xcodeproj -configuration $(BUILDTYPE) -target mbgl-render -jobs $(JOBS)
xcodebuild -project ./build/osx/gyp/osx.xcodeproj -configuration $(BUILDTYPE) -target mbgl-render -jobs $(JOBS) $(XCPRETTY)
##### Maintenace operations ####################################################

View File

@@ -34,12 +34,11 @@
'ldflags': [
'<@(glfw3_ldflags)',
'<@(uv_ldflags)',
'<@(boost_ldflags)',
'-lboost_program_options'
],
'libraries': [
'<@(glfw3_static_libs)',
'<@(uv_static_libs)',
'<@(boost_program_options_static_libs)'
],
},

7
configure vendored
View File

@@ -46,6 +46,7 @@ case ${MASON_PLATFORM} in
LIBUV_VERSION=0.10.28
ZLIB_VERSION=system
BOOST_VERSION=1.57.0
BOOST_PROGRAM_OPTIONS_VERSION=1.57.0
NUNICODE_VERSION=1.5.1
LIBZIP_VERSION=0.11.2
;;
@@ -104,7 +105,11 @@ CONFIG="# Do not edit. Generated by the configure script.
if [ ! -z ${BOOST_VERSION} ]; then
mason install boost ${BOOST_VERSION}
CONFIG+=" 'boost_cflags%': $(quote_flags $(mason cflags boost ${BOOST_VERSION})),"$LN
CONFIG+=" 'boost_ldflags%': $(quote_flags $(mason ldflags boost ${BOOST_VERSION})),"$LN
fi
if [ ! -z ${BOOST_PROGRAM_OPTIONS_VERSION} ]; then
mason install boost_libprogram_options ${BOOST_PROGRAM_OPTIONS_VERSION}
CONFIG+=" 'boost_program_options_static_libs%': $(quote_flags $(mason static_libs boost_libprogram_options ${BOOST_VERSION})),"$LN
fi
if [ ! -z ${OPENSSL_VERSION} ]; then

View File

@@ -1,5 +1,7 @@
@interface MGLAccountManager : NSObject
+ (void) setMapboxMetricsEnabledSettingShownInApp:(BOOL)showsOptOut;
+ (BOOL) mapboxMetricsEnabledSettingShownInApp;
+ (void) setAccessToken:(NSString *) accessToken;
+ (NSString *) accessToken;

View File

@@ -21,6 +21,9 @@
}
if ( ! accessToken) NSLog(@"No access token set. Mapbox vector tiles won't work.");
// Signal To SDK That Opt Out Is In App UI
// [MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:YES];
// Start Mapbox GL SDK
[MGLAccountManager setAccessToken:accessToken];

View File

@@ -6,6 +6,7 @@
@interface MGLAccountManager()
@property (atomic) BOOL showsOptOutInApp;
@property (atomic) NSString *accessToken;
@end
@@ -23,6 +24,7 @@ static MGLAccountManager *_sharedManager;
if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) {
void (^setupBlock)() = ^{
_sharedManager = [[self alloc] init];
_sharedManager.showsOptOutInApp = NO;
};
if ( ! [[NSThread currentThread] isMainThread]) {
dispatch_sync(dispatch_get_main_queue(), ^{
@@ -37,6 +39,14 @@ static MGLAccountManager *_sharedManager;
return _sharedManager;
}
+ (void) setMapboxMetricsEnabledSettingShownInApp:(BOOL)showsOptOut {
[MGLAccountManager sharedManager].showsOptOutInApp = showsOptOut;
}
+ (BOOL) mapboxMetricsEnabledSettingShownInApp {
return [MGLAccountManager sharedManager].showsOptOutInApp;
}
+ (void) setAccessToken:(NSString *) accessToken {
[[MGLAccountManager sharedManager] setAccessToken:accessToken];

View File

@@ -10,6 +10,7 @@
#import "NSProcessInfo+MGLAdditions.h"
#import "NSBundle+MGLAdditions.h"
#import "NSException+MGLAdditions.h"
#import "MGLAccountManager.m"
#include <sys/sysctl.h>
@@ -176,11 +177,13 @@ const NSTimeInterval MGLFlushInterval = 60;
+ (void)initialize {
if (self == [MGLMapboxEvents class]) {
// Register defaults from DefaultValue entries in Settings.bundle plist.
NSString *appSettingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!appSettingsBundle) {
NSLog(@"Could not find Settings.bundle");
} else {
if (! [MGLAccountManager mapboxMetricsEnabledSettingShownInApp]) {
// Opt Out is not configured in UI, so check for Settings.bundle
// Put Settings bundle into memory
NSString *appSettingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
NSAssert(appSettingsBundle, @"End users must be able to opt out of Metrics in your app, either inside Settings (via Settings.bundle) or inside this app. If you implement the opt-out control inside this app, disable this assertion by setting [MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:YES] before the app initializes any Mapbox GL classes.");
// Dynamic Settings.bundle loading based on:
// http://stackoverflow.com/questions/510216/can-you-make-the-settings-in-settings-bundle-default-even-if-you-dont-open-the
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[appSettingsBundle stringByAppendingPathComponent:@"Root.plist"]];
@@ -192,7 +195,7 @@ const NSTimeInterval MGLFlushInterval = 60;
[defaultsToRegister setObject:[prefSpecification objectForKey:@"DefaultValue"] forKey:key];
}
}
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
}
}

View File

@@ -3,8 +3,6 @@
set -e
set -o pipefail
source ./scripts/travis_helper.sh
mapbox_time "checkout_mason" \
git submodule update --init .mason

View File

@@ -9,8 +9,6 @@ export HOST=android
export MASON_PLATFORM=android
export MASON_ANDROID_ABI=${ANDROID_ABI:-arm-v7}
source ./scripts/travis_helper.sh
# Add Mason to PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"

View File

@@ -3,8 +3,6 @@
set -e
set -o pipefail
source ./scripts/travis_helper.sh
mapbox_time "checkout_mason" \
git submodule update --init .mason
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"

View File

@@ -4,8 +4,6 @@ set -e
set -o pipefail
set -u
source ./scripts/travis_helper.sh
NAME=MapboxGL
OUTPUT=build/ios/pkg
IOS_SDK_VERSION=`xcrun --sdk iphoneos --show-sdk-version`

View File

@@ -6,8 +6,6 @@ set -u
BUILDTYPE=${BUILDTYPE:-Release}
source ./scripts/travis_helper.sh
# Add Mason to PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"

View File

@@ -3,8 +3,6 @@
set -e
set -o pipefail
source ./scripts/travis_helper.sh
mapbox_time "checkout_mason" \
git submodule update --init .mason
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"

View File

@@ -5,34 +5,6 @@ set -o pipefail
BUILDTYPE=${BUILDTYPE:-Release}
source ./scripts/travis_helper.sh
# Add Mason to PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
# Set the core file limit to unlimited so a core file is generated upon crash
ulimit -c unlimited -S
################################################################################
# X Server setup
################################################################################
# Start the mock X server
if [ -f /etc/init.d/xvfb ] ; then
mapbox_time "start_xvfb" \
sh -e /etc/init.d/xvfb start
sleep 2 # sometimes, xvfb takes some time to start up
fi
# Make sure we're connecting to xvfb
export DISPLAY=:99.0
# Make sure we're loading the 10.4.3 libs we installed manually
export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}"
mapbox_time "glxinfo" \
glxinfo
################################################################################
# Build
################################################################################
@@ -43,6 +15,9 @@ git submodule update --init styles
mapbox_time "compile_program" \
make linux -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_render_binary" \
make render -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_tests" \
make test -j${JOBS} BUILDTYPE=${BUILDTYPE}

27
scripts/linux/setup.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
set -o pipefail
# Set the core file limit to unlimited so a core file is generated upon crash
ulimit -c unlimited -S
################################################################################
# X Server setup
################################################################################
# Start the mock X server
if [ -f /etc/init.d/xvfb ] ; then
mapbox_time "start_xvfb" \
sh -e /etc/init.d/xvfb start
sleep 2 # sometimes, xvfb takes some time to start up
fi
# Make sure we're connecting to xvfb
export DISPLAY=:99.0
# Make sure we're loading the 10.4.3 libs we installed manually
export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}"
mapbox_time "glxinfo" \
glxinfo

View File

@@ -3,8 +3,6 @@
set -e
set -o pipefail
source ./scripts/travis_helper.sh
mapbox_time "checkout_mason" \
git submodule update --init .mason
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"

View File

@@ -5,14 +5,6 @@ set -o pipefail
BUILDTYPE=${BUILDTYPE:-Release}
source ./scripts/travis_helper.sh
# Add Mason to PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
# Set the core file limit to unlimited so a core file is generated upon crash
ulimit -c unlimited -S
################################################################################
# Build
################################################################################
@@ -23,5 +15,8 @@ git submodule update --init styles
mapbox_time "compile_program" \
make xosx -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_render_binary" \
make xrender -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_tests" \
make xtest -j${JOBS} BUILDTYPE=${BUILDTYPE}

7
scripts/osx/setup.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
set -o pipefail
# Set the core file limit to unlimited so a core file is generated upon crash
ulimit -c unlimited -S

View File

@@ -4,6 +4,8 @@
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
#include <mbgl/util/std.hpp>
#include <cassert>
#include <algorithm>
@@ -14,7 +16,7 @@ GlyphAtlas::GlyphAtlas(uint16_t width_, uint16_t height_)
: width(width_),
height(height_),
bin(width_, height_),
data(new char[width_ *height_]),
data(util::make_unique<uint8_t[]>(width_ * height_)),
dirty(true) {
}
@@ -88,13 +90,12 @@ Rect<uint16_t> GlyphAtlas::addGlyph(uintptr_t tileUID,
face.emplace(glyph.id, GlyphValue { rect, tileUID });
// Copy the bitmap
char *target = data.get();
const char *source = glyph.bitmap.data();
const uint8_t* source = reinterpret_cast<const uint8_t*>(glyph.bitmap.data());
for (uint32_t y = 0; y < buffered_height; y++) {
uint32_t y1 = width * (rect.y + y) + rect.x;
uint32_t y2 = buffered_width * y;
for (uint32_t x = 0; x < buffered_width; x++) {
target[y1 + x] = source[y2 + x];
data[y1 + x] = source[y2 + x];
}
}
@@ -116,7 +117,7 @@ void GlyphAtlas::removeGlyphs(uintptr_t tileUID) {
const Rect<uint16_t>& rect = value.rect;
// Clear out the bitmap.
char *target = data.get();
uint8_t *target = data.get();
for (uint32_t y = 0; y < rect.h; y++) {
uint32_t y1 = width * (rect.y + y) + rect.x;
for (uint32_t x = 0; x < rect.w; x++) {

View File

@@ -49,7 +49,7 @@ private:
std::mutex mtx;
BinPack<uint16_t> bin;
std::map<std::string, std::map<uint32_t, GlyphValue>> index;
std::unique_ptr<char[]> data;
const std::unique_ptr<uint8_t[]> data;
std::atomic<bool> dirty;
uint32_t texture = 0;
};

View File

@@ -3,6 +3,7 @@
#include <mbgl/platform/gl.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
#include <mbgl/util/std.hpp>
#include <boost/functional/hash.hpp>
@@ -14,7 +15,7 @@ using namespace mbgl;
LineAtlas::LineAtlas(uint16_t w, uint16_t h)
: width(w),
height(h),
data(new char[w * h]),
data(util::make_unique<uint8_t[]>(w * h)),
dirty(true) {
}
@@ -23,8 +24,6 @@ LineAtlas::~LineAtlas() {
Environment::Get().abandonTexture(texture);
texture = 0;
delete[] data;
}
LinePatternPos LineAtlas::getDashPosition(const std::vector<float> &dasharray, bool round) {
@@ -162,7 +161,7 @@ void LineAtlas::bind() {
0, // GLint border
GL_ALPHA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
data // const GLvoid * data
data.get() // const GLvoid * data
));
} else {
MBGL_CHECK_ERROR(glTexSubImage2D(
@@ -174,7 +173,7 @@ void LineAtlas::bind() {
height, // GLsizei height
GL_ALPHA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
data // const GLvoid *pixels
data.get() // const GLvoid *pixels
));
}

View File

@@ -34,7 +34,7 @@ public:
private:
std::recursive_mutex mtx;
char *const data = nullptr;
const std::unique_ptr<uint8_t[]> data;
std::atomic<bool> dirty;
uint32_t texture = 0;
int nextRow = 0;

View File

@@ -33,9 +33,7 @@ bool SpriteAtlas::resize(const float newRatio) {
pixelRatio = newRatio;
if (data) {
uint32_t *old_data = data;
data = nullptr;
const auto oldData = std::move(data);
allocate();
const int old_w = width * oldRatio;
@@ -44,19 +42,15 @@ bool SpriteAtlas::resize(const float newRatio) {
const int new_h = height * newRatio;
// Basic image scaling. TODO: Replace this with better image scaling.
uint32_t *img_new = reinterpret_cast<uint32_t *>(data);
const uint32_t *img_old = reinterpret_cast<const uint32_t *>(old_data);
for (int y = 0; y < new_h; y++) {
const int old_yoffset = ((y * old_h) / new_h) * old_w;
const int new_yoffset = y * new_w;
for (int x = 0; x < new_w; x++) {
const int old_x = (x * old_w) / new_w;
img_new[new_yoffset + x] = img_old[old_yoffset + old_x];
data[new_yoffset + x] = oldData[old_yoffset + old_x];
}
}
::operator delete(old_data);
dirty = true;
fullUploadRequired = true;
@@ -144,8 +138,8 @@ void SpriteAtlas::allocate() {
if (!data) {
dimension w = static_cast<dimension>(width * pixelRatio);
dimension h = static_cast<dimension>(height * pixelRatio);
data = static_cast<uint32_t*>(::operator new(w * h * sizeof(uint32_t)));
std::fill(data, data + w * h, 0);
data = util::make_unique<uint32_t[]>(w * h);
std::fill(data.get(), data.get() + w * h, 0);
}
}
@@ -158,7 +152,7 @@ void SpriteAtlas::copy(const Rect<dimension>& dst, const SpritePosition& src, co
const Rect<uint32_t> srcPos { src.x, src.y, src.width, src.height };
allocate();
uint32_t *dstData = reinterpret_cast<uint32_t *>(data);
uint32_t *const dstData = data.get();
const vec2<uint32_t> dstSize { static_cast<unsigned int>(width * pixelRatio),
static_cast<unsigned int>(height * pixelRatio) };
const Rect<uint32_t> dstPos { static_cast<uint32_t>(dst.x * pixelRatio),
@@ -274,7 +268,7 @@ void SpriteAtlas::bind(bool linear) {
0, // GLint border
GL_RGBA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
data // const GLvoid * data
data.get() // const GLvoid * data
));
fullUploadRequired = false;
} else {
@@ -287,7 +281,7 @@ void SpriteAtlas::bind(bool linear) {
height * pixelRatio, // GLsizei height
GL_RGBA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
data // const GLvoid *pixels
data.get() // const GLvoid *pixels
));
}
@@ -303,5 +297,4 @@ SpriteAtlas::~SpriteAtlas() {
std::lock_guard<std::recursive_mutex> lock(mtx);
Environment::Get().abandonTexture(texture);
texture = 0;
::operator delete(data), data = nullptr;
}

View File

@@ -77,7 +77,7 @@ private:
util::ptr<Sprite> sprite;
std::map<std::string, Rect<dimension>> images;
std::set<std::string> uninitialized;
uint32_t *data = nullptr;
std::unique_ptr<uint32_t[]> data;
std::atomic<bool> dirty;
bool fullUploadRequired = true;
uint32_t texture = 0;

View File

@@ -277,6 +277,7 @@ void Painter::render(const Style& style, TransformState state_, TimePoint time)
}
} else {
const gl::group group("background");
setStrata(i * strata_thickness);
renderBackground(item.layer);
}
}

2
styles

Submodule styles updated: 81be4f715e...93a23d7623

View File

@@ -1,5 +1,6 @@
#import "MGLTAppDelegate.h"
#import "MGLTViewController.h"
#import "MapboxGL.h"
@implementation MGLTAppDelegate
@@ -12,6 +13,8 @@
wrapper.toolbarHidden = YES;
[self.window makeKeyAndVisible];
[MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:YES]; // a lie, but a convenient one
return YES;
}

288
test/ios/MetricsTests.m Normal file
View File

@@ -0,0 +1,288 @@
#import "MGLMapboxEvents.h"
#import "KIFTestActor+MapboxGL.h"
#import <KIF/KIF.h>
#import <OCMock/OCMock.h>
#import "MapboxGL.h"
#import "OHHTTPStubs.h"
@interface MGLMapboxEvents (Testing)
+ (instancetype)sharedManager;
- (NSString *)appBundleId;
- (NSString *)token;
- (BOOL)isPaused;
- (NSURLSession *)session;
- (void)pushEvent:(NSString *)event withAttributes:(NSDictionary *)attributeDictionary;
- (NSMutableArray *)eventQueue;
- (void)postEvents:(NSArray *)events;
- (NSTimer *)timer;
- (NSUInteger)flushAt;
- (NSTimeInterval)flushAfter;
- (void)setFlushAfter:(NSTimeInterval)newFlushAfter;
- (void)flush;
- (void)startTimer;
@end
@interface MetricsTests : KIFTestCase
@property (nonatomic) NSTimeInterval defaultFlushAfter;
@end
@implementation MetricsTests
- (void)beforeAll {
[tester acknowledgeSystemAlert];
self.defaultFlushAfter = [[MGLMapboxEvents sharedManager] flushAfter];
}
- (void)beforeEach {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"MGLMapboxMetricsEnabled"];
[MGLMapboxEvents resumeMetricsCollection];
[MGLAccountManager setAccessToken:@"pk.eyJ1IjoianVzdGluIiwiYSI6IlpDbUJLSUEifQ.4mG8vhelFMju6HpIY-Hi5A"];
[[MGLMapboxEvents sharedManager] setFlushAfter:self.defaultFlushAfter];
}
- (void)afterEach {
[MGLMapboxEvents pauseMetricsCollection];
}
- (void)pushFakeEvent {
[MGLMapboxEvents pushEvent:@"test_event" withAttributes:@{ @"foo" : @"one", @"bar" : @(2) }];
}
- (void)testAppBundleID {
XCTAssertEqualObjects([[MGLMapboxEvents sharedManager] appBundleId], @"com.mapbox.Mapbox-GL-Tests");
}
- (void)testTokenSetViaMapView {
[tester.mapView setAccessToken:@"test_token"];
XCTAssertEqualObjects([[MGLMapboxEvents sharedManager] token], @"test_token");
}
- (void)testResumeMetricsCollection {
[MGLMapboxEvents resumeMetricsCollection];
XCTAssertFalse([[MGLMapboxEvents sharedManager] isPaused]);
XCTAssertNotNil([[MGLMapboxEvents sharedManager] session]);
}
- (void)testPauseMetricsCollection {
[MGLMapboxEvents pauseMetricsCollection];
XCTAssertTrue([[MGLMapboxEvents sharedManager] isPaused]);
XCTAssertNil([[MGLMapboxEvents sharedManager] session]);
}
- (void)testFlushAtThreshold {
NSUInteger startCount = [[[MGLMapboxEvents sharedManager] eventQueue] count];
NSUInteger flushAt = [[MGLMapboxEvents sharedManager] flushAt];
XCTestExpectation *queueItemsExpectation = [self expectationWithDescription:@"queue should contain events"];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
while (true) {
if ([[[MGLMapboxEvents sharedManager] eventQueue] count] > 0) {
[queueItemsExpectation fulfill];
break;
}
}
});
for (NSUInteger i = 0; i < (flushAt - startCount - 1); i++) {
[self pushFakeEvent];
}
[self waitForExpectationsWithTimeout:1.0 handler:nil];
XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
while (true) {
if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
[emptyQueueExpectation fulfill];
break;
}
}
});
[self pushFakeEvent];
[self waitForExpectationsWithTimeout:1.0 handler:nil];
}
- (void)testTimerDestroyedAfterFlush {
XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
while (true) {
if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
[emptyQueueExpectation fulfill];
break;
}
}
});
[[MGLMapboxEvents sharedManager] flush];
[self waitForExpectationsWithTimeout:1.0 handler:nil];
XCTAssertNil([[MGLMapboxEvents sharedManager] timer]);
}
- (void)testTimerCreatedAfterEventPushed {
XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
while (true) {
if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
[emptyQueueExpectation fulfill];
break;
}
}
});
[[MGLMapboxEvents sharedManager] flush];
[self waitForExpectationsWithTimeout:1.0 handler:nil];
[[MGLMapboxEvents sharedManager] setFlushAfter:5];
id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]];
[[[eventsMock expect] andForwardToRealObject] startTimer];
[self pushFakeEvent];
[eventsMock verifyWithDelay:0.1];
XCTAssertEqual([[[MGLMapboxEvents sharedManager] eventQueue] count], 1);
XCTAssertNotNil([[MGLMapboxEvents sharedManager] timer]);
XCTAssertEqual([[MGLMapboxEvents sharedManager] flushAfter], [[[MGLMapboxEvents sharedManager] timer] timeInterval]);
}
- (void)testTimerFiresFlush {
XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
while (true) {
if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
[emptyQueueExpectation fulfill];
break;
}
}
});
[[MGLMapboxEvents sharedManager] flush];
[self waitForExpectationsWithTimeout:1.0 handler:nil];
[[MGLMapboxEvents sharedManager] setFlushAfter:5];
[self pushFakeEvent];
id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]];
[[eventsMock expect] flush];
[eventsMock verifyWithDelay:[[MGLMapboxEvents sharedManager] flushAfter]];
}
- (void)testFlushPostsEvents {
NSArray *events = [NSArray arrayWithArray:[[MGLMapboxEvents sharedManager] eventQueue]];
id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]];
[[eventsMock expect] postEvents:events];
[[MGLMapboxEvents sharedManager] flush];
[eventsMock verifyWithDelay:1.0];
XCTAssertTrue([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0);
}
- (void)testPostEventsNetworkRequest {
XCTestExpectation *requestExpectation = [self expectationWithDescription:@"posting events generates network request"];
XCTestExpectation *contentTypeExpectation = [self expectationWithDescription:@"events are posted as JSON"];
XCTestExpectation *userAgentExpectation = [self expectationWithDescription:@"events are posted with proper user agent"];
[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
return [request.URL.path hasPrefix:@"/events/v1"];
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
if ([request.URL.absoluteString isEqualToString:[@"https://api.tiles.mapbox.com/events/v1?access_token=" stringByAppendingString:[MGLAccountManager accessToken]]]) {
[requestExpectation fulfill];
}
if ([request.allHTTPHeaderFields[@"Content-Type"] isEqualToString:@"application/json"]) {
[contentTypeExpectation fulfill];
}
if ([request.allHTTPHeaderFields[@"User-Agent"] isEqualToString:[NSString stringWithFormat:@"%@/1.0/1.0 MapboxEventsiOS/1.0", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]]]) {
[userAgentExpectation fulfill];
}
return nil;
}];
[self pushFakeEvent];
[MGLMapboxEvents flush];
[self waitForExpectationsWithTimeout:1.0 handler:nil];
}
- (void)testPushEventAddsToEventQueue {
XCTestExpectation *queueSizeIncreaseExpectation = [self expectationWithDescription:@"event queue size increase"];
NSUInteger beforeCount = [[[MGLMapboxEvents sharedManager] eventQueue] count];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
while (true) {
if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == (beforeCount + 1)) {
[queueSizeIncreaseExpectation fulfill];
break;
}
}
});
[self pushFakeEvent];
[self waitForExpectationsWithTimeout:1.0 handler:nil];
}
- (void)testOptOutUpfrontDisablesMetrics {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"MGLMapboxMetricsEnabled"];
NSUInteger startingCount = [[[MGLMapboxEvents sharedManager] eventQueue] count];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
while (true) {
if ([[[MGLMapboxEvents sharedManager] eventQueue] count] > startingCount) {
XCTFail(@"queue should not receive events when opted-out");
break;
}
}
});
[self pushFakeEvent];
[tester waitForTimeInterval:1.0];
}
- (void)testOptOutAtRuntimeDisablesMetrics {
XCTAssertTrue([[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsEnabled"]);
[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
return [request.URL.path hasPrefix:@"/events/v1"];
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
XCTFail(@"opt-out should not post events");
return nil;
}];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"MGLMapboxMetricsEnabled"];
[self pushFakeEvent];
[[MGLMapboxEvents sharedManager] flush];
[tester waitForTimeInterval:1.0];
}
@end

View File

@@ -0,0 +1,26 @@
/*
* Copyright (c) 2009-2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@class OCObserverMockObject;
@interface NSNotificationCenter(OCMAdditions)
- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender;
@end

View File

@@ -0,0 +1,53 @@
/*
* Copyright (c) 2009-2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@interface OCMArg : NSObject
// constraining arguments
+ (id)any;
+ (SEL)anySelector;
+ (void *)anyPointer;
+ (id __autoreleasing *)anyObjectRef;
+ (id)isNil;
+ (id)isNotNil;
+ (id)isEqual:(id)value;
+ (id)isNotEqual:(id)value;
+ (id)isKindOfClass:(Class)cls;
+ (id)checkWithSelector:(SEL)selector onObject:(id)anObject;
+ (id)checkWithBlock:(BOOL (^)(id obj))block;
// manipulating arguments
+ (id *)setTo:(id)value;
+ (void *)setToValue:(NSValue *)value;
// internal use only
+ (id)resolveSpecialValues:(NSValue *)value;
@end
#define OCMOCK_ANY [OCMArg any]
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#define OCMOCK_VALUE(variable) \
({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; })
#else
#define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))]
#endif

View File

@@ -0,0 +1,71 @@
/*
* Copyright (c) 2007-2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@interface OCMConstraint : NSObject
+ (instancetype)constraint;
- (BOOL)evaluate:(id)value;
// if you are looking for any, isNil, etc, they have moved to OCMArg
// try to use [OCMArg checkWith...] instead of the constraintWith... methods below
+ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject;
+ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue;
@end
@interface OCMAnyConstraint : OCMConstraint
@end
@interface OCMIsNilConstraint : OCMConstraint
@end
@interface OCMIsNotNilConstraint : OCMConstraint
@end
@interface OCMIsNotEqualConstraint : OCMConstraint
{
@public
id testValue;
}
@end
@interface OCMInvocationConstraint : OCMConstraint
{
@public
NSInvocation *invocation;
}
@end
@interface OCMBlockConstraint : OCMConstraint
{
BOOL (^block)(id);
}
- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block;
@end
#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self]
#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)]

View File

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@interface OCMLocation : NSObject
{
id testCase;
NSString *file;
NSUInteger line;
}
+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (id)testCase;
- (NSString *)file;
- (NSUInteger)line;
@end
extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c) 2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@class OCMLocation;
@class OCMRecorder;
@class OCMStubRecorder;
@class OCMockObject;
@interface OCMMacroState : NSObject
{
OCMRecorder *recorder;
}
+ (void)beginStubMacro;
+ (OCMStubRecorder *)endStubMacro;
+ (void)beginExpectMacro;
+ (OCMStubRecorder *)endExpectMacro;
+ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation;
+ (void)endVerifyMacro;
+ (OCMMacroState *)globalState;
- (OCMRecorder *)recorder;
- (void)switchToClassMethod;
@end

View File

@@ -0,0 +1,39 @@
/*
* Copyright (c) 2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@class OCMockObject;
@class OCMInvocationMatcher;
@interface OCMRecorder : NSProxy
{
OCMockObject *mockObject;
OCMInvocationMatcher *invocationMatcher;
}
- (instancetype)init;
- (instancetype)initWithMockObject:(OCMockObject *)aMockObject;
- (void)setMockObject:(OCMockObject *)aMockObject;
- (OCMInvocationMatcher *)invocationMatcher;
- (id)classMethod;
- (id)ignoringNonObjectArgs;
@end

View File

@@ -0,0 +1,56 @@
/*
* Copyright (c) 2004-2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import "OCMRecorder.h"
@interface OCMStubRecorder : OCMRecorder
- (id)andReturn:(id)anObject;
- (id)andReturnValue:(NSValue *)aValue;
- (id)andThrow:(NSException *)anException;
- (id)andPost:(NSNotification *)aNotification;
- (id)andCall:(SEL)selector onObject:(id)anObject;
- (id)andDo:(void (^)(NSInvocation *invocation))block;
- (id)andForwardToRealObject;
@end
@interface OCMStubRecorder (Properties)
#define andReturn(aValue) _andReturn(({ __typeof__(aValue) _v = (aValue); [NSValue value:&_v withObjCType:@encode(__typeof__(_v))]; }))
@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *);
#define andThrow(anException) _andThrow(anException)
@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *);
#define andPost(aNotification) _andPost(aNotification)
@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *);
#define andCall(anObject, aSelector) _andCall(anObject, aSelector)
@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL);
#define andDo(aBlock) _andDo(aBlock)
@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *));
#define andForwardToRealObject() _andForwardToRealObject()
@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void);
@end

View File

@@ -0,0 +1,84 @@
/*
* Copyright (c) 2004-2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <OCMock/OCMockObject.h>
#import <OCMock/OCMRecorder.h>
#import <OCMock/OCMStubRecorder.h>
#import <OCMock/OCMConstraint.h>
#import <OCMock/OCMArg.h>
#import <OCMock/OCMLocation.h>
#import <OCMock/OCMMacroState.h>
#import <OCMock/NSNotificationCenter+OCMAdditions.h>
#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls]
#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls]
#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol]
#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol]
#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj]
#define OCMObserverMock() [OCMockObject observerMock]
#define OCMStub(invocation) \
({ \
_OCMSilenceWarnings( \
[OCMMacroState beginStubMacro]; \
invocation; \
[OCMMacroState endStubMacro]; \
); \
})
#define OCMExpect(invocation) \
({ \
_OCMSilenceWarnings( \
[OCMMacroState beginExpectMacro]; \
invocation; \
[OCMMacroState endExpectMacro]; \
); \
})
#define ClassMethod(invocation) \
_OCMSilenceWarnings( \
[[OCMMacroState globalState] switchToClassMethod]; \
invocation; \
);
#define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]
#define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)]
#define OCMVerify(invocation) \
({ \
_OCMSilenceWarnings( \
[OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \
invocation; \
[OCMMacroState endVerifyMacro]; \
); \
})
#define _OCMSilenceWarnings(macro) \
({ \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunused-value\"") \
macro \
_Pragma("clang diagnostic pop") \
})

View File

@@ -0,0 +1,74 @@
/*
* Copyright (c) 2004-2014 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@class OCMLocation;
@class OCMInvocationStub;
@class OCMStubRecorder;
@class OCMInvocationMatcher;
@class OCMInvocationExpectation;
@interface OCMockObject : NSProxy
{
BOOL isNice;
BOOL expectationOrderMatters;
NSMutableArray *stubs;
NSMutableArray *expectations;
NSMutableArray *exceptions;
NSMutableArray *invocations;
}
+ (id)mockForClass:(Class)aClass;
+ (id)mockForProtocol:(Protocol *)aProtocol;
+ (id)partialMockForObject:(NSObject *)anObject;
+ (id)niceMockForClass:(Class)aClass;
+ (id)niceMockForProtocol:(Protocol *)aProtocol;
+ (id)observerMock;
- (instancetype)init;
- (void)setExpectationOrderMatters:(BOOL)flag;
- (id)stub;
- (id)expect;
- (id)reject;
- (id)verify;
- (id)verifyAtLocation:(OCMLocation *)location;
- (void)verifyWithDelay:(NSTimeInterval)delay;
- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location;
- (void)stopMocking;
// internal use only
- (void)addStub:(OCMInvocationStub *)aStub;
- (void)addExpectation:(OCMInvocationExpectation *)anExpectation;
- (BOOL)handleInvocation:(NSInvocation *)anInvocation;
- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation;
- (BOOL)handleSelector:(SEL)sel;
- (void)verifyInvocation:(OCMInvocationMatcher *)matcher;
- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location;
@end

BIN
test/ios/OCMock/libOCMock.a Normal file

Binary file not shown.

15
test/ios/OHHTTPStubs/.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
.DS_Store
*.xccheckout

View File

@@ -0,0 +1,14 @@
language: objective-c
before_install:
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
env:
#- RAKETASK="simlist"
#- RAKETASK="ios[iOS StaticLib,7.1,test]"
- RAKETASK="ios[iOS StaticLib,latest,test]"
- RAKETASK="ios[iOS Framework,latest,analyze]"
- RAKETASK="osx[Mac Framework,x86_64,test]"
script:
- rake "$RAKETASK"

View File

@@ -0,0 +1,226 @@
_You can download previous versions [here](https://github.com/AliSoftware/OHHTTPStubs/tags) and latest version [here](https://github.com/AliSoftware/OHHTTPStubs/zipball/master) (ZIP files generated by GitHub on the fly)_
## [4.0.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/4.0.1)
* Fix threading in `NSURLProtocol` subclass calling `NSURLProtocolClient` callbacks from wrong thread. ([@nsprogrammer](https://github.com/nsprogrammer), [#96](https://github.com/AliSoftware/OHHTTPStubs/pull/96))
## [4.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/4.0.0) — Improvements for Swift
* Annotated the library with _nullability_ attributes to generate a better API when used in Swift
* Migrated the path utility macros to functions in `OHPathHelpers.h`, for Swift compatibility ([#100](https://github.com/AliSoftware/OHHTTPStubs/issues/100)).
* Added a complete Swift Demo Project ([#88](https://github.com/AliSoftware/OHHTTPStubs/issues/88))
* Removed the `XCTestExpectation` subspec that was added for Xcode 5 support — Now that Xcode 6 is widely adopted, you shouldn't need this anymore (but in case you still need it, I will probably create a dedicated pod for that)
## [3.1.12](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.12)
* Fixed issue with HTTP 300 return code (multiple-choice) that is not supposed to redirect. ([@tarbrain](https://github.com/tarbrain), [#92](https://github.com/AliSoftware/OHHTTPStubs/pull/92))
## [3.1.11](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.11)
* Added [Carthage](https://github.com/Carthage/Carthage) support
* Splitted the Xcode projects for more clarity (one dedicated to build the lib and run Unit Tests, and one for the Demo)
* Got rid of the `git submodule` used for Unit Tests against [AFNetworking](https://github.com/AFNetworking/AFNetworking) — it is now imported using [CocoaPods](http://cocoapods.org) and only for the lib's Unit Tests targets ([@corinnekrych](https://github.com/corinnekrych), [#90](https://github.com/AliSoftware/OHHTTPStubs/pull/90))
* Improved [Travis-CI](https://travis-ci.org/AliSoftware/OHHTTPStubs) integration. We now use a build matrix to have paralellized and independant builds for each scheme (iOS Static Lib, iOS Dynamic Framework, OSX Framework)
* Fixed [#80](https://github.com/AliSoftware/OHHTTPStubs/issues/80) again (there was still an issue for people using Xcode 5 & SDK 7.1… if those people still exists)
## [3.1.10](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.10)
* Fix headers for people still building with Xcode 5 & SDK 7 ([#80](https://github.com/AliSoftware/OHHTTPStubs/issues/80))
## [3.1.9](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.9)
* Use `NS_DESIGNATED_INITIALIZER` macro on designated initializer methods ([#79](https://github.com/AliSoftware/OHHTTPStubs/pull/79))
## [3.1.8](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.8)
* Use `application/json` instead of `text/json` in `README`'s example ([#75](https://github.com/AliSoftware/OHHTTPStubs/pull/75))
* Fixed an issue with empty files (when using `responseWithFileAtPath:statusCode:headers:` but the file at the specified path is empty)
## [3.1.7](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.7)
* Added `DEFINES_MODULE` Flag to be easily imported in Swift ([#74](https://github.com/AliSoftware/OHHTTPStubs/pull/74))
_(I also moved [Travis-CI build system](https://travis-ci.org/AliSoftware/OHHTTPStubs) so it now uses `xcpretty` instead of `xctool` to run Unit Tests)_
## [3.1.6](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.6)
* Fixed issue with the main thread stalling when an `NSException` was raised in the response block
* Fixed an issue with `OHHTTPStubs/XCTestExpectation` conditional compilation in Xcode 6.0 & OSX SDK.
_(the condition was previously testing available SDKs instead of Xcode version, which led to errors with Xcode 6.0 not having the latest 10.10 SDK yet, but still having the `XCTestExpectation` already anyway)_
## [3.1.5](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.5)
* Migrated Unit Tests to XCTest.
* Added `XCTestExpectation` subspec containing my own implementation for Xcode 5 support
## [3.1.4](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.4)
* Fix issue that made stubs never being called on iOS8 (#65).
> _As of Xcode6 Beta4, **`OHHTTPStubs` compatibility with iOS8** has been validated now._
## [3.1.3](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.3)
* Fix #66: Use the ivar directly in initialization (to avoid KVO side effects)
## [3.1.2](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.2)
* Fix broken link in README (#61)
* Don't override Content-Length header when already set (#62)
## [3.1.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.1)
* Fixing a crash when using very very long data #57/#59
* Fixing issue #51 regarding a probable race condition when stubs were removed before the request has finished
* Shorten the README.md file and moved all the usage examples in a dedicated wiki page to avoid a endless and frightening README
## [3.1.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.0)
* The `OHHTTPStubsDescriptor` protocol now inherits from the `NSObject` protocol
## [3.0.4](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.4)
Fixing issue #47 when stubs were not called, especially when the `OHHTTPStubs` pod were loaded both by the application AND the test target/bundle. See also [[A tricky case with Application Tests]].
* `NSURLSessionConfiguration` 's swizzling (to add automatic support of `OHHTTPStubs` to `NSURLSession`) is now done in the `+load` method of an `NSURLSessionConfiguration` category, to be sure it is loaded (and swizzled) only once, even if `OHHTTPStubs` is loaded by two different bundles.
* The stubs activation of `NSURLSessionConfiguration` no longer uses `objc_getClass` but uses a call to the `OHHTTPStubs` class instead, which ensure that it uses the correct `OHHTTPStubs` class in the current bundle instead of always using the one loaded from the main bundle.
## [3.0.3](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.3)
* Adding Mac framework & Mac Test Target (#44)
* Adding known limitations in README
## [3.0.2](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.2)
* Fixed issue with cookies when `request.URL` is `nil` ([#39](https://github.com/AliSoftware/OHHTTPStubs/pull/39))
* Fixed missing `-ObjC` flag in Unit Tests target _(that made it unable to call category methods)_
* Fixed Unit Tests on iOS6 _(`NSURLSession`-related Unit Tests now only executed when run on iOS7+ or OSX10.9+, and skipped if targeted for an earlier OS version, as `NSURLSession` was not available then)_
## [3.0.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.1)
* Fixed issue with `NSURLSessionConfiguration` auto-swizzling (#37 & #38)
> _Now `OHHTTPStubs` automagically works with `NSURLSessionConfiguration` **without the need** to enable it for every `NSURLSessionConfiguration` before creating the `NSURLSession`: the `defaultSessionConfiguration` and `ephemeralSessionConfiguration` are now preconfigured automatically to work with `OHHTTPStubs`)_
## [3.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.0)
* Removed deprecated methods.
> The Old API has now totally disappeared, leaving only a clean and simple API without the spam due to old deprecated methods.
Note: **If you have already removed the calls to all `OHHTTPStubs` deprecated API in your code, you can switch to this `3.0.0` version without any further changes in your code**.
## [2.4.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.4.0)
* Added support for `NSURLSession` (thx to @ndonald2) [#31](https://github.com/AliSoftware/OHHTTPStubs/issues/31) [#34](https://github.com/AliSoftware/OHHTTPStubs/issues/34)
## [2.3.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.3.1)
* Fixed bug with OHHTTPStubsResponse+JSON when `nil` headers dictionary
## [2.3.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.3.0)
* Added the ability to give a name to a stub, for debugging purposes (property `name` of `id<OHHTTPStubsDescriptor>`)
* Added `allStubs` method to list all installed stubs (with their name if they have one, see previous point)
* Added `+[OHHTTPStubs onStubActivation:]` method to execute arbitrary code each time a stub is activated. Useful to log which stub is used for each request for example.
## [2.2.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.2.1)
* Complete refactoring to use `NSInputStream` instead of direct use of `NSData` (Thanks to @kcharwood - #28)
* Some other code refactoring to split the code in categories and make it clearer
* Some API changes to make `OHHTTPStubs` to fit the new possibility of setting both `requestTime` and `responseTime`.
* Old API is still there but deprecated, and will be removed in next major version
* To convert to the new API, you will mainly simply:
* extract the `responseTime:` parameter to a method call of its own (`return [OHHTTPStubsResponse responseWithData:data statusCode:code responseTime:time headers:header];` will become `return [[OHHTTPStubsResponse responseWithData:data statusCode:code headers:headers] responseTime:time];` etc.)
* convert `responseWithFile:filename` to `responseWithFileAtPath:OHPathForFileInBundle(filename,nil)`
> Note: version `2.1.0-RC`, `2.1.0-rc.1`, `2.2.0-RC` and `2.2.1-RC` were intermediate Release Candidate versions during the big refactoring and migration to `2.2.1`, with the same new features as listed above basicaly, but without the last-minute bugfixes before official release.
## [2.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.0.0)
* Simplified API
* removed instance methods, no more public `sharedInstance`: directly call class methods on the `OHHTTPStubs` class
* The old and problematic `addRequestHandler:` method has been deprecated and should not be used anymore. Use `stubRequestsPassingTest:withStubResponse:` instead, which is more efficient
* Added API documentation in the headers
* Remove all internal uses of Apple's private APIs
> _Be careful: if you forgot to remove your use of `OHHTTPStubs` and your stubs from the binary you sent to the AppStore, your app would have been rejected by Apple before 2.0.0, as it was using private API (which was a way to make sure not to forget to remove them), but now it would be accepted silently. So don't forget to remove your stubs and `OHHTTPStubs` from your final binary!_
## [1.2.2](https://github.com/AliSoftware/OHHTTPStubs/tree/1.2.2)
* Fixed Deadlock introduced by 1.2.1
## [1.2.1](https://github.com/AliSoftware/OHHTTPStubs/tree/1.2.1)
* Improved thread-safety (#21)
* Stop sending messages to `NSURLProtoclClient` after `stopLoading`
> _This version is buggy as it introduced a deadlock when performing a request on the main thread. 1.2.2 fixes that issue._
## [1.2.0](https://github.com/AliSoftware/OHHTTPStubs/tree/1.2.0)
* Added support for "HTTP Message Data" stubs generated with `curl -is <someurl>` to replay them easily (#27). See the `README.md` for more info
* Added redirect support for 3xx response codes (#23)
* Dropped non-ARC support. Now `OHHTTPStubs` is to be compiled using ARC. _(This should not change anything as it is intended to be integrated using CocoaPods or compiled in a separate xcodeproj anyway)_
## [1.1.2](https://github.com/AliSoftware/OHHTTPStubs/tree/1.1.2)
Easier integration process:
* Use `#import <OHHTTPStubs/OHHTTPStubs.h>` again
* But adding the path to the library headers in your application project's `HEADER_SEARCH_PATH` is no longer needed!
## [1.1.1](https://github.com/AliSoftware/OHHTTPStubs/tree/1.1.1)
* Fixed crash when calling "setEnabled:" / "registerClass:" multiple times
* New integration process: we don't use the `PortableLibrary.xcconfig` anymore (as it generated problems for people using configuration with names other than "Debug" and "Release"). _(1)_
_You will now have to indicate the folder containing headers for `OHHTTPStubs` in your `HEADER_SEARCH_PATH` Build Settings, and we are back to `#import "OHHTTPStubs.h"` until a better solution is found_
> _(1) This modification for the integration process did only last for version 1.1.1. Version 1.1.2 restored `#import <OHHTTPStubs/OHHTTPStubs.h>` (but using a much better solution than the previous xcconfig used) and filling `HEADER_SEARCH_PATH` is no longer needed in further versions. See changelog for 1.1.2 above._
## [1.1.0](https://github.com/AliSoftware/OHHTTPStubs/tree/1.1.0)
* Added new API `shouldStubRequest:withRequestHandler:` to avoid useless building of stubbed response like `addRequestHandler:` does
## [1.0.6](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.6)
* Adding support for cookies (Set-Cookie headers)
## [1.0.5](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.5)
* Added Unit Tests
* Removed calls to the deprecated `dispatch_get_current_queue()` GCD function (was used with `dispatch_after` to add fake delay to stubbed responses)
## [1.0.4](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.4)
* Fixed #6 : "responseWithError:" released response object too soon
## [1.0.3](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.3)
* Fixed small compilation issues #4 (issue in sample code) & #5 (ARC invalid cast)
## [1.0.2](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.2)
* Embedded `OHHTTPStubs` in a neat static library for nicer integration in your Xcode4 workspaces.
## [1.0.1](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.1)
* Fix issue when used in a SenTestCase
## [1.0.0](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.0)
* Cleaning API, added `removeLastHandler` and `removeRequestHandler:` method.
* Now first stable API in this version.
* Example project now compatible with ARC and non-ARC environments
## [0.2.0](https://github.com/AliSoftware/OHHTTPStubs/tree/0.2.0)
* Added Example project
* Added ARC support
* Some fixes
## [0.1.0](https://github.com/AliSoftware/OHHTTPStubs/tree/0.1.0)
* Initial version

View File

@@ -0,0 +1,13 @@
//
// MainViewController.h
// OHHTTPStubsDemo
//
// Created by Olivier Halligon on 11/08/12.
// Copyright (c) 2012 AliSoftware. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MainViewController : UIViewController
@end

View File

@@ -0,0 +1,169 @@
//
// MainViewController.m
// OHHTTPStubsDemo
//
// Created by Olivier Halligon on 11/08/12.
// Copyright (c) 2012 AliSoftware. All rights reserved.
//
#import "MainViewController.h"
#import <OHHTTPStubs/OHHTTPStubs.h>
@interface MainViewController ()
// IBOutlets
@property (retain, nonatomic) IBOutlet UISwitch *delaySwitch;
@property (retain, nonatomic) IBOutlet UITextView *textView;
@property (retain, nonatomic) IBOutlet UISwitch *installTextStubSwitch;
@property (retain, nonatomic) IBOutlet UIImageView *imageView;
@property (retain, nonatomic) IBOutlet UISwitch *installImageStubSwitch;
@end
@implementation MainViewController
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Init & Dealloc
- (void)viewDidLoad
{
[super viewDidLoad];
[self installTextStub:self.installTextStubSwitch];
[self installImageStub:self.installImageStubSwitch];
[OHHTTPStubs onStubActivation:^(NSURLRequest *request, id<OHHTTPStubsDescriptor> stub) {
NSLog(@"[OHHTTPStubs] Request to %@ has been stubbed with %@", request.URL, stub.name);
}];
}
- (void)viewDidUnload
{
[self setTextView:nil];
[self setImageView:nil];
[self setDelaySwitch:nil];
[super viewDidUnload];
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Global stubs activation
- (IBAction)toggleStubs:(UISwitch *)sender
{
[OHHTTPStubs setEnabled:sender.on];
self.delaySwitch.enabled = sender.on;
self.installTextStubSwitch.enabled = sender.on;
self.installImageStubSwitch.enabled = sender.on;
NSLog(@"Installed (%@) stubs: %@", (sender.on?@"and enabled":@"but disabled"), OHHTTPStubs.allStubs);
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Text Download and Stub
- (IBAction)downloadText:(UIButton*)sender
{
sender.enabled = NO;
self.textView.text = nil;
NSString* urlString = @"http://www.opensource.apple.com/source/Git/Git-26/src/git-htmldocs/git-commit.txt?txt";
NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
// This is a very handy way to send an asynchronous method, but only available in iOS5+
[NSURLConnection sendAsynchronousRequest:req
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
{
sender.enabled = YES;
NSString* receivedText = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
self.textView.text = receivedText;
}];
}
- (IBAction)installTextStub:(UISwitch *)sender
{
static id<OHHTTPStubsDescriptor> textStub = nil; // Note: no need to retain this value, it is retained by the OHHTTPStubs itself already
if (sender.on)
{
// Install
textStub = [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
// This stub will only configure stub requests for "*.txt" files
return [request.URL.pathExtension isEqualToString:@"txt"];
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
// Stub txt files with this
return [[OHHTTPStubsResponse responseWithFileAtPath:OHPathForFile(@"stub.txt", self.class)
statusCode:200
headers:@{@"Content-Type":@"text/plain"}]
requestTime:self.delaySwitch.on ? 2.f: 0.f
responseTime:OHHTTPStubsDownloadSpeedWifi];
}];
textStub.name = @"Text stub";
}
else
{
// Uninstall
[OHHTTPStubs removeStub:textStub];
}
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Image Download and Stub
- (IBAction)downloadImage:(UIButton*)sender
{
sender.enabled = NO;
NSString* urlString = @"http://images.apple.com/support/assets/images/products/iphone/hero_iphone4-5_wide.png";
NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
// This is a very handy way to send an asynchronous method, but only available in iOS5+
[NSURLConnection sendAsynchronousRequest:req
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
{
sender.enabled = YES;
self.imageView.image = [UIImage imageWithData:data];
}];
}
- (IBAction)installImageStub:(UISwitch *)sender
{
static id<OHHTTPStubsDescriptor> imageStub = nil; // Note: no need to retain this value, it is retained by the OHHTTPStubs itself already :)
if (sender.on)
{
// Install
imageStub = [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
// This stub will only configure stub requests for "*.png" files
return [request.URL.pathExtension isEqualToString:@"png"];
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
// Stub jpg files with this
return [[OHHTTPStubsResponse responseWithFileAtPath:OHPathForFile(@"stub.jpg", self.class)
statusCode:200
headers:@{@"Content-Type":@"image/jpeg"}]
requestTime:self.delaySwitch.on ? 2.f: 0.f
responseTime:OHHTTPStubsDownloadSpeedWifi];
}];
imageStub.name = @"Image stub";
}
else
{
// Uninstall
[OHHTTPStubs removeStub:imageStub];
}
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Cleaning
- (IBAction)clearResults
{
self.textView.text = @"";
self.imageView.image = nil;
}
@end

View File

@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12E55" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1072" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIApplication"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<window opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" visibleAtLaunch="YES" id="20">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<connections>
<outlet property="rootViewController" destination="21" id="22"/>
</connections>
</window>
<viewController id="21" customClass="MainViewController">
<view key="view" contentMode="scaleToFill" id="1">
<rect key="frame" x="0.0" y="0.0" width="320" height="560"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Activate Stubs Globally" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="7">
<rect key="frame" x="20" y="40" width="177" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="5">
<rect key="frame" x="246" y="37" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="toggleStubs:" destination="21" eventType="valueChanged" id="23"/>
</connections>
</switch>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Fake 2s Delay" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="15">
<rect key="frame" x="20" y="75" width="109" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="17">
<rect key="frame" x="144" y="72" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</switch>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="29">
<rect key="frame" x="231" y="69" width="69" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Clear">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="clearResults" destination="21" eventType="touchUpInside" id="31"/>
</connections>
</button>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" id="6">
<rect key="frame" x="20" y="170" width="280" height="188"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="12"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" id="9">
<rect key="frame" x="20" y="425" width="280" height="115"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
</imageView>
<view contentMode="scaleToFill" id="56B-Sg-JRy">
<rect key="frame" x="20" y="366" width="280" height="55"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="Llz-IP-qMB">
<rect key="frame" x="224" y="20" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="installImageStub:" destination="21" eventType="valueChanged" id="l07-IE-Bbh"/>
</connections>
</switch>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" id="44">
<rect key="frame" x="201" y="0.0" width="79" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="8">
<rect key="frame" x="0.0" y="9" width="176" height="37"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<state key="normal" title="Download image">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" title="Downloading…">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="downloadImage:" destination="21" eventType="touchUpInside" id="33"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.94548357664233584" alpha="1" colorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" id="P7g-mD-orR">
<rect key="frame" x="20" y="111" width="280" height="55"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="4">
<rect key="frame" x="0.0" y="9" width="176" height="37"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<state key="normal" title="Download some text">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" title="Downloading…">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="downloadText:" destination="21" eventType="touchUpInside" id="32"/>
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" id="43">
<rect key="frame" x="201" y="0.0" width="79" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="41">
<rect key="frame" x="224" y="20" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="installTextStub:" destination="21" eventType="valueChanged" id="45"/>
</connections>
</switch>
</subviews>
<color key="backgroundColor" white="0.94548357664233584" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
</view>
<extendedEdge key="edgesForExtendedLayout"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="delaySwitch" destination="17" id="26"/>
<outlet property="imageView" destination="9" id="25"/>
<outlet property="installImageStubSwitch" destination="Llz-IP-qMB" id="BDS-xd-SzF"/>
<outlet property="installTextStubSwitch" destination="41" id="47"/>
<outlet property="textView" destination="6" id="24"/>
</connections>
</viewController>
</objects>
</document>

View File

@@ -0,0 +1,382 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0984831517805426002A99FF /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0984831417805426002A99FF /* CFNetwork.framework */; };
098FBDD415D704E800623941 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 098FBDD315D704E800623941 /* UIKit.framework */; };
098FBDD615D704E800623941 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 098FBDD515D704E800623941 /* Foundation.framework */; };
098FBDD815D704E800623941 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 098FBDD715D704E800623941 /* CoreGraphics.framework */; };
098FBDE015D704E800623941 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 098FBDDF15D704E800623941 /* main.m */; };
098FBDED15D7056200623941 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 098FBDEB15D7056200623941 /* MainViewController.m */; };
098FBDEE15D7056200623941 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDEC15D7056200623941 /* MainViewController.xib */; };
098FBDF815D70E2600623941 /* stub.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDF615D70E2600623941 /* stub.jpg */; };
098FBDF915D70E2600623941 /* stub.txt in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDF715D70E2600623941 /* stub.txt */; };
099C7343169016D800239880 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 099C7342169016D800239880 /* Default-568h@2x.png */; };
76C30541E2A1B24B6848F032 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B8BA1C0EA8F8EC24B9024E1 /* libPods.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0984831417805426002A99FF /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
098FBDCF15D704E800623941 /* OHHTTPStubsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OHHTTPStubsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
098FBDD315D704E800623941 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
098FBDD515D704E800623941 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
098FBDD715D704E800623941 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
098FBDDB15D704E800623941 /* OHHTTPStubsDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OHHTTPStubsDemo-Info.plist"; sourceTree = "<group>"; };
098FBDDF15D704E800623941 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
098FBDE115D704E800623941 /* OHHTTPStubsDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsDemo-Prefix.pch"; sourceTree = "<group>"; };
098FBDEA15D7056200623941 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
098FBDEB15D7056200623941 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
098FBDEC15D7056200623941 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; };
098FBDF615D70E2600623941 /* stub.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stub.jpg; sourceTree = "<group>"; };
098FBDF715D70E2600623941 /* stub.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stub.txt; sourceTree = "<group>"; };
099C7342169016D800239880 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
0EE81E095FF3A8AF6D3C4E77 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
1B8BA1C0EA8F8EC24B9024E1 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
48556A011AA6E9FD0074B154 /* libPods-OHHTTPStubs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-OHHTTPStubs.a"; path = "Pods/../build/Debug-iphoneos/libPods-OHHTTPStubs.a"; sourceTree = "<group>"; };
B5AD292FAB98FC9C7637896A /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
098FBDCC15D704E800623941 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0984831517805426002A99FF /* CFNetwork.framework in Frameworks */,
098FBDD415D704E800623941 /* UIKit.framework in Frameworks */,
098FBDD615D704E800623941 /* Foundation.framework in Frameworks */,
098FBDD815D704E800623941 /* CoreGraphics.framework in Frameworks */,
76C30541E2A1B24B6848F032 /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
098FBDC415D704E800623941 = {
isa = PBXGroup;
children = (
098FBDD915D704E800623941 /* OHHTTPStubsDemo */,
098FBDD215D704E800623941 /* Frameworks */,
098FBDD015D704E800623941 /* Products */,
DBC538A23E8B9FD8D58D30B1 /* Pods */,
);
sourceTree = "<group>";
};
098FBDD015D704E800623941 /* Products */ = {
isa = PBXGroup;
children = (
098FBDCF15D704E800623941 /* OHHTTPStubsDemo.app */,
);
name = Products;
sourceTree = "<group>";
};
098FBDD215D704E800623941 /* Frameworks */ = {
isa = PBXGroup;
children = (
48556A011AA6E9FD0074B154 /* libPods-OHHTTPStubs.a */,
0984831417805426002A99FF /* CFNetwork.framework */,
098FBDD315D704E800623941 /* UIKit.framework */,
098FBDD515D704E800623941 /* Foundation.framework */,
098FBDD715D704E800623941 /* CoreGraphics.framework */,
1B8BA1C0EA8F8EC24B9024E1 /* libPods.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
098FBDD915D704E800623941 /* OHHTTPStubsDemo */ = {
isa = PBXGroup;
children = (
098FBDEA15D7056200623941 /* MainViewController.h */,
098FBDEB15D7056200623941 /* MainViewController.m */,
098FBDEC15D7056200623941 /* MainViewController.xib */,
098FBDFA15D70E2F00623941 /* Stubs */,
098FBDDA15D704E800623941 /* Supporting Files */,
);
name = OHHTTPStubsDemo;
sourceTree = "<group>";
};
098FBDDA15D704E800623941 /* Supporting Files */ = {
isa = PBXGroup;
children = (
099C7342169016D800239880 /* Default-568h@2x.png */,
098FBDDB15D704E800623941 /* OHHTTPStubsDemo-Info.plist */,
098FBDDF15D704E800623941 /* main.m */,
098FBDE115D704E800623941 /* OHHTTPStubsDemo-Prefix.pch */,
);
path = "Supporting Files";
sourceTree = "<group>";
};
098FBDFA15D70E2F00623941 /* Stubs */ = {
isa = PBXGroup;
children = (
098FBDF615D70E2600623941 /* stub.jpg */,
098FBDF715D70E2600623941 /* stub.txt */,
);
path = Stubs;
sourceTree = "<group>";
};
DBC538A23E8B9FD8D58D30B1 /* Pods */ = {
isa = PBXGroup;
children = (
B5AD292FAB98FC9C7637896A /* Pods.debug.xcconfig */,
0EE81E095FF3A8AF6D3C4E77 /* Pods.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
098FBDCE15D704E800623941 /* OHHTTPStubsDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 098FBDE715D704E800623941 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */;
buildPhases = (
5BF07CD1F1DEB3893534CA6D /* Check Pods Manifest.lock */,
098FBDCB15D704E800623941 /* Sources */,
098FBDCC15D704E800623941 /* Frameworks */,
098FBDCD15D704E800623941 /* Resources */,
D61C918AA467A72C9C508B4E /* Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = OHHTTPStubsDemo;
productName = OHHTTPStubsDemo;
productReference = 098FBDCF15D704E800623941 /* OHHTTPStubsDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
098FBDC615D704E800623941 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = AliSoftware;
};
buildConfigurationList = 098FBDC915D704E800623941 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 098FBDC415D704E800623941;
productRefGroup = 098FBDD015D704E800623941 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
098FBDCE15D704E800623941 /* OHHTTPStubsDemo */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
098FBDCD15D704E800623941 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
098FBDEE15D7056200623941 /* MainViewController.xib in Resources */,
098FBDF815D70E2600623941 /* stub.jpg in Resources */,
098FBDF915D70E2600623941 /* stub.txt in Resources */,
099C7343169016D800239880 /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
5BF07CD1F1DEB3893534CA6D /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
D61C918AA467A72C9C508B4E /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
098FBDCB15D704E800623941 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
098FBDE015D704E800623941 /* main.m in Sources */,
098FBDED15D7056200623941 /* MainViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
098FBDE515D704E800623941 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
};
name = Debug;
};
098FBDE615D704E800623941 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
098FBDE815D704E800623941 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B5AD292FAB98FC9C7637896A /* Pods.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Supporting Files/OHHTTPStubsDemo-Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/OHHTTPStubsDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
098FBDE915D704E800623941 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0EE81E095FF3A8AF6D3C4E77 /* Pods.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Supporting Files/OHHTTPStubsDemo-Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/OHHTTPStubsDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
098FBDC915D704E800623941 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
098FBDE515D704E800623941 /* Debug */,
098FBDE615D704E800623941 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
098FBDE715D704E800623941 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
098FBDE815D704E800623941 /* Debug */,
098FBDE915D704E800623941 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 098FBDC615D704E800623941 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:OHHTTPStubsDemo.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "NO"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "098FBDCE15D704E800623941"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "09110A5019805F4800D175E4"
BuildableName = "OHHTTPStubs iOS Tests.xctest"
BlueprintName = "OHHTTPStubs iOS Tests"
ReferencedContainer = "container:../OHHTTPStubs/OHHTTPStubs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "09110A5019805F4800D175E4"
BuildableName = "OHHTTPStubs iOS Tests.xctest"
BlueprintName = "OHHTTPStubs iOS Tests"
ReferencedContainer = "container:../OHHTTPStubs/OHHTTPStubs.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "098FBDCE15D704E800623941"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugXPCServices = "NO"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "098FBDCE15D704E800623941"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "098FBDCE15D704E800623941"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:OHHTTPStubsDemo.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,6 @@
source 'https://github.com/CocoaPods/Specs.git'
xcodeproj 'OHHTTPStubsDemo.xcodeproj'
platform :ios, '6.0'
pod 'OHHTTPStubs', :path => '../..'

View File

@@ -0,0 +1,14 @@
PODS:
- OHHTTPStubs (4.0.1)
DEPENDENCIES:
- OHHTTPStubs (from `../..`)
EXTERNAL SOURCES:
OHHTTPStubs:
:path: "../.."
SPEC CHECKSUMS:
OHHTTPStubs: 69b1d48b7dfe838a355fdf48d8592d1042e3d85f
COCOAPODS: 0.37.0

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h

View File

@@ -0,0 +1,26 @@
{
"name": "OHHTTPStubs",
"version": "4.0.1",
"summary": "Framework to stub your network requests like HTTP and help you write network unit tests with XCTest.",
"description": "A class to stub network requests easily:\n\n * Test your apps with fake network data (stubbed from file)\n * You can also customize your response headers and status code\n * Use customized stubs depending on the requests\n * Use custom response time to simulate slow network.\n * This works with any request (HTTP, HTTPS, or any protocol) sent using\n the iOS URL Loading System (NSURLConnection, NSURLSession, AFNetworking, …)\n * This is really useful in unit testing, when you need to test network features\n but don't want to hit the real network and fake some response data instead.\n * Has useful convenience methods to stub JSON content or fixture from a file\n * Compatible with Swift\n",
"homepage": "https://github.com/AliSoftware/OHHTTPStubs",
"license": "MIT",
"authors": {
"Olivier Halligon": "olivier.halligon+ae@gmail.com"
},
"source": {
"git": "https://github.com/AliSoftware/OHHTTPStubs.git",
"tag": "4.0.1"
},
"source_files": "OHHTTPStubs/Sources/*.{h,m}",
"public_header_files": "OHHTTPStubs/Sources/*.h",
"frameworks": [
"Foundation",
"CFNetwork"
],
"requires_arc": true,
"platforms": {
"ios": "5.0",
"osx": "10.7"
}
}

View File

@@ -0,0 +1,14 @@
PODS:
- OHHTTPStubs (4.0.1)
DEPENDENCIES:
- OHHTTPStubs (from `../..`)
EXTERNAL SOURCES:
OHHTTPStubs:
:path: "../.."
SPEC CHECKSUMS:
OHHTTPStubs: 69b1d48b7dfe838a355fdf48d8592d1042e3d85f
COCOAPODS: 0.37.0

View File

@@ -0,0 +1,488 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0287B0995D3956A77FE8245B /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F22C8E5911B3A17469606575 /* Pods-dummy.m */; };
05AF8AC740672A49F1DB86F8 /* OHPathHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB4DCEA3E6E205F6150BB9B /* OHPathHelpers.h */; };
37E8EFCB93409F59A3519709 /* OHHTTPStubsResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 64DE90B81CB54898D8031417 /* OHHTTPStubsResponse.h */; };
3C4E450E5248FA162C4836BB /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DA39110509B5D077268FC8 /* OHHTTPStubsResponse+JSON.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
4C169F633246281BE747CBC7 /* OHHTTPStubsResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8B9FD03923F20EA8A5A11A /* OHHTTPStubsResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
5FAAE71C0DC019D177F03852 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B2C23953AEE92A8924B57BD /* Foundation.framework */; };
91AC7870E73F1D4AFD355954 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = CD10D9BE097DF051073D1136 /* OHHTTPStubsResponse+HTTPMessage.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
91F20FAEB508489E6E82A37E /* Pods-OHHTTPStubs-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C9D0A204842A77405B1B4826 /* Pods-OHHTTPStubs-dummy.m */; };
B1DBEB199B89B0F2534AB372 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3F78A40A045AD979FC32D66 /* CFNetwork.framework */; };
B3F948D4C6FEA3E3414304E3 /* OHHTTPStubsResponse+JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F1C78DC9C9ED126B2DD803F /* OHHTTPStubsResponse+JSON.h */; };
B5A13025620A2BC7F9523B3E /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 91CB751631C441AC78BFFF91 /* OHPathHelpers.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
B88B2F8C9696F7AFF1219FA6 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 90C538A641602D6CA84175EA /* OHHTTPStubs+NSURLSessionConfiguration.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
C73743AF5192A2BCAD0BA639 /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = 757741D337827989EA9CFB35 /* OHHTTPStubs.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
D6D12CC401BBCC3846765533 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B2C23953AEE92A8924B57BD /* Foundation.framework */; };
DDE78ABCE16D42E4E3347D57 /* OHHTTPStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = F59CD3981590122479A99319 /* OHHTTPStubs.h */; };
E93E7222A109F4DE8DEE1C8A /* OHHTTPStubsResponse+HTTPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BD78083C121EBF426395FC /* OHHTTPStubsResponse+HTTPMessage.h */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
70209F8E12151BE9099A0906 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4E43A3978191CB163B56150F /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9BFA25996D607CC8407D9667;
remoteInfo = "Pods-OHHTTPStubs";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
1F1C78DC9C9ED126B2DD803F /* OHHTTPStubsResponse+JSON.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+JSON.h"; sourceTree = "<group>"; };
26BD78083C121EBF426395FC /* OHHTTPStubsResponse+HTTPMessage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+HTTPMessage.h"; sourceTree = "<group>"; };
43DA39110509B5D077268FC8 /* OHHTTPStubsResponse+JSON.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+JSON.m"; sourceTree = "<group>"; };
51D2E996FA1B199219C88105 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
540BE0121862CF47DF5EAC7E /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = "<group>"; };
5CAE31F1B62C6CE71BC12572 /* Pods-OHHTTPStubs-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-OHHTTPStubs-prefix.pch"; sourceTree = "<group>"; };
64DE90B81CB54898D8031417 /* OHHTTPStubsResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubsResponse.h; sourceTree = "<group>"; };
757741D337827989EA9CFB35 /* OHHTTPStubs.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubs.m; sourceTree = "<group>"; };
7A817F08BCB2651ACDF06BAF /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = "<group>"; };
7B2C23953AEE92A8924B57BD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
7F0BAB562664206098AE3E43 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = "<group>"; };
85434260BFFB3C7A7BC04F99 /* Pods-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-environment.h"; sourceTree = "<group>"; };
8AB4DCEA3E6E205F6150BB9B /* OHPathHelpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHPathHelpers.h; sourceTree = "<group>"; };
90C538A641602D6CA84175EA /* OHHTTPStubs+NSURLSessionConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubs+NSURLSessionConfiguration.m"; sourceTree = "<group>"; };
91CB751631C441AC78BFFF91 /* OHPathHelpers.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHPathHelpers.m; sourceTree = "<group>"; };
925D0F1AA2487470D449CE49 /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = "<group>"; };
95AC8CA1C533FBB6BD437ACB /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
A1BA020EDD8BB7AE11152ACC /* Pods-OHHTTPStubs.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs.xcconfig"; sourceTree = "<group>"; };
A976A0F9BBC8019FB5DD5B7F /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = "<group>"; };
BB8B9FD03923F20EA8A5A11A /* OHHTTPStubsResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubsResponse.m; sourceTree = "<group>"; };
C9D0A204842A77405B1B4826 /* Pods-OHHTTPStubs-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-OHHTTPStubs-dummy.m"; sourceTree = "<group>"; };
CD10D9BE097DF051073D1136 /* OHHTTPStubsResponse+HTTPMessage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+HTTPMessage.m"; sourceTree = "<group>"; };
DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs-Private.xcconfig"; sourceTree = "<group>"; };
DD8EC89EDDE25D7B79665F29 /* libPods-OHHTTPStubs.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs.a"; sourceTree = BUILT_PRODUCTS_DIR; };
E3F78A40A045AD979FC32D66 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
F22C8E5911B3A17469606575 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = "<group>"; };
F59CD3981590122479A99319 /* OHHTTPStubs.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubs.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
370CE9976B2CE6DC38C7AD35 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B1DBEB199B89B0F2534AB372 /* CFNetwork.framework in Frameworks */,
D6D12CC401BBCC3846765533 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8F733C40CCF846B63AED7A63 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5FAAE71C0DC019D177F03852 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
262D783B60DE608266D6A656 /* Products */ = {
isa = PBXGroup;
children = (
51D2E996FA1B199219C88105 /* libPods.a */,
DD8EC89EDDE25D7B79665F29 /* libPods-OHHTTPStubs.a */,
);
name = Products;
sourceTree = "<group>";
};
2D13680F87CE7E9F973E18D6 /* Targets Support Files */ = {
isa = PBXGroup;
children = (
D8918EE34F24A086FB93B162 /* Pods */,
);
name = "Targets Support Files";
sourceTree = "<group>";
};
3EB198ABE93CBAE1C25569ED /* OHHTTPStubs */ = {
isa = PBXGroup;
children = (
C4B29A11FCEF09243EA85BD4 /* OHHTTPStubs */,
D882BE8B7A1CD1ACAD41FC23 /* Support Files */,
);
name = OHHTTPStubs;
path = ../../..;
sourceTree = "<group>";
};
4CCC5CCCC482E8248CF90F91 = {
isa = PBXGroup;
children = (
95AC8CA1C533FBB6BD437ACB /* Podfile */,
A6534AD5BD03EA29AB460479 /* Development Pods */,
90091CD0A828ED346DE8663C /* Frameworks */,
262D783B60DE608266D6A656 /* Products */,
2D13680F87CE7E9F973E18D6 /* Targets Support Files */,
);
sourceTree = "<group>";
};
6B5292DC8591159D72E93366 /* Sources */ = {
isa = PBXGroup;
children = (
F59CD3981590122479A99319 /* OHHTTPStubs.h */,
757741D337827989EA9CFB35 /* OHHTTPStubs.m */,
90C538A641602D6CA84175EA /* OHHTTPStubs+NSURLSessionConfiguration.m */,
64DE90B81CB54898D8031417 /* OHHTTPStubsResponse.h */,
BB8B9FD03923F20EA8A5A11A /* OHHTTPStubsResponse.m */,
26BD78083C121EBF426395FC /* OHHTTPStubsResponse+HTTPMessage.h */,
CD10D9BE097DF051073D1136 /* OHHTTPStubsResponse+HTTPMessage.m */,
1F1C78DC9C9ED126B2DD803F /* OHHTTPStubsResponse+JSON.h */,
43DA39110509B5D077268FC8 /* OHHTTPStubsResponse+JSON.m */,
8AB4DCEA3E6E205F6150BB9B /* OHPathHelpers.h */,
91CB751631C441AC78BFFF91 /* OHPathHelpers.m */,
);
path = Sources;
sourceTree = "<group>";
};
90091CD0A828ED346DE8663C /* Frameworks */ = {
isa = PBXGroup;
children = (
D39958F9C841183DE3C7A500 /* iOS */,
);
name = Frameworks;
sourceTree = "<group>";
};
A6534AD5BD03EA29AB460479 /* Development Pods */ = {
isa = PBXGroup;
children = (
3EB198ABE93CBAE1C25569ED /* OHHTTPStubs */,
);
name = "Development Pods";
sourceTree = "<group>";
};
C4B29A11FCEF09243EA85BD4 /* OHHTTPStubs */ = {
isa = PBXGroup;
children = (
6B5292DC8591159D72E93366 /* Sources */,
);
path = OHHTTPStubs;
sourceTree = "<group>";
};
D39958F9C841183DE3C7A500 /* iOS */ = {
isa = PBXGroup;
children = (
E3F78A40A045AD979FC32D66 /* CFNetwork.framework */,
7B2C23953AEE92A8924B57BD /* Foundation.framework */,
);
name = iOS;
sourceTree = "<group>";
};
D882BE8B7A1CD1ACAD41FC23 /* Support Files */ = {
isa = PBXGroup;
children = (
A1BA020EDD8BB7AE11152ACC /* Pods-OHHTTPStubs.xcconfig */,
DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */,
C9D0A204842A77405B1B4826 /* Pods-OHHTTPStubs-dummy.m */,
5CAE31F1B62C6CE71BC12572 /* Pods-OHHTTPStubs-prefix.pch */,
);
name = "Support Files";
path = "Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs";
sourceTree = "<group>";
};
D8918EE34F24A086FB93B162 /* Pods */ = {
isa = PBXGroup;
children = (
925D0F1AA2487470D449CE49 /* Pods-acknowledgements.markdown */,
540BE0121862CF47DF5EAC7E /* Pods-acknowledgements.plist */,
F22C8E5911B3A17469606575 /* Pods-dummy.m */,
85434260BFFB3C7A7BC04F99 /* Pods-environment.h */,
7A817F08BCB2651ACDF06BAF /* Pods-resources.sh */,
7F0BAB562664206098AE3E43 /* Pods.debug.xcconfig */,
A976A0F9BBC8019FB5DD5B7F /* Pods.release.xcconfig */,
);
name = Pods;
path = "Target Support Files/Pods";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
F9ECAC25D98304B8B72AF50A /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
DDE78ABCE16D42E4E3347D57 /* OHHTTPStubs.h in Headers */,
E93E7222A109F4DE8DEE1C8A /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
B3F948D4C6FEA3E3414304E3 /* OHHTTPStubsResponse+JSON.h in Headers */,
37E8EFCB93409F59A3519709 /* OHHTTPStubsResponse.h in Headers */,
05AF8AC740672A49F1DB86F8 /* OHPathHelpers.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
9BFA25996D607CC8407D9667 /* Pods-OHHTTPStubs */ = {
isa = PBXNativeTarget;
buildConfigurationList = 99C679F5F4E67D87EC4BDF5A /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs" */;
buildPhases = (
BE02003453F6728BF5A57B70 /* Sources */,
370CE9976B2CE6DC38C7AD35 /* Frameworks */,
F9ECAC25D98304B8B72AF50A /* Headers */,
);
buildRules = (
);
dependencies = (
);
name = "Pods-OHHTTPStubs";
productName = "Pods-OHHTTPStubs";
productReference = DD8EC89EDDE25D7B79665F29 /* libPods-OHHTTPStubs.a */;
productType = "com.apple.product-type.library.static";
};
ED0986E9CFBAA34FCF4971C9 /* Pods */ = {
isa = PBXNativeTarget;
buildConfigurationList = 40030A743EB9FB86643D5978 /* Build configuration list for PBXNativeTarget "Pods" */;
buildPhases = (
222D0A79B1499A9F0B3FDA4B /* Sources */,
8F733C40CCF846B63AED7A63 /* Frameworks */,
);
buildRules = (
);
dependencies = (
76788543FE7378BD74B08A8D /* PBXTargetDependency */,
);
name = Pods;
productName = Pods;
productReference = 51D2E996FA1B199219C88105 /* libPods.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
4E43A3978191CB163B56150F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0640;
};
buildConfigurationList = A6F781DF7CB4BC20838676BB /* Build configuration list for PBXProject "Pods" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 4CCC5CCCC482E8248CF90F91;
productRefGroup = 262D783B60DE608266D6A656 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
ED0986E9CFBAA34FCF4971C9 /* Pods */,
9BFA25996D607CC8407D9667 /* Pods-OHHTTPStubs */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
222D0A79B1499A9F0B3FDA4B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0287B0995D3956A77FE8245B /* Pods-dummy.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
BE02003453F6728BF5A57B70 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B88B2F8C9696F7AFF1219FA6 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
C73743AF5192A2BCAD0BA639 /* OHHTTPStubs.m in Sources */,
91AC7870E73F1D4AFD355954 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
3C4E450E5248FA162C4836BB /* OHHTTPStubsResponse+JSON.m in Sources */,
4C169F633246281BE747CBC7 /* OHHTTPStubsResponse.m in Sources */,
B5A13025620A2BC7F9523B3E /* OHPathHelpers.m in Sources */,
91F20FAEB508489E6E82A37E /* Pods-OHHTTPStubs-dummy.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
76788543FE7378BD74B08A8D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "Pods-OHHTTPStubs";
target = 9BFA25996D607CC8407D9667 /* Pods-OHHTTPStubs */;
targetProxy = 70209F8E12151BE9099A0906 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
337E89F82BC61A2DD3C2E883 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A976A0F9BBC8019FB5DD5B7F /* Pods.release.xcconfig */;
buildSettings = {
ENABLE_STRICT_OBJC_MSGSEND = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Release;
};
63360606759F06BB75622084 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */;
buildSettings = {
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Release;
};
68471B2F01E99F601F6F8AC3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build";
};
name = Debug;
};
6B84606278B52C10D43487F2 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */;
buildSettings = {
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
MTL_ENABLE_DEBUG_INFO = YES;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Debug;
};
7DBF91DE1049E44BD8E62530 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7F0BAB562664206098AE3E43 /* Pods.debug.xcconfig */;
buildSettings = {
ENABLE_STRICT_OBJC_MSGSEND = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
MTL_ENABLE_DEBUG_INFO = YES;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Debug;
};
F0A06905E42C5AED58002639 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
40030A743EB9FB86643D5978 /* Build configuration list for PBXNativeTarget "Pods" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7DBF91DE1049E44BD8E62530 /* Debug */,
337E89F82BC61A2DD3C2E883 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
99C679F5F4E67D87EC4BDF5A /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6B84606278B52C10D43487F2 /* Debug */,
63360606759F06BB75622084 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A6F781DF7CB4BC20838676BB /* Build configuration list for PBXProject "Pods" */ = {
isa = XCConfigurationList;
buildConfigurations = (
68471B2F01E99F601F6F8AC3 /* Debug */,
F0A06905E42C5AED58002639 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 4E43A3978191CB163B56150F /* Project object */;
}

View File

@@ -0,0 +1,6 @@
#include "Pods-OHHTTPStubs.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OHHTTPStubs" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
OTHER_LDFLAGS = ${PODS_OHHTTPSTUBS_OTHER_LDFLAGS} -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View File

@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_OHHTTPStubs : NSObject
@end
@implementation PodsDummy_Pods_OHHTTPStubs
@end

View File

@@ -0,0 +1,5 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "Pods-environment.h"

View File

@@ -0,0 +1 @@
PODS_OHHTTPSTUBS_OTHER_LDFLAGS = -framework "CFNetwork" -framework "Foundation"

View File

@@ -0,0 +1,15 @@
# Acknowledgements
This application makes use of the following third party libraries:
## OHHTTPStubs
- MIT LICENSE -
Copyright (c) 2012 Olivier Halligon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Generated by CocoaPods - http://cocoapods.org

View File

@@ -0,0 +1,45 @@
<?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>- MIT LICENSE -
Copyright (c) 2012 Olivier Halligon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</string>
<key>Title</key>
<string>OHHTTPStubs</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>

View File

@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods : NSObject
@end
@implementation PodsDummy_Pods
@end

View File

@@ -0,0 +1,14 @@
// To check if a library is compiled with CocoaPods you
// can use the `COCOAPODS` macro definition which is
// defined in the xcconfigs so it is available in
// headers also when they are imported in the client
// project.
// OHHTTPStubs
#define COCOAPODS_POD_AVAILABLE_OHHTTPStubs
#define COCOAPODS_VERSION_MAJOR_OHHTTPStubs 4
#define COCOAPODS_VERSION_MINOR_OHHTTPStubs 0
#define COCOAPODS_VERSION_PATCH_OHHTTPStubs 1

View File

@@ -0,0 +1,93 @@
#!/bin/sh
set -e
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
realpath() {
DIRECTORY=$(cd "${1%/*}" && pwd)
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
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 "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
;;
*.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"
;;
*.xcmappingmodel)
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
;;
esac
}
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]]; then
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@@ -0,0 +1,6 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs" -framework "CFNetwork" -framework "Foundation"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
PODS_ROOT = ${SRCROOT}/Pods

View File

@@ -0,0 +1,6 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs" -framework "CFNetwork" -framework "Foundation"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
PODS_ROOT = ${SRCROOT}/Pods

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -0,0 +1,3 @@
This is the text from your stub.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullam corper suscipit lobortis nisi ut aliquip ex ea commodo consequat. Duis te feugi facilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit au gue duis dolore te feugat nulla facilisi.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,40 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.alisoftware.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainViewController</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'OHHTTPStubsDemo' target in the 'OHHTTPStubsDemo' project
//
#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

View File

@@ -0,0 +1,17 @@
//
// main.m
// OHHTTPStubsDemo
//
// Created by Olivier Halligon on 11/08/12.
// Copyright (c) 2012 AliSoftware. All rights reserved.
//
#import <UIKit/UIKit.h>
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, nil);
}
}

View File

@@ -0,0 +1,21 @@
//
// AppDelegate.swift
// OHHTTPStubsDemo
//
// Created by Olivier Halligon on 18/04/2015.
// Copyright (c) 2015 AliSoftware. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
}

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14C1514" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Main View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="MainViewController" customModule="OHHTTPStubsDemo" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Activate Stubs Globally" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="i3Q-pZ-OFi">
<rect key="frame" x="73" y="33" width="511" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" horizontalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="l60-ZM-CS7">
<rect key="frame" x="16" y="28" width="51" height="31"/>
<connections>
<action selector="toggleStubs:" destination="BYZ-38-t0r" eventType="valueChanged" id="Ab8-ba-nES"/>
</connections>
</switch>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Fake 2s Delay" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="BVp-fP-EX3">
<rect key="frame" x="73" y="72" width="434" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" horizontalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Ots-uz-HBP">
<rect key="frame" x="16" y="67" width="51" height="31"/>
</switch>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bd2-S0-6oU">
<rect key="frame" x="515" y="68" width="69" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="69" id="05U-TI-0b3"/>
</constraints>
<state key="normal" title="Clear">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="clearResults" destination="BYZ-38-t0r" eventType="touchUpInside" id="aLh-6y-PPp"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="q0d-yd-8pd">
<rect key="frame" x="16" y="106" width="568" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cHe-gS-w8n">
<rect key="frame" x="13" y="5" width="481" height="45"/>
<state key="normal" title="Download some text">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" title="Downloading…">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="downloadText:" destination="BYZ-38-t0r" eventType="touchUpInside" id="HfU-ap-tEC"/>
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="750" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CZL-1L-SlS">
<rect key="frame" x="485" y="2" width="63" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eja-cQ-oUU">
<rect key="frame" x="499" y="22" width="51" height="31"/>
<connections>
<action selector="installTextStub:" destination="BYZ-38-t0r" eventType="valueChanged" id="2pl-wJ-iCQ"/>
</connections>
</switch>
</subviews>
<color key="backgroundColor" white="0.94548357660000004" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="eja-cQ-oUU" secondAttribute="bottom" constant="2" id="29H-MG-Fxf"/>
<constraint firstItem="eja-cQ-oUU" firstAttribute="top" secondItem="CZL-1L-SlS" secondAttribute="bottom" id="3wI-sk-26n"/>
<constraint firstItem="cHe-gS-w8n" firstAttribute="leading" secondItem="q0d-yd-8pd" secondAttribute="leadingMargin" constant="5" id="Hwa-qe-ZOQ"/>
<constraint firstAttribute="trailing" secondItem="eja-cQ-oUU" secondAttribute="trailing" constant="20" symbolic="YES" id="Khb-si-DNH"/>
<constraint firstAttribute="bottom" secondItem="cHe-gS-w8n" secondAttribute="bottom" constant="5" id="S92-MO-7X2"/>
<constraint firstItem="cHe-gS-w8n" firstAttribute="top" secondItem="q0d-yd-8pd" secondAttribute="top" constant="5" id="bbu-UH-GkB"/>
<constraint firstItem="eja-cQ-oUU" firstAttribute="leading" secondItem="cHe-gS-w8n" secondAttribute="trailing" constant="5" id="gjH-jS-L0Y"/>
<constraint firstItem="CZL-1L-SlS" firstAttribute="trailing" secondItem="eja-cQ-oUU" secondAttribute="trailing" id="p7j-wp-ICC"/>
<constraint firstAttribute="height" constant="55" id="qXE-il-74X"/>
<constraint firstAttribute="trailing" secondItem="CZL-1L-SlS" secondAttribute="trailing" constant="8" id="rgi-Il-D0e"/>
<constraint firstItem="CZL-1L-SlS" firstAttribute="top" secondItem="q0d-yd-8pd" secondAttribute="top" constant="2" id="wN6-Rr-Qrd"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="rgi-Il-D0e"/>
</mask>
</variation>
</view>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ruy-AH-zcs">
<rect key="frame" x="16" y="169" width="568" height="176"/>
<color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="12"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GvE-e2-Eos">
<rect key="frame" x="16" y="353" width="568" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="c9w-hC-ZIo">
<rect key="frame" x="13" y="5" width="478" height="45"/>
<state key="normal" title="Download image">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" title="Downloading…">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="downloadImage:" destination="BYZ-38-t0r" eventType="touchUpInside" id="UM4-Du-Bbb"/>
</connections>
</button>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ji5-SF-Rck">
<rect key="frame" x="499" y="22" width="51" height="31"/>
<connections>
<action selector="installImageStub:" destination="BYZ-38-t0r" eventType="valueChanged" id="B56-KR-Iwy"/>
</connections>
</switch>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WaM-eo-B4Y">
<rect key="frame" x="485" y="2" width="63" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.94548357660000004" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ji5-SF-Rck" firstAttribute="top" secondItem="WaM-eo-B4Y" secondAttribute="bottom" id="4ga-4o-xtr"/>
<constraint firstItem="c9w-hC-ZIo" firstAttribute="top" secondItem="GvE-e2-Eos" secondAttribute="top" constant="5" id="62E-jh-E4B"/>
<constraint firstItem="ji5-SF-Rck" firstAttribute="leading" secondItem="c9w-hC-ZIo" secondAttribute="trailing" constant="8" symbolic="YES" id="8lX-bA-JCe"/>
<constraint firstItem="c9w-hC-ZIo" firstAttribute="leading" secondItem="GvE-e2-Eos" secondAttribute="leadingMargin" constant="5" id="Dyb-rO-JJU"/>
<constraint firstAttribute="trailing" secondItem="ji5-SF-Rck" secondAttribute="trailing" constant="20" symbolic="YES" id="Fkp-ob-fLN"/>
<constraint firstAttribute="bottom" secondItem="ji5-SF-Rck" secondAttribute="bottom" constant="2" id="R9M-DJ-mIm"/>
<constraint firstAttribute="height" constant="55" id="Ro0-sY-nDW"/>
<constraint firstItem="WaM-eo-B4Y" firstAttribute="trailing" secondItem="ji5-SF-Rck" secondAttribute="trailing" id="ZxJ-2X-ePH"/>
<constraint firstAttribute="bottom" secondItem="c9w-hC-ZIo" secondAttribute="bottom" constant="5" id="jdz-li-ys1"/>
<constraint firstItem="WaM-eo-B4Y" firstAttribute="top" secondItem="GvE-e2-Eos" secondAttribute="top" constant="2" id="zDu-Go-F4N"/>
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="5bj-Tq-WCZ">
<rect key="frame" x="16" y="416" width="568" height="176"/>
<color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="l60-ZM-CS7" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="0j5-Kr-Bap"/>
<constraint firstItem="GvE-e2-Eos" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="7BB-yF-NDN"/>
<constraint firstItem="5bj-Tq-WCZ" firstAttribute="height" secondItem="ruy-AH-zcs" secondAttribute="height" id="9CM-a2-1St"/>
<constraint firstItem="Ots-uz-HBP" firstAttribute="top" secondItem="l60-ZM-CS7" secondAttribute="bottom" constant="8" symbolic="YES" id="9fP-Fh-cY6"/>
<constraint firstItem="Ots-uz-HBP" firstAttribute="centerY" secondItem="BVp-fP-EX3" secondAttribute="centerY" id="CuV-xq-bsL"/>
<constraint firstItem="ruy-AH-zcs" firstAttribute="top" secondItem="q0d-yd-8pd" secondAttribute="bottom" constant="8" symbolic="YES" id="FAU-LK-lwH"/>
<constraint firstAttribute="trailingMargin" secondItem="i3Q-pZ-OFi" secondAttribute="trailing" id="Gf3-KX-gvo"/>
<constraint firstItem="ruy-AH-zcs" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="GwN-Yl-Oe9"/>
<constraint firstItem="q0d-yd-8pd" firstAttribute="top" secondItem="Ots-uz-HBP" secondAttribute="bottom" constant="8" symbolic="YES" id="Hte-At-iUc"/>
<constraint firstItem="5bj-Tq-WCZ" firstAttribute="top" secondItem="GvE-e2-Eos" secondAttribute="bottom" constant="8" symbolic="YES" id="JgY-aI-yDT"/>
<constraint firstItem="GvE-e2-Eos" firstAttribute="top" secondItem="ruy-AH-zcs" secondAttribute="bottom" constant="8" symbolic="YES" id="Ote-kU-oyl"/>
<constraint firstItem="l60-ZM-CS7" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="8" symbolic="YES" id="QcO-T9-cgv"/>
<constraint firstItem="Bd2-S0-6oU" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="SC7-du-hgz"/>
<constraint firstItem="Bd2-S0-6oU" firstAttribute="leading" secondItem="BVp-fP-EX3" secondAttribute="trailing" constant="8" symbolic="YES" id="UId-jY-PGT"/>
<constraint firstItem="BVp-fP-EX3" firstAttribute="leading" secondItem="Ots-uz-HBP" secondAttribute="trailing" constant="8" symbolic="YES" id="YtW-MD-2HS"/>
<constraint firstItem="Ots-uz-HBP" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="YzH-tR-2EL"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="5bj-Tq-WCZ" secondAttribute="bottom" constant="8" symbolic="YES" id="bkX-5L-yHb"/>
<constraint firstItem="GvE-e2-Eos" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="e3m-dD-QHe"/>
<constraint firstItem="q0d-yd-8pd" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="gf8-4V-OtZ"/>
<constraint firstItem="i3Q-pZ-OFi" firstAttribute="centerY" secondItem="l60-ZM-CS7" secondAttribute="centerY" id="i7p-Mu-Z5w"/>
<constraint firstItem="Bd2-S0-6oU" firstAttribute="centerY" secondItem="BVp-fP-EX3" secondAttribute="centerY" id="lBr-er-U9M"/>
<constraint firstItem="5bj-Tq-WCZ" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="n85-Qw-ILn"/>
<constraint firstItem="ruy-AH-zcs" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="t7w-mv-dbP"/>
<constraint firstItem="i3Q-pZ-OFi" firstAttribute="leading" secondItem="l60-ZM-CS7" secondAttribute="trailing" constant="8" symbolic="YES" id="ud7-J3-llm"/>
<constraint firstItem="q0d-yd-8pd" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="vd3-vh-cO6"/>
<constraint firstItem="5bj-Tq-WCZ" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="zf9-6C-GJh"/>
</constraints>
</view>
<connections>
<outlet property="delaySwitch" destination="Ots-uz-HBP" id="bye-pT-jxJ"/>
<outlet property="imageView" destination="5bj-Tq-WCZ" id="u02-Ml-Ob8"/>
<outlet property="installImageStubSwitch" destination="ji5-SF-Rck" id="7u3-ya-Crs"/>
<outlet property="installTextStubSwitch" destination="eja-cQ-oUU" id="Xsi-sG-ivV"/>
<outlet property="textView" destination="ruy-AH-zcs" id="Gbh-p5-mVt"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,145 @@
//
// ViewController.swift
// OHHTTPStubsDemo
//
// Created by Olivier Halligon on 18/04/2015.
// Copyright (c) 2015 AliSoftware. All rights reserved.
//
import UIKit
import OHHTTPStubs
class MainViewController: UIViewController {
////////////////////////////////////////////////////////////////////////////////
// MARK: - Outlets
@IBOutlet var delaySwitch: UISwitch!
@IBOutlet var textView: UITextView!
@IBOutlet var installTextStubSwitch: UISwitch!
@IBOutlet var imageView: UIImageView!
@IBOutlet var installImageStubSwitch: UISwitch!
////////////////////////////////////////////////////////////////////////////////
// MARK: - Init & Dealloc
override func viewDidLoad() {
super.viewDidLoad()
installTextStub(self.installTextStubSwitch)
installImageStub(self.installImageStubSwitch)
OHHTTPStubs.onStubActivation { (request: NSURLRequest!, stub: OHHTTPStubsDescriptor!) in
println("[OHHTTPStubs] Request to \(request.URL!) has been stubbed with \(stub.name)")
}
}
////////////////////////////////////////////////////////////////////////////////
// MARK: - Global stubs activation
@IBAction func toggleStubs(sender: UISwitch) {
OHHTTPStubs.setEnabled(sender.on)
self.delaySwitch.enabled = sender.on
self.installTextStubSwitch.enabled = sender.on
self.installImageStubSwitch.enabled = sender.on
let state = sender.on ? "and enabled" : "but disabled"
println("Installed (\(state)) stubs: \(OHHTTPStubs.allStubs)")
}
////////////////////////////////////////////////////////////////////////////////
// MARK: - Text Download and Stub
@IBAction func downloadText(sender: UIButton) {
sender.enabled = false
self.textView.text = nil
let urlString = "http://www.opensource.apple.com/source/Git/Git-26/src/git-htmldocs/git-commit.txt?txt"
let req = NSURLRequest(URL: NSURL(string: urlString)!)
NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { (_, data, _) in
sender.enabled = true
let receivedText = NSString(data: data, encoding: NSASCIIStringEncoding)
self.textView.text = receivedText! as String
}
}
weak var textStub: OHHTTPStubsDescriptor?
@IBAction func installTextStub(sender: UISwitch) {
if sender.on {
// Install
// - we use an inline closure for the test predicate with shorthand argument names
// - we also use the "trailing closure" syntax of Swift for convenience
// - we don't care about the 'request' parameter in the trailing closure so we use '_'
textStub = OHHTTPStubs.stubRequestsPassingTest({$0.URL!.pathExtension == "txt"}) { _ in
let stubPath = OHPathForFile("stub.txt", self.dynamicType)
return OHHTTPStubsResponse(
fileAtPath: stubPath!,
statusCode: 200,
headers: ["Content-Type":"text/plain"]
)
.requestTime(self.delaySwitch.on ? 2.0 : 0.0, responseTime:OHHTTPStubsDownloadSpeedWifi)
}
textStub?.name = "Text stub"
} else {
// Uninstall
OHHTTPStubs.removeStub(textStub!)
}
}
////////////////////////////////////////////////////////////////////////////////
// MARK: - Image Download and Stub
@IBAction func downloadImage(sender: UIButton) {
sender.enabled = false
self.imageView.image = nil
let urlString = "http://images.apple.com/support/assets/images/products/iphone/hero_iphone4-5_wide.png"
let req = NSURLRequest(URL: NSURL(string: urlString)!)
NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { (_, data, _) in
sender.enabled = true
self.imageView.image = UIImage(data: data)
}
}
weak var imageStub: OHHTTPStubsDescriptor?
@IBAction func installImageStub(sender: UISwitch) {
if sender.on {
// Install
let isImage = { (request: NSURLRequest!) -> Bool in
contains(["png","jpg","jpeg","gif"], request.URL?.pathExtension ?? "")
}
// - we use a separate block 'isImage' for the 'test' predicate for code readability
// - we use the "trailing closure" syntax of Swift for convenience
// - we don't care about the 'request' parameter in the trailing closure so we use '_'
imageStub = OHHTTPStubs.stubRequestsPassingTest(isImage) { _ in
let stubPath = OHPathForFile("stub.jpg", self.dynamicType)
return OHHTTPStubsResponse(
fileAtPath: stubPath!,
statusCode: 200,
headers: ["Content-Type":"image/jpeg"]
)
.requestTime(self.delaySwitch.on ? 2.0 : 0.0, responseTime: OHHTTPStubsDownloadSpeedWifi)
}
imageStub?.name = "Image stub"
} else {
// Uninstall
OHHTTPStubs.removeStub(imageStub!)
}
}
////////////////////////////////////////////////////////////////////////////////
// MARK: - Cleaning
@IBAction func clearResults() {
self.textView.text = ""
self.imageView.image = nil
}
}

View File

@@ -0,0 +1,378 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
099F74141AE2D049001108A5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 099F74131AE2D049001108A5 /* Images.xcassets */; };
099F742F1AE2D572001108A5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 099F742D1AE2D572001108A5 /* Main.storyboard */; };
099F74351AE2D5EB001108A5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 099F74341AE2D5EB001108A5 /* LaunchScreen.xib */; };
099F74391AE2D5FF001108A5 /* stub.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 099F74371AE2D5FF001108A5 /* stub.jpg */; };
099F743A1AE2D5FF001108A5 /* stub.txt in Resources */ = {isa = PBXBuildFile; fileRef = 099F74381AE2D5FF001108A5 /* stub.txt */; };
099F743C1AE2D632001108A5 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 099F743B1AE2D632001108A5 /* Default-568h@2x.png */; };
099F74401AE2D703001108A5 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099F740E1AE2D049001108A5 /* MainViewController.swift */; };
099F74421AE2D7E0001108A5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099F74411AE2D7E0001108A5 /* AppDelegate.swift */; };
33ABB39721D2012BFC1F5077 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6C6334E088CD830EF8D38DB /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
099F74071AE2D049001108A5 /* OHHTTPStubsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OHHTTPStubsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
099F740B1AE2D049001108A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
099F740E1AE2D049001108A5 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
099F74131AE2D049001108A5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
099F742D1AE2D572001108A5 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
099F74341AE2D5EB001108A5 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = "<group>"; };
099F74371AE2D5FF001108A5 /* stub.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stub.jpg; sourceTree = "<group>"; };
099F74381AE2D5FF001108A5 /* stub.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stub.txt; sourceTree = "<group>"; };
099F743B1AE2D632001108A5 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Supporting Files/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
099F74411AE2D7E0001108A5 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
D1819A3B2BCA81021164F097 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
DC1FF3E7FE2F711D9C9AD066 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
F6C6334E088CD830EF8D38DB /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
099F74041AE2D049001108A5 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
33ABB39721D2012BFC1F5077 /* Pods.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
099F73FE1AE2D049001108A5 = {
isa = PBXGroup;
children = (
099F74091AE2D049001108A5 /* OHHTTPStubsDemo */,
099F74081AE2D049001108A5 /* Products */,
11944CD1D5FC771F513B1E27 /* Pods */,
3116686BFC89EEC0587776C7 /* Frameworks */,
);
sourceTree = "<group>";
};
099F74081AE2D049001108A5 /* Products */ = {
isa = PBXGroup;
children = (
099F74071AE2D049001108A5 /* OHHTTPStubsDemo.app */,
);
name = Products;
sourceTree = "<group>";
};
099F74091AE2D049001108A5 /* OHHTTPStubsDemo */ = {
isa = PBXGroup;
children = (
099F74411AE2D7E0001108A5 /* AppDelegate.swift */,
099F740E1AE2D049001108A5 /* MainViewController.swift */,
099F742D1AE2D572001108A5 /* Main.storyboard */,
099F74361AE2D5FF001108A5 /* Stubs */,
099F740A1AE2D049001108A5 /* Supporting Files */,
);
name = OHHTTPStubsDemo;
sourceTree = "<group>";
};
099F740A1AE2D049001108A5 /* Supporting Files */ = {
isa = PBXGroup;
children = (
099F743B1AE2D632001108A5 /* Default-568h@2x.png */,
099F74341AE2D5EB001108A5 /* LaunchScreen.xib */,
099F74131AE2D049001108A5 /* Images.xcassets */,
099F740B1AE2D049001108A5 /* Info.plist */,
);
path = "Supporting Files";
sourceTree = "<group>";
};
099F74361AE2D5FF001108A5 /* Stubs */ = {
isa = PBXGroup;
children = (
099F74371AE2D5FF001108A5 /* stub.jpg */,
099F74381AE2D5FF001108A5 /* stub.txt */,
);
path = Stubs;
sourceTree = "<group>";
};
11944CD1D5FC771F513B1E27 /* Pods */ = {
isa = PBXGroup;
children = (
D1819A3B2BCA81021164F097 /* Pods.debug.xcconfig */,
DC1FF3E7FE2F711D9C9AD066 /* Pods.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
3116686BFC89EEC0587776C7 /* Frameworks */ = {
isa = PBXGroup;
children = (
F6C6334E088CD830EF8D38DB /* Pods.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
099F74061AE2D049001108A5 /* OHHTTPStubsDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 099F74261AE2D049001108A5 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */;
buildPhases = (
BC9F93D044C7E42A3DAD6455 /* Check Pods Manifest.lock */,
099F74031AE2D049001108A5 /* Sources */,
099F74041AE2D049001108A5 /* Frameworks */,
099F74051AE2D049001108A5 /* Resources */,
D95367D5DC075A18A3D27355 /* Embed Pods Frameworks */,
5D1017B32E55D59BD180A034 /* Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = OHHTTPStubsDemo;
productName = OHHTTPStubsDemo;
productReference = 099F74071AE2D049001108A5 /* OHHTTPStubsDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
099F73FF1AE2D049001108A5 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = AliSoftware;
TargetAttributes = {
099F74061AE2D049001108A5 = {
CreatedOnToolsVersion = 6.3;
};
};
};
buildConfigurationList = 099F74021AE2D049001108A5 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 099F73FE1AE2D049001108A5;
productRefGroup = 099F74081AE2D049001108A5 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
099F74061AE2D049001108A5 /* OHHTTPStubsDemo */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
099F74051AE2D049001108A5 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
099F74351AE2D5EB001108A5 /* LaunchScreen.xib in Resources */,
099F74391AE2D5FF001108A5 /* stub.jpg in Resources */,
099F742F1AE2D572001108A5 /* Main.storyboard in Resources */,
099F74141AE2D049001108A5 /* Images.xcassets in Resources */,
099F743A1AE2D5FF001108A5 /* stub.txt in Resources */,
099F743C1AE2D632001108A5 /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
5D1017B32E55D59BD180A034 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
showEnvVarsInLog = 0;
};
BC9F93D044C7E42A3DAD6455 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
D95367D5DC075A18A3D27355 /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
099F74031AE2D049001108A5 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
099F74421AE2D7E0001108A5 /* AppDelegate.swift in Sources */,
099F74401AE2D703001108A5 /* MainViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
099F74241AE2D049001108A5 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
099F74251AE2D049001108A5 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
099F74271AE2D049001108A5 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D1819A3B2BCA81021164F097 /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
099F74281AE2D049001108A5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DC1FF3E7FE2F711D9C9AD066 /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
099F74021AE2D049001108A5 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
099F74241AE2D049001108A5 /* Debug */,
099F74251AE2D049001108A5 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
099F74261AE2D049001108A5 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
099F74271AE2D049001108A5 /* Debug */,
099F74281AE2D049001108A5 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 099F73FF1AE2D049001108A5 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "099F74061AE2D049001108A5"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "099F741B1AE2D049001108A5"
BuildableName = "OHHTTPStubsDemoTests.xctest"
BlueprintName = "OHHTTPStubsDemoTests"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "099F741B1AE2D049001108A5"
BuildableName = "OHHTTPStubsDemoTests.xctest"
BlueprintName = "OHHTTPStubsDemoTests"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "099F74061AE2D049001108A5"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "099F74061AE2D049001108A5"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "099F74061AE2D049001108A5"
BuildableName = "OHHTTPStubsDemo.app"
BlueprintName = "OHHTTPStubsDemo"
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:OHHTTPStubsDemo.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,7 @@
source 'https://github.com/CocoaPods/Specs.git'
xcodeproj 'OHHTTPStubsDemo.xcodeproj'
platform :ios, '8.0'
use_frameworks!
pod 'OHHTTPStubs', :path => '../..'

View File

@@ -0,0 +1,14 @@
PODS:
- OHHTTPStubs (4.0.1)
DEPENDENCIES:
- OHHTTPStubs (from `../..`)
EXTERNAL SOURCES:
OHHTTPStubs:
:path: "../.."
SPEC CHECKSUMS:
OHHTTPStubs: 69b1d48b7dfe838a355fdf48d8592d1042e3d85f
COCOAPODS: 0.37.0

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h

View File

@@ -0,0 +1 @@
../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h

Some files were not shown because too many files have changed in this diff Show More