diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a8f67ba --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "SwiftyJSON"] + path = SwiftyJSON + url = https://github.com/SwiftyJSON/SwiftyJSON.git +[submodule "Alamofire"] + path = Alamofire + url = https://github.com/Alamofire/Alamofire.git diff --git a/Alamofire b/Alamofire new file mode 160000 index 0000000..7ce248d --- /dev/null +++ b/Alamofire @@ -0,0 +1 @@ +Subproject commit 7ce248d3d9da4267d297a7e3e42f9cfe1601a225 diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj new file mode 100644 index 0000000..da0638f --- /dev/null +++ b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj @@ -0,0 +1,519 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + A8AFB71519D1401D0070765E /* Alamofire-SwiftyJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A8AFB71F19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */; }; + A8AFB72919D140BD0070765E /* Alamofire-SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3319A95C8B0040E7D1; + remoteInfo = Alamofire; + }; + A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; + remoteInfo = AlamofireTests; + }; + A8AFB76419D14A670070765E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2E4FEFDB19575BE100351305; + remoteInfo = SwiftyJSON; + }; + A8AFB76619D14A670070765E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2E4FEFE619575BE100351305; + remoteInfo = SwiftyJSONTests; + }; + A8AFB76819D14A670070765E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2E4FF00219575CE600351305; + remoteInfo = "SwiftyJSON-OSX"; + }; + A8AFB76A19D14A670070765E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2E4FF00C19575CE600351305; + remoteInfo = "SwiftyJSON-OSXTests"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireSwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A8AFB71319D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Alamofire-SwiftyJSON.h"; sourceTree = ""; }; + A8AFB71A19D1401D0070765E /* AlamofireSwiftyJSONTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AlamofireSwiftyJSONTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A8AFB71D19D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alamofire_SwiftyJSONTests.swift; sourceTree = ""; }; + A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Alamofire-SwiftyJSON.swift"; sourceTree = ""; }; + A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; + A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyJSON.xcodeproj; path = SwiftyJSON/SwiftyJSON.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A8AFB70B19D1401D0070765E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A8AFB71719D1401D0070765E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A8AFB70519D1401D0070765E = { + isa = PBXGroup; + children = ( + A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */, + A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */, + A8AFB71119D1401D0070765E /* Source */, + A8AFB71B19D1401D0070765E /* Tests */, + A8AFB71019D1401D0070765E /* Products */, + ); + sourceTree = ""; + }; + A8AFB71019D1401D0070765E /* Products */ = { + isa = PBXGroup; + children = ( + A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */, + A8AFB71A19D1401D0070765E /* AlamofireSwiftyJSONTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + A8AFB71119D1401D0070765E /* Source */ = { + isa = PBXGroup; + children = ( + A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */, + A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */, + A8AFB71219D1401D0070765E /* Supporting Files */, + ); + path = Source; + sourceTree = ""; + }; + A8AFB71219D1401D0070765E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + A8AFB71319D1401D0070765E /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + A8AFB71B19D1401D0070765E /* Tests */ = { + isa = PBXGroup; + children = ( + A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */, + A8AFB71C19D1401D0070765E /* Supporting Files */, + ); + path = Tests; + sourceTree = ""; + }; + A8AFB71C19D1401D0070765E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + A8AFB71D19D1401D0070765E /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + A8AFB75519D14A5C0070765E /* Products */ = { + isa = PBXGroup; + children = ( + A8AFB75A19D14A5C0070765E /* Alamofire.framework */, + A8AFB75C19D14A5C0070765E /* AlamofireTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + A8AFB75E19D14A670070765E /* Products */ = { + isa = PBXGroup; + children = ( + A8AFB76519D14A670070765E /* SwiftyJSON.framework */, + A8AFB76719D14A670070765E /* SwiftyJSONTests.xctest */, + A8AFB76919D14A670070765E /* SwiftyJSON.framework */, + A8AFB76B19D14A670070765E /* SwiftyJSON-OSXTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + A8AFB70C19D1401D0070765E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A8AFB71519D1401D0070765E /* Alamofire-SwiftyJSON.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */ = { + isa = PBXNativeTarget; + buildConfigurationList = A8AFB72219D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSON" */; + buildPhases = ( + A8AFB70A19D1401D0070765E /* Sources */, + A8AFB70B19D1401D0070765E /* Frameworks */, + A8AFB70C19D1401D0070765E /* Headers */, + A8AFB70D19D1401D0070765E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AlamofireSwiftyJSON; + productName = "Alamofire-SwiftyJSON"; + productReference = A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */; + productType = "com.apple.product-type.framework"; + }; + A8AFB71919D1401D0070765E /* AlamofireSwiftyJSONTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A8AFB72519D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSONTests" */; + buildPhases = ( + A8AFB71619D1401D0070765E /* Sources */, + A8AFB71719D1401D0070765E /* Frameworks */, + A8AFB71819D1401D0070765E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AlamofireSwiftyJSONTests; + productName = "Alamofire-SwiftyJSONTests"; + productReference = A8AFB71A19D1401D0070765E /* AlamofireSwiftyJSONTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A8AFB70619D1401D0070765E /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + ORGANIZATIONNAME = SwiftJSON; + TargetAttributes = { + A8AFB70E19D1401D0070765E = { + CreatedOnToolsVersion = 6.0.1; + }; + A8AFB71919D1401D0070765E = { + CreatedOnToolsVersion = 6.0.1; + }; + }; + }; + buildConfigurationList = A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "Alamofire-SwiftyJSON" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = A8AFB70519D1401D0070765E; + productRefGroup = A8AFB71019D1401D0070765E /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = A8AFB75519D14A5C0070765E /* Products */; + ProjectRef = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + }, + { + ProductGroup = A8AFB75E19D14A670070765E /* Products */; + ProjectRef = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */, + A8AFB71919D1401D0070765E /* AlamofireSwiftyJSONTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + A8AFB75A19D14A5C0070765E /* Alamofire.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Alamofire.framework; + remoteRef = A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A8AFB75C19D14A5C0070765E /* AlamofireTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = AlamofireTests.xctest; + remoteRef = A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A8AFB76519D14A670070765E /* SwiftyJSON.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SwiftyJSON.framework; + remoteRef = A8AFB76419D14A670070765E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A8AFB76719D14A670070765E /* SwiftyJSONTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = SwiftyJSONTests.xctest; + remoteRef = A8AFB76619D14A670070765E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A8AFB76919D14A670070765E /* SwiftyJSON.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SwiftyJSON.framework; + remoteRef = A8AFB76819D14A670070765E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A8AFB76B19D14A670070765E /* SwiftyJSON-OSXTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "SwiftyJSON-OSXTests.xctest"; + remoteRef = A8AFB76A19D14A670070765E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + A8AFB70D19D1401D0070765E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A8AFB71819D1401D0070765E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A8AFB70A19D1401D0070765E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A8AFB72919D140BD0070765E /* Alamofire-SwiftyJSON.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A8AFB71619D1401D0070765E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A8AFB71F19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + A8AFB72019D1401D0070765E /* 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; + CURRENT_PROJECT_VERSION = 1; + ENABLE_STRICT_OBJC_MSGSEND = YES; + 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_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 = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A8AFB72119D1401D0070765E /* 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 = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + A8AFB72319D1401D0070765E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + A8AFB72419D1401D0070765E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + A8AFB72619D1401D0070765E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + A8AFB72719D1401D0070765E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "Alamofire-SwiftyJSON" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A8AFB72019D1401D0070765E /* Debug */, + A8AFB72119D1401D0070765E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A8AFB72219D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSON" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A8AFB72319D1401D0070765E /* Debug */, + A8AFB72419D1401D0070765E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A8AFB72519D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSONTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A8AFB72619D1401D0070765E /* Debug */, + A8AFB72719D1401D0070765E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A8AFB70619D1401D0070765E /* Project object */; +} diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..80f599f --- /dev/null +++ b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/README.md b/README.md index c9197e6..1528550 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -Alamofire-SwiftJSON +Alamofire-SwiftyJSON =================== diff --git a/Source/Alamofire-SwiftyJSON.h b/Source/Alamofire-SwiftyJSON.h new file mode 100644 index 0000000..2f8bd28 --- /dev/null +++ b/Source/Alamofire-SwiftyJSON.h @@ -0,0 +1,19 @@ +// +// Alamofire-SwiftyJSON.h +// Alamofire-SwiftyJSON +// +// Created by Pinglin Tang on 14-9-23. +// Copyright (c) 2014年 SwiftJSON. All rights reserved. +// + +#import + +//! Project version number for Alamofire-SwiftyJSON. +FOUNDATION_EXPORT double Alamofire_SwiftyJSONVersionNumber; + +//! Project version string for Alamofire-SwiftyJSON. +FOUNDATION_EXPORT const unsigned char Alamofire_SwiftyJSONVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Source/Alamofire-SwiftyJSON.swift b/Source/Alamofire-SwiftyJSON.swift new file mode 100644 index 0000000..f33725a --- /dev/null +++ b/Source/Alamofire-SwiftyJSON.swift @@ -0,0 +1,51 @@ +// +// AlamofireSwiftyJSON.swift +// AlamofireSwiftyJSON +// +// Created by Pinglin Tang on 14-9-22. +// Copyright (c) 2014年 swiftyJSON. All rights reserved. +// + +import Foundation + +import Alamofire +import SwiftyJSON + +// MARK: - Request JSON + +//public func requestJSON(method: Alamofire.Method, URLString: Alamofire.URLStringConvertible, parameters: [String: AnyObject]? = nil) -> Alamofire.Request { +// return Alamofire.request(method, URLString , parameters: parameters, encoding: ParameterEncoding.JSON) +//} + +// MARK: - Request + +extension Alamofire.Request { + + // MARK: - Swift JSON + + public func responseSwiftyJSON(completionHandler: (NSURLRequest, NSHTTPURLResponse?, SwiftyJSON.JSON, NSError?) -> Void) -> Self { + return responseSwiftyJSON(completionHandler: completionHandler) + } + + public func responseSwiftyJSON(priority: Int = DISPATCH_QUEUE_PRIORITY_DEFAULT, queue: dispatch_queue_t? = nil, options: NSJSONReadingOptions = .AllowFragments, completionHandler: (NSURLRequest, NSHTTPURLResponse?, SwiftyJSON.JSON, NSError?) -> Void) -> Self { + + return response(priority: priority, queue: queue, serializer: Alamofire.Request.JSONResponseSerializer(options: options), completionHandler: { (request, response, object, error) in + dispatch_async(dispatch_get_global_queue(priority, 0), { + + var responseJSON: SwiftyJSON.JSON + + if (error != nil) { + responseJSON = SwiftyJSON.JSON.Null(error) + } else { + responseJSON = SwiftyJSON.JSON(object: object!) + } + + dispatch_async(queue ?? dispatch_get_main_queue(), { + completionHandler(self.request, self.response, responseJSON, nil) + }) + }) + }) + } +} + + diff --git a/Source/Info.plist b/Source/Info.plist new file mode 100644 index 0000000..2df69f5 --- /dev/null +++ b/Source/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.swiftjson.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/SwiftyJSON b/SwiftyJSON new file mode 160000 index 0000000..cf6462a --- /dev/null +++ b/SwiftyJSON @@ -0,0 +1 @@ +Subproject commit cf6462aa5fd12da3b9adc95f551e8b8f10ce47f7 diff --git a/Tests/Alamofire_SwiftyJSONTests.swift b/Tests/Alamofire_SwiftyJSONTests.swift new file mode 100644 index 0000000..2e4c705 --- /dev/null +++ b/Tests/Alamofire_SwiftyJSONTests.swift @@ -0,0 +1,35 @@ +// +// Alamofire_SwiftyJSONTests.swift +// Alamofire-SwiftyJSONTests +// +// Created by Pinglin Tang on 14-9-23. +// Copyright (c) 2014年 SwiftJSON. All rights reserved. +// + +import UIKit +import XCTest +import Alamofire +import SwiftyJSON +import AlamofireSwiftyJSON + +class Alamofire_SwiftyJSONTests: XCTestCase { + + func testJSONResponse() { + let URL = "http://httpbin.org/get" + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL, parameters: ["foo": "bar"]) + .responseSwiftyJSON { (request, response, responseJSON, error) in + expectation.fulfill() + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNil(error, "error should be nil") + XCTAssertEqual(responseJSON["args"], SwiftyJSON.JSON(object: ["foo": "bar"] as NSDictionary), "args should be equal") + } + + waitForExpectationsWithTimeout(10) { (error) in + XCTAssertNil(error, "\(error)") + } + } + +} diff --git a/Tests/Info.plist b/Tests/Info.plist new file mode 100644 index 0000000..1558953 --- /dev/null +++ b/Tests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.swiftjson.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + +