diff --git a/DemoApp/Cartfile b/DemoApp/Cartfile new file mode 100644 index 0000000..13c2ef0 --- /dev/null +++ b/DemoApp/Cartfile @@ -0,0 +1,3 @@ +github "nghialv/Future" +github "Alamofire/Alamofire" == 1.2.2 +github "ikesyo/Himotoki" == 0.3 diff --git a/DemoApp/Cartfile.resolved b/DemoApp/Cartfile.resolved new file mode 100644 index 0000000..7d0181b --- /dev/null +++ b/DemoApp/Cartfile.resolved @@ -0,0 +1,5 @@ +github "Alamofire/Alamofire" "1.2.2" +github "robrix/Box" "1.2.2" +github "ikesyo/Himotoki" "0.3" +github "antitypical/Result" "0.4.3" +github "nghialv/Future" "0.0.4" diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Alamofire b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Alamofire new file mode 120000 index 0000000..f70a4e4 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Alamofire @@ -0,0 +1 @@ +Versions/Current/Alamofire \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Headers b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Modules b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Resources b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire new file mode 100755 index 0000000..c46ad2d Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire differ diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire-Swift.h b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire-Swift.h new file mode 100644 index 0000000..f2ec68f --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire-Swift.h @@ -0,0 +1,111 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +@import Foundation; +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" + +@interface NSURL (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly, copy) NSString * __nonnull URLString; +@end + + +@interface NSURLComponents (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly, copy) NSString * __nonnull URLString; +@end + + +@interface NSURLRequest (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly) NSURLRequest * __nonnull URLRequest; +@end + + +@interface NSURLRequest (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly, copy) NSString * __nonnull URLString; +@end + +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h new file mode 100644 index 0000000..f56a1e1 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h @@ -0,0 +1,26 @@ +// Alamofire.h +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..c1c5872 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..0112c83 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..8096dcc --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Alamofire { + umbrella header "Alamofire.h" + + export * + module * { export * } +} + +module Alamofire.Swift { + header "Alamofire-Swift.h" +} diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..56ee278 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,45 @@ + + + + + BuildMachineOSBuild + 14D136 + CFBundleDevelopmentRegion + en + CFBundleExecutable + Alamofire + CFBundleIdentifier + com.alamofire.Alamofire + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Alamofire + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.2.2 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6D2105 + DTPlatformVersion + GM + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0632 + DTXcodeBuild + 6D2105 + UIDeviceFamily + + 1 + 2 + + + diff --git a/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/Current b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Alamofire.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Box b/DemoApp/Carthage/Build/Mac/Box.framework/Box new file mode 120000 index 0000000..ca4d6a7 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Box @@ -0,0 +1 @@ +Versions/Current/Box \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Headers b/DemoApp/Carthage/Build/Mac/Box.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Modules b/DemoApp/Carthage/Build/Mac/Box.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Resources b/DemoApp/Carthage/Build/Mac/Box.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Box b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Box new file mode 100755 index 0000000..b8f0eb6 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Box differ diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Headers/Box-Swift.h b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Headers/Box-Swift.h new file mode 100644 index 0000000..73ae01b --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Headers/Box-Swift.h @@ -0,0 +1,90 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.49.6 clang-602.0.49) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Headers/Box.h b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Headers/Box.h new file mode 100644 index 0000000..f02cc1c --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Headers/Box.h @@ -0,0 +1,7 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Project version number for Box. +extern double BoxVersionNumber; + +/// Project version string for Box. +extern const unsigned char BoxVersionString[]; diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/Box.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/Box.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..9e2cacb Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/Box.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/Box.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/Box.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..b9000f0 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/Box.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/module.modulemap b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..b086458 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Box { + umbrella header "Box.h" + + export * + module * { export * } +} + +module Box.Swift { + header "Box-Swift.h" +} diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Resources/Info.plist b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..77fdf5b --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,42 @@ + + + + + BuildMachineOSBuild + 14D136 + CFBundleDevelopmentRegion + en + CFBundleExecutable + Box + CFBundleIdentifier + com.antitypical.Box + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Box + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.2.1 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6D1002 + DTPlatformVersion + GM + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0631 + DTXcodeBuild + 6D1002 + NSHumanReadableCopyright + Copyright © 2014 Rob Rix. All rights reserved. + + diff --git a/DemoApp/Carthage/Build/Mac/Box.framework/Versions/Current b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Box.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Headers b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Himotoki b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Himotoki new file mode 120000 index 0000000..a81cb33 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Himotoki @@ -0,0 +1 @@ +Versions/Current/Himotoki \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Modules b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Resources b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Headers/Himotoki-Swift.h b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Headers/Himotoki-Swift.h new file mode 100644 index 0000000..e3d2122 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Headers/Himotoki-Swift.h @@ -0,0 +1,95 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +@import Foundation; +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" + +@interface NSNumber (SWIFT_EXTENSION(Himotoki)) +@end + +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Headers/Himotoki.h b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Headers/Himotoki.h new file mode 100644 index 0000000..f777374 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Headers/Himotoki.h @@ -0,0 +1,19 @@ +// +// Himotoki.h +// Himotoki +// +// Created by Syo Ikeda on 5/2/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +@import Foundation; + +//! Project version number for Himotoki. +FOUNDATION_EXPORT double HimotokiVersionNumber; + +//! Project version string for Himotoki. +FOUNDATION_EXPORT const unsigned char HimotokiVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Himotoki b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Himotoki new file mode 100755 index 0000000..46de625 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Himotoki differ diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/Himotoki.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/Himotoki.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..7513114 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/Himotoki.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/Himotoki.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/Himotoki.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..a168724 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/Himotoki.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/module.modulemap b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..ad592f0 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Himotoki { + umbrella header "Himotoki.h" + + export * + module * { export * } +} + +module Himotoki.Swift { + header "Himotoki-Swift.h" +} diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Resources/Info.plist b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..f7a9961 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,47 @@ + + + + + BuildMachineOSBuild + 14D136 + CFBundleDevelopmentRegion + en + CFBundleExecutable + Himotoki + CFBundleIdentifier + com.ikesyo.Himotoki + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Himotoki + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.3 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6D2105 + DTPlatformVersion + GM + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0632 + DTXcodeBuild + 6D2105 + NSHumanReadableCopyright + Copyright © 2015 Syo Ikeda. All rights reserved. + UIDeviceFamily + + 1 + 2 + + + diff --git a/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/Current b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Himotoki.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Headers b/DemoApp/Carthage/Build/Mac/Result.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Modules b/DemoApp/Carthage/Build/Mac/Result.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Resources b/DemoApp/Carthage/Build/Mac/Result.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Result b/DemoApp/Carthage/Build/Mac/Result.framework/Result new file mode 120000 index 0000000..d95252c --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Result @@ -0,0 +1 @@ +Versions/Current/Result \ No newline at end of file diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Headers/Result-Swift.h b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Headers/Result-Swift.h new file mode 100644 index 0000000..66932cb --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Headers/Result-Swift.h @@ -0,0 +1,90 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Headers/Result.h b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Headers/Result.h new file mode 100644 index 0000000..4742701 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Headers/Result.h @@ -0,0 +1,8 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// Project version number for Result. +extern double ResultVersionNumber; + +/// Project version string for Result. +extern const unsigned char ResultVersionString[]; + diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/Result.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/Result.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..56477a3 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/Result.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/Result.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/Result.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..6f88615 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/Result.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/module.modulemap b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..670fe85 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Result { + umbrella header "Result.h" + + export * + module * { export * } +} + +module Result.Swift { + header "Result-Swift.h" +} diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Resources/Info.plist b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..c1b4276 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,42 @@ + + + + + BuildMachineOSBuild + 14D136 + CFBundleDevelopmentRegion + en + CFBundleExecutable + Result + CFBundleIdentifier + com.antitypical.Result + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Result + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.1 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6D2105 + DTPlatformVersion + GM + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0632 + DTXcodeBuild + 6D2105 + NSHumanReadableCopyright + Copyright © 2015 Rob Rix. All rights reserved. + + diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Result b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Result new file mode 100755 index 0000000..f5e0386 Binary files /dev/null and b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/A/Result differ diff --git a/DemoApp/Carthage/Build/Mac/Result.framework/Versions/Current b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/DemoApp/Carthage/Build/Mac/Result.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Alamofire b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Alamofire new file mode 100755 index 0000000..c6117f8 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Alamofire differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h new file mode 100644 index 0000000..f2ec68f --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h @@ -0,0 +1,111 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +@import Foundation; +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" + +@interface NSURL (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly, copy) NSString * __nonnull URLString; +@end + + +@interface NSURLComponents (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly, copy) NSString * __nonnull URLString; +@end + + +@interface NSURLRequest (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly) NSURLRequest * __nonnull URLRequest; +@end + + +@interface NSURLRequest (SWIFT_EXTENSION(Alamofire)) +@property (nonatomic, readonly, copy) NSString * __nonnull URLString; +@end + +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h new file mode 100644 index 0000000..f56a1e1 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h @@ -0,0 +1,26 @@ +// Alamofire.h +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Info.plist b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Info.plist new file mode 100644 index 0000000..4b5e116 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Info.plist differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc new file mode 100644 index 0000000..126bed3 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule new file mode 100644 index 0000000..69cd17b Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc new file mode 100644 index 0000000..35ba371 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule new file mode 100644 index 0000000..c987e25 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc new file mode 100644 index 0000000..20fabf6 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule new file mode 100644 index 0000000..bf5470b Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..4ffca3f Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..519cc10 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap new file mode 100644 index 0000000..8096dcc --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Alamofire { + umbrella header "Alamofire.h" + + export * + module * { export * } +} + +module Alamofire.Swift { + header "Alamofire-Swift.h" +} diff --git a/DemoApp/Carthage/Build/iOS/Alamofire.framework/_CodeSignature/CodeResources b/DemoApp/Carthage/Build/iOS/Alamofire.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..c96c765 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Alamofire.framework/_CodeSignature/CodeResources @@ -0,0 +1,167 @@ + + + + + files + + Headers/Alamofire-Swift.h + + HiQtSuDBMB+nsgQg1fOFtUYxpE0= + + Headers/Alamofire.h + + wyYe0HQCA0Vux7J1SUB1vFFWZ0o= + + Info.plist + + EIMCKJkYM8w39LdS2cyg7ltgjJo= + + Modules/Alamofire.swiftmodule/arm.swiftdoc + + z0J1iKF0L7MzkoRvSo6EFoAoSjE= + + Modules/Alamofire.swiftmodule/arm.swiftmodule + + D++XIfCWfunkB2iwmFDsA9uvPus= + + Modules/Alamofire.swiftmodule/arm64.swiftdoc + + 3L0wY9RGmza29vUhfscRNugA1Cs= + + Modules/Alamofire.swiftmodule/arm64.swiftmodule + + /4ESt+is+NfICdBZrChc6Qc0He8= + + Modules/module.modulemap + + oUms7QxpPFGK02DLqqScqq/7uwc= + + + files2 + + Headers/Alamofire-Swift.h + + HiQtSuDBMB+nsgQg1fOFtUYxpE0= + + Headers/Alamofire.h + + wyYe0HQCA0Vux7J1SUB1vFFWZ0o= + + Modules/Alamofire.swiftmodule/arm.swiftdoc + + z0J1iKF0L7MzkoRvSo6EFoAoSjE= + + Modules/Alamofire.swiftmodule/arm.swiftmodule + + D++XIfCWfunkB2iwmFDsA9uvPus= + + Modules/Alamofire.swiftmodule/arm64.swiftdoc + + 3L0wY9RGmza29vUhfscRNugA1Cs= + + Modules/Alamofire.swiftmodule/arm64.swiftmodule + + /4ESt+is+NfICdBZrChc6Qc0He8= + + Modules/module.modulemap + + oUms7QxpPFGK02DLqqScqq/7uwc= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Box b/DemoApp/Carthage/Build/iOS/Box.framework/Box new file mode 100755 index 0000000..0206878 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Box differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Headers/Box-Swift.h b/DemoApp/Carthage/Build/iOS/Box.framework/Headers/Box-Swift.h new file mode 100644 index 0000000..73ae01b --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Box.framework/Headers/Box-Swift.h @@ -0,0 +1,90 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.49.6 clang-602.0.49) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Headers/Box.h b/DemoApp/Carthage/Build/iOS/Box.framework/Headers/Box.h new file mode 100644 index 0000000..f02cc1c --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Box.framework/Headers/Box.h @@ -0,0 +1,7 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Project version number for Box. +extern double BoxVersionNumber; + +/// Project version string for Box. +extern const unsigned char BoxVersionString[]; diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Info.plist b/DemoApp/Carthage/Build/iOS/Box.framework/Info.plist new file mode 100644 index 0000000..4a98090 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Info.plist differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc new file mode 100644 index 0000000..ca5ad19 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule new file mode 100644 index 0000000..914b372 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc new file mode 100644 index 0000000..0802ed5 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule new file mode 100644 index 0000000..7eb5c3e Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc new file mode 100644 index 0000000..685aa99 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule new file mode 100644 index 0000000..81d769a Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..c1b5cbc Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..e5ee84b Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/Modules/module.modulemap b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/module.modulemap new file mode 100644 index 0000000..b086458 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Box.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Box { + umbrella header "Box.h" + + export * + module * { export * } +} + +module Box.Swift { + header "Box-Swift.h" +} diff --git a/DemoApp/Carthage/Build/iOS/Box.framework/_CodeSignature/CodeResources b/DemoApp/Carthage/Build/iOS/Box.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..bd57f53 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Box.framework/_CodeSignature/CodeResources @@ -0,0 +1,167 @@ + + + + + files + + Headers/Box-Swift.h + + qpNwbc70WqEhHzgL5eH74Svcd5o= + + Headers/Box.h + + nmP0pfgOTIIjouM50OP0Gk7vRt8= + + Info.plist + + saJ8JoKyCXsr+uDOjAUx1rvzu90= + + Modules/Box.swiftmodule/arm.swiftdoc + + HyXpkJxa6eg0JCl1rYRhKZ2Y7es= + + Modules/Box.swiftmodule/arm.swiftmodule + + LUT3kf2C19WznYMDCalcjaIppVs= + + Modules/Box.swiftmodule/arm64.swiftdoc + + zhwe7rdrGurNSUyZvRvq9tK+tc4= + + Modules/Box.swiftmodule/arm64.swiftmodule + + 6xYKYl/zYmkap/VxTcdilaODiFQ= + + Modules/module.modulemap + + sjqqh+nTHklxYs1FTQ/ooHPm/Fc= + + + files2 + + Headers/Box-Swift.h + + qpNwbc70WqEhHzgL5eH74Svcd5o= + + Headers/Box.h + + nmP0pfgOTIIjouM50OP0Gk7vRt8= + + Modules/Box.swiftmodule/arm.swiftdoc + + HyXpkJxa6eg0JCl1rYRhKZ2Y7es= + + Modules/Box.swiftmodule/arm.swiftmodule + + LUT3kf2C19WznYMDCalcjaIppVs= + + Modules/Box.swiftmodule/arm64.swiftdoc + + zhwe7rdrGurNSUyZvRvq9tK+tc4= + + Modules/Box.swiftmodule/arm64.swiftmodule + + 6xYKYl/zYmkap/VxTcdilaODiFQ= + + Modules/module.modulemap + + sjqqh+nTHklxYs1FTQ/ooHPm/Fc= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Box b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Box new file mode 100755 index 0000000..6538cf6 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Box differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Headers/Box-Swift.h b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Headers/Box-Swift.h new file mode 100644 index 0000000..73ae01b --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Headers/Box-Swift.h @@ -0,0 +1,90 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.49.6 clang-602.0.49) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Headers/Box.h b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Headers/Box.h new file mode 100644 index 0000000..f02cc1c --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Headers/Box.h @@ -0,0 +1,7 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Project version number for Box. +extern double BoxVersionNumber; + +/// Project version string for Box. +extern const unsigned char BoxVersionString[]; diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Info.plist b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Info.plist new file mode 100644 index 0000000..4a98090 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Info.plist differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc new file mode 100644 index 0000000..ca5ad19 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule new file mode 100644 index 0000000..914b372 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc new file mode 100644 index 0000000..0802ed5 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule new file mode 100644 index 0000000..7eb5c3e Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc new file mode 100644 index 0000000..685aa99 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule new file mode 100644 index 0000000..81d769a Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..c1b5cbc Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..e5ee84b Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/module.modulemap b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/module.modulemap new file mode 100644 index 0000000..b086458 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Box { + umbrella header "Box.h" + + export * + module * { export * } +} + +module Box.Swift { + header "Box-Swift.h" +} diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/_CodeSignature/CodeResources b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..584899c --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Box.framework/_CodeSignature/CodeResources @@ -0,0 +1,199 @@ + + + + + files + + Headers/Box-Swift.h + + qpNwbc70WqEhHzgL5eH74Svcd5o= + + Headers/Box.h + + nmP0pfgOTIIjouM50OP0Gk7vRt8= + + Info.plist + + saJ8JoKyCXsr+uDOjAUx1rvzu90= + + Modules/Box.swiftmodule/arm.swiftdoc + + HyXpkJxa6eg0JCl1rYRhKZ2Y7es= + + Modules/Box.swiftmodule/arm.swiftmodule + + LUT3kf2C19WznYMDCalcjaIppVs= + + Modules/Box.swiftmodule/arm64.swiftdoc + + zhwe7rdrGurNSUyZvRvq9tK+tc4= + + Modules/Box.swiftmodule/arm64.swiftmodule + + 6xYKYl/zYmkap/VxTcdilaODiFQ= + + Modules/Box.swiftmodule/i386.swiftdoc + + XfpkSdj2cBCC9+DnJxBijPdFPDQ= + + Modules/Box.swiftmodule/i386.swiftmodule + + yEAabX4IA6Jn1mVCZC+Uai/kEGk= + + Modules/Box.swiftmodule/x86_64.swiftdoc + + MCyfkAuKnoUiff0xUAwRAJ6dDZE= + + Modules/Box.swiftmodule/x86_64.swiftmodule + + T9CanbER0odVzI+TBCCteX5glHE= + + Modules/module.modulemap + + sjqqh+nTHklxYs1FTQ/ooHPm/Fc= + + + files2 + + Headers/Box-Swift.h + + qpNwbc70WqEhHzgL5eH74Svcd5o= + + Headers/Box.h + + nmP0pfgOTIIjouM50OP0Gk7vRt8= + + Modules/Box.swiftmodule/arm.swiftdoc + + HyXpkJxa6eg0JCl1rYRhKZ2Y7es= + + Modules/Box.swiftmodule/arm.swiftmodule + + LUT3kf2C19WznYMDCalcjaIppVs= + + Modules/Box.swiftmodule/arm64.swiftdoc + + zhwe7rdrGurNSUyZvRvq9tK+tc4= + + Modules/Box.swiftmodule/arm64.swiftmodule + + 6xYKYl/zYmkap/VxTcdilaODiFQ= + + Modules/Box.swiftmodule/i386.swiftdoc + + XfpkSdj2cBCC9+DnJxBijPdFPDQ= + + Modules/Box.swiftmodule/i386.swiftmodule + + yEAabX4IA6Jn1mVCZC+Uai/kEGk= + + Modules/Box.swiftmodule/x86_64.swiftdoc + + MCyfkAuKnoUiff0xUAwRAJ6dDZE= + + Modules/Box.swiftmodule/x86_64.swiftmodule + + T9CanbER0odVzI+TBCCteX5glHE= + + Modules/module.modulemap + + sjqqh+nTHklxYs1FTQ/ooHPm/Fc= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Headers/Result-Swift.h b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Headers/Result-Swift.h new file mode 100644 index 0000000..66932cb --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Headers/Result-Swift.h @@ -0,0 +1,90 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Headers/Result.h b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Headers/Result.h new file mode 100644 index 0000000..4742701 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Headers/Result.h @@ -0,0 +1,8 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// Project version number for Result. +extern double ResultVersionNumber; + +/// Project version string for Result. +extern const unsigned char ResultVersionString[]; + diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Info.plist b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Info.plist new file mode 100644 index 0000000..29b3b92 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Info.plist differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc new file mode 100644 index 0000000..b4e4259 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule new file mode 100644 index 0000000..167863c Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc new file mode 100644 index 0000000..38dd0b9 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule new file mode 100644 index 0000000..87cf30c Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc new file mode 100644 index 0000000..38e314a Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule new file mode 100644 index 0000000..7bb39a7 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..ca6d258 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..fd1b3f8 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/module.modulemap b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/module.modulemap new file mode 100644 index 0000000..670fe85 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Result { + umbrella header "Result.h" + + export * + module * { export * } +} + +module Result.Swift { + header "Result-Swift.h" +} diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Result b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Result new file mode 100755 index 0000000..c8c4a1c Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/Result differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/_CodeSignature/CodeResources b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..92832f4 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Frameworks/Result.framework/_CodeSignature/CodeResources @@ -0,0 +1,199 @@ + + + + + files + + Headers/Result-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Headers/Result.h + + K5huSHbVS0eoaGcCY/zk2FJun04= + + Info.plist + + oJlpfBrFrdmS6xsRwPHywyNYe9o= + + Modules/Result.swiftmodule/arm.swiftdoc + + klPqwQOpOOAyQQx/ntk/dhwz50k= + + Modules/Result.swiftmodule/arm.swiftmodule + + stM4PgGHgMyr4CKJJEwsOapFyIw= + + Modules/Result.swiftmodule/arm64.swiftdoc + + 9jCrEKYn7DgAx6LqSZMLL3Nxl6s= + + Modules/Result.swiftmodule/arm64.swiftmodule + + 3LKHN6mKBrESVbcQjRW56SyV0D8= + + Modules/Result.swiftmodule/i386.swiftdoc + + ogk2Y6eAMqzvsObWnj6Fg27a9rw= + + Modules/Result.swiftmodule/i386.swiftmodule + + K3zA/YmcwzLDzOGYFWpbeJE8pcE= + + Modules/Result.swiftmodule/x86_64.swiftdoc + + XhrdRlYEPTxf6LghRASLl0yFKs0= + + Modules/Result.swiftmodule/x86_64.swiftmodule + + oQFd2TT/60CWykLI9ATpduTp94k= + + Modules/module.modulemap + + A9qDcpgbzcrA5e3QYP/4TvbkUvg= + + + files2 + + Headers/Result-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Headers/Result.h + + K5huSHbVS0eoaGcCY/zk2FJun04= + + Modules/Result.swiftmodule/arm.swiftdoc + + klPqwQOpOOAyQQx/ntk/dhwz50k= + + Modules/Result.swiftmodule/arm.swiftmodule + + stM4PgGHgMyr4CKJJEwsOapFyIw= + + Modules/Result.swiftmodule/arm64.swiftdoc + + 9jCrEKYn7DgAx6LqSZMLL3Nxl6s= + + Modules/Result.swiftmodule/arm64.swiftmodule + + 3LKHN6mKBrESVbcQjRW56SyV0D8= + + Modules/Result.swiftmodule/i386.swiftdoc + + ogk2Y6eAMqzvsObWnj6Fg27a9rw= + + Modules/Result.swiftmodule/i386.swiftmodule + + K3zA/YmcwzLDzOGYFWpbeJE8pcE= + + Modules/Result.swiftmodule/x86_64.swiftdoc + + XhrdRlYEPTxf6LghRASLl0yFKs0= + + Modules/Result.swiftmodule/x86_64.swiftmodule + + oQFd2TT/60CWykLI9ATpduTp94k= + + Modules/module.modulemap + + A9qDcpgbzcrA5e3QYP/4TvbkUvg= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Future b/DemoApp/Carthage/Build/iOS/Future.framework/Future new file mode 100755 index 0000000..4bc5500 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Future differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Headers/Future-Swift.h b/DemoApp/Carthage/Build/iOS/Future.framework/Headers/Future-Swift.h new file mode 100644 index 0000000..66932cb --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Headers/Future-Swift.h @@ -0,0 +1,90 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Headers/Future.h b/DemoApp/Carthage/Build/iOS/Future.framework/Headers/Future.h new file mode 100644 index 0000000..aa5c00d --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Headers/Future.h @@ -0,0 +1,19 @@ +// +// Future.h +// Future +// +// Created by Le VanNghia on 5/31/15. +// Copyright (c) 2015 Le VanNghia. All rights reserved. +// + +#import + +//! Project version number for Future. +FOUNDATION_EXPORT double FutureVersionNumber; + +//! Project version string for Future. +FOUNDATION_EXPORT const unsigned char FutureVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Info.plist b/DemoApp/Carthage/Build/iOS/Future.framework/Info.plist new file mode 100644 index 0000000..f26d950 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Info.plist differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm.swiftdoc new file mode 100644 index 0000000..c7899ba Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm.swiftmodule new file mode 100644 index 0000000..cdf5a8e Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm64.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm64.swiftdoc new file mode 100644 index 0000000..3d480ab Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm64.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm64.swiftmodule new file mode 100644 index 0000000..9a4f03d Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/arm64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/i386.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/i386.swiftdoc new file mode 100644 index 0000000..da6f30a Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/i386.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/i386.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/i386.swiftmodule new file mode 100644 index 0000000..bc9437d Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/i386.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..3eb6d38 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..f5b916e Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/Future.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/Modules/module.modulemap b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/module.modulemap new file mode 100644 index 0000000..352de01 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Future { + umbrella header "Future.h" + + export * + module * { export * } +} + +module Future.Swift { + header "Future-Swift.h" +} diff --git a/DemoApp/Carthage/Build/iOS/Future.framework/_CodeSignature/CodeResources b/DemoApp/Carthage/Build/iOS/Future.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..bb1d299 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Future.framework/_CodeSignature/CodeResources @@ -0,0 +1,391 @@ + + + + + files + + Frameworks/Box.framework/Box + + WSTPrME2GlKhpso5WoHgXkGcaFQ= + + Frameworks/Box.framework/Headers/Box-Swift.h + + qpNwbc70WqEhHzgL5eH74Svcd5o= + + Frameworks/Box.framework/Headers/Box.h + + nmP0pfgOTIIjouM50OP0Gk7vRt8= + + Frameworks/Box.framework/Info.plist + + saJ8JoKyCXsr+uDOjAUx1rvzu90= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc + + HyXpkJxa6eg0JCl1rYRhKZ2Y7es= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule + + LUT3kf2C19WznYMDCalcjaIppVs= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc + + zhwe7rdrGurNSUyZvRvq9tK+tc4= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule + + 6xYKYl/zYmkap/VxTcdilaODiFQ= + + Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc + + XfpkSdj2cBCC9+DnJxBijPdFPDQ= + + Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule + + yEAabX4IA6Jn1mVCZC+Uai/kEGk= + + Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc + + MCyfkAuKnoUiff0xUAwRAJ6dDZE= + + Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule + + T9CanbER0odVzI+TBCCteX5glHE= + + Frameworks/Box.framework/Modules/module.modulemap + + sjqqh+nTHklxYs1FTQ/ooHPm/Fc= + + Frameworks/Box.framework/_CodeSignature/CodeResources + + /F6914RkEad7BAlvLhwQLXcqDPE= + + Frameworks/Result.framework/Headers/Result-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Frameworks/Result.framework/Headers/Result.h + + K5huSHbVS0eoaGcCY/zk2FJun04= + + Frameworks/Result.framework/Info.plist + + oJlpfBrFrdmS6xsRwPHywyNYe9o= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc + + klPqwQOpOOAyQQx/ntk/dhwz50k= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule + + stM4PgGHgMyr4CKJJEwsOapFyIw= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc + + 9jCrEKYn7DgAx6LqSZMLL3Nxl6s= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule + + 3LKHN6mKBrESVbcQjRW56SyV0D8= + + Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc + + ogk2Y6eAMqzvsObWnj6Fg27a9rw= + + Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule + + K3zA/YmcwzLDzOGYFWpbeJE8pcE= + + Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc + + XhrdRlYEPTxf6LghRASLl0yFKs0= + + Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule + + oQFd2TT/60CWykLI9ATpduTp94k= + + Frameworks/Result.framework/Modules/module.modulemap + + A9qDcpgbzcrA5e3QYP/4TvbkUvg= + + Frameworks/Result.framework/Result + + fSdIH5oHo1Gprx6+h9TZ1wXlnEw= + + Frameworks/Result.framework/_CodeSignature/CodeResources + + mONoQqSUcyEs1/49l6PmVPDUYCs= + + Headers/Future-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Headers/Future.h + + gDnopmf+z1+jF0sDXkKubH7X2DI= + + Info.plist + + 3AXlchXpNkfz6czGay1IYZdY0BU= + + Modules/Future.swiftmodule/arm.swiftdoc + + ZEY1sTneeJE/oAzGY7y8rq7DGng= + + Modules/Future.swiftmodule/arm.swiftmodule + + axFJJ4BO+i/NdGOGZyiDYeyG/Uk= + + Modules/Future.swiftmodule/arm64.swiftdoc + + G2cjNy9LJqDUR9XT9sHxHxtGPw0= + + Modules/Future.swiftmodule/arm64.swiftmodule + + YARQe+YGP771BVY3vkDgMONsOI4= + + Modules/module.modulemap + + 5QpX0A2m8ja8WilfKAyKWkg53f8= + + + files2 + + Frameworks/Box.framework/Box + + WSTPrME2GlKhpso5WoHgXkGcaFQ= + + Frameworks/Box.framework/Headers/Box-Swift.h + + qpNwbc70WqEhHzgL5eH74Svcd5o= + + Frameworks/Box.framework/Headers/Box.h + + nmP0pfgOTIIjouM50OP0Gk7vRt8= + + Frameworks/Box.framework/Info.plist + + saJ8JoKyCXsr+uDOjAUx1rvzu90= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftdoc + + HyXpkJxa6eg0JCl1rYRhKZ2Y7es= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm.swiftmodule + + LUT3kf2C19WznYMDCalcjaIppVs= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftdoc + + zhwe7rdrGurNSUyZvRvq9tK+tc4= + + Frameworks/Box.framework/Modules/Box.swiftmodule/arm64.swiftmodule + + 6xYKYl/zYmkap/VxTcdilaODiFQ= + + Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftdoc + + XfpkSdj2cBCC9+DnJxBijPdFPDQ= + + Frameworks/Box.framework/Modules/Box.swiftmodule/i386.swiftmodule + + yEAabX4IA6Jn1mVCZC+Uai/kEGk= + + Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftdoc + + MCyfkAuKnoUiff0xUAwRAJ6dDZE= + + Frameworks/Box.framework/Modules/Box.swiftmodule/x86_64.swiftmodule + + T9CanbER0odVzI+TBCCteX5glHE= + + Frameworks/Box.framework/Modules/module.modulemap + + sjqqh+nTHklxYs1FTQ/ooHPm/Fc= + + Frameworks/Box.framework/_CodeSignature/CodeResources + + /F6914RkEad7BAlvLhwQLXcqDPE= + + Frameworks/Result.framework/Headers/Result-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Frameworks/Result.framework/Headers/Result.h + + K5huSHbVS0eoaGcCY/zk2FJun04= + + Frameworks/Result.framework/Info.plist + + oJlpfBrFrdmS6xsRwPHywyNYe9o= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc + + klPqwQOpOOAyQQx/ntk/dhwz50k= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule + + stM4PgGHgMyr4CKJJEwsOapFyIw= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc + + 9jCrEKYn7DgAx6LqSZMLL3Nxl6s= + + Frameworks/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule + + 3LKHN6mKBrESVbcQjRW56SyV0D8= + + Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc + + ogk2Y6eAMqzvsObWnj6Fg27a9rw= + + Frameworks/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule + + K3zA/YmcwzLDzOGYFWpbeJE8pcE= + + Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc + + XhrdRlYEPTxf6LghRASLl0yFKs0= + + Frameworks/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule + + oQFd2TT/60CWykLI9ATpduTp94k= + + Frameworks/Result.framework/Modules/module.modulemap + + A9qDcpgbzcrA5e3QYP/4TvbkUvg= + + Frameworks/Result.framework/Result + + fSdIH5oHo1Gprx6+h9TZ1wXlnEw= + + Frameworks/Result.framework/_CodeSignature/CodeResources + + mONoQqSUcyEs1/49l6PmVPDUYCs= + + Headers/Future-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Headers/Future.h + + gDnopmf+z1+jF0sDXkKubH7X2DI= + + Modules/Future.swiftmodule/arm.swiftdoc + + ZEY1sTneeJE/oAzGY7y8rq7DGng= + + Modules/Future.swiftmodule/arm.swiftmodule + + axFJJ4BO+i/NdGOGZyiDYeyG/Uk= + + Modules/Future.swiftmodule/arm64.swiftdoc + + G2cjNy9LJqDUR9XT9sHxHxtGPw0= + + Modules/Future.swiftmodule/arm64.swiftmodule + + YARQe+YGP771BVY3vkDgMONsOI4= + + Modules/module.modulemap + + 5QpX0A2m8ja8WilfKAyKWkg53f8= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Headers/Himotoki-Swift.h b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Headers/Himotoki-Swift.h new file mode 100644 index 0000000..e3d2122 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Headers/Himotoki-Swift.h @@ -0,0 +1,95 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +@import Foundation; +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" + +@interface NSNumber (SWIFT_EXTENSION(Himotoki)) +@end + +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Headers/Himotoki.h b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Headers/Himotoki.h new file mode 100644 index 0000000..f777374 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Headers/Himotoki.h @@ -0,0 +1,19 @@ +// +// Himotoki.h +// Himotoki +// +// Created by Syo Ikeda on 5/2/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +@import Foundation; + +//! Project version number for Himotoki. +FOUNDATION_EXPORT double HimotokiVersionNumber; + +//! Project version string for Himotoki. +FOUNDATION_EXPORT const unsigned char HimotokiVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Himotoki b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Himotoki new file mode 100755 index 0000000..7345424 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Himotoki differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Info.plist b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Info.plist new file mode 100644 index 0000000..102bcc9 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Info.plist differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm.swiftdoc b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm.swiftdoc new file mode 100644 index 0000000..4596861 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm.swiftmodule b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm.swiftmodule new file mode 100644 index 0000000..a65e7d4 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm64.swiftdoc b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm64.swiftdoc new file mode 100644 index 0000000..ef9b5bf Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm64.swiftmodule b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm64.swiftmodule new file mode 100644 index 0000000..4ffb466 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/arm64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/i386.swiftdoc b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/i386.swiftdoc new file mode 100644 index 0000000..7e88945 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/i386.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/i386.swiftmodule b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/i386.swiftmodule new file mode 100644 index 0000000..fd05ce8 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/i386.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..d241b58 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..a6fb48d Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/Himotoki.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/module.modulemap b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/module.modulemap new file mode 100644 index 0000000..ad592f0 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Himotoki.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Himotoki { + umbrella header "Himotoki.h" + + export * + module * { export * } +} + +module Himotoki.Swift { + header "Himotoki-Swift.h" +} diff --git a/DemoApp/Carthage/Build/iOS/Himotoki.framework/_CodeSignature/CodeResources b/DemoApp/Carthage/Build/iOS/Himotoki.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..bd6a18b --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Himotoki.framework/_CodeSignature/CodeResources @@ -0,0 +1,167 @@ + + + + + files + + Headers/Himotoki-Swift.h + + +bHmivMHk/ujshKQvkwpcdY0Ybs= + + Headers/Himotoki.h + + Fr6/3Yl/R3ZMAnANlsyzMNVIF3A= + + Info.plist + + 5X/dR2kuTcioZtH8KPuDsg0m8mQ= + + Modules/Himotoki.swiftmodule/arm.swiftdoc + + A2eTogKiLHTWft8BXxTzJsuLuCg= + + Modules/Himotoki.swiftmodule/arm.swiftmodule + + berorCXwgX7j1VCg1jktMb8+EJ8= + + Modules/Himotoki.swiftmodule/arm64.swiftdoc + + sdmdOpt2IH23arpFkPn3hcPRYpQ= + + Modules/Himotoki.swiftmodule/arm64.swiftmodule + + 2z1un+FnMN+gF1EdBPNXz2JnlBg= + + Modules/module.modulemap + + 783etFBwKSSWpSYSYmjEUQiaV6M= + + + files2 + + Headers/Himotoki-Swift.h + + +bHmivMHk/ujshKQvkwpcdY0Ybs= + + Headers/Himotoki.h + + Fr6/3Yl/R3ZMAnANlsyzMNVIF3A= + + Modules/Himotoki.swiftmodule/arm.swiftdoc + + A2eTogKiLHTWft8BXxTzJsuLuCg= + + Modules/Himotoki.swiftmodule/arm.swiftmodule + + berorCXwgX7j1VCg1jktMb8+EJ8= + + Modules/Himotoki.swiftmodule/arm64.swiftdoc + + sdmdOpt2IH23arpFkPn3hcPRYpQ= + + Modules/Himotoki.swiftmodule/arm64.swiftmodule + + 2z1un+FnMN+gF1EdBPNXz2JnlBg= + + Modules/module.modulemap + + 783etFBwKSSWpSYSYmjEUQiaV6M= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Headers/Result-Swift.h b/DemoApp/Carthage/Build/iOS/Result.framework/Headers/Result-Swift.h new file mode 100644 index 0000000..66932cb --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Result.framework/Headers/Result-Swift.h @@ -0,0 +1,90 @@ +// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) +#pragma clang diagnostic push + +#if defined(__has_include) && __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if defined(__has_include) && __has_include() +# include +#elif !defined(__cplusplus) || __cplusplus < 201103L +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +#endif + +typedef struct _NSZone NSZone; + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif + +#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type +#endif +#if __has_feature(nullability) +# define SWIFT_NULLABILITY(X) X +#else +# if !defined(__nonnull) +# define __nonnull +# endif +# if !defined(__nullable) +# define __nullable +# endif +# if !defined(__null_unspecified) +# define __null_unspecified +# endif +# define SWIFT_NULLABILITY(X) +#endif +#if defined(__has_feature) && __has_feature(modules) +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#pragma clang diagnostic pop diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Headers/Result.h b/DemoApp/Carthage/Build/iOS/Result.framework/Headers/Result.h new file mode 100644 index 0000000..4742701 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Result.framework/Headers/Result.h @@ -0,0 +1,8 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// Project version number for Result. +extern double ResultVersionNumber; + +/// Project version string for Result. +extern const unsigned char ResultVersionString[]; + diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Info.plist b/DemoApp/Carthage/Build/iOS/Result.framework/Info.plist new file mode 100644 index 0000000..29b3b92 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Info.plist differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc new file mode 100644 index 0000000..b4e4259 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule new file mode 100644 index 0000000..167863c Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc new file mode 100644 index 0000000..38dd0b9 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule new file mode 100644 index 0000000..87cf30c Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc new file mode 100644 index 0000000..38e314a Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/i386.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule new file mode 100644 index 0000000..7bb39a7 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/i386.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc new file mode 100644 index 0000000..ca6d258 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/x86_64.swiftdoc differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule new file mode 100644 index 0000000..fd1b3f8 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Modules/module.modulemap b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/module.modulemap new file mode 100644 index 0000000..670fe85 --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Result.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module Result { + umbrella header "Result.h" + + export * + module * { export * } +} + +module Result.Swift { + header "Result-Swift.h" +} diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/Result b/DemoApp/Carthage/Build/iOS/Result.framework/Result new file mode 100755 index 0000000..2af94b6 Binary files /dev/null and b/DemoApp/Carthage/Build/iOS/Result.framework/Result differ diff --git a/DemoApp/Carthage/Build/iOS/Result.framework/_CodeSignature/CodeResources b/DemoApp/Carthage/Build/iOS/Result.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..9343ada --- /dev/null +++ b/DemoApp/Carthage/Build/iOS/Result.framework/_CodeSignature/CodeResources @@ -0,0 +1,167 @@ + + + + + files + + Headers/Result-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Headers/Result.h + + K5huSHbVS0eoaGcCY/zk2FJun04= + + Info.plist + + oJlpfBrFrdmS6xsRwPHywyNYe9o= + + Modules/Result.swiftmodule/arm.swiftdoc + + klPqwQOpOOAyQQx/ntk/dhwz50k= + + Modules/Result.swiftmodule/arm.swiftmodule + + stM4PgGHgMyr4CKJJEwsOapFyIw= + + Modules/Result.swiftmodule/arm64.swiftdoc + + 9jCrEKYn7DgAx6LqSZMLL3Nxl6s= + + Modules/Result.swiftmodule/arm64.swiftmodule + + 3LKHN6mKBrESVbcQjRW56SyV0D8= + + Modules/module.modulemap + + A9qDcpgbzcrA5e3QYP/4TvbkUvg= + + + files2 + + Headers/Result-Swift.h + + JsKtiw/cyhHWQIv/DaTPIDboCIs= + + Headers/Result.h + + K5huSHbVS0eoaGcCY/zk2FJun04= + + Modules/Result.swiftmodule/arm.swiftdoc + + klPqwQOpOOAyQQx/ntk/dhwz50k= + + Modules/Result.swiftmodule/arm.swiftmodule + + stM4PgGHgMyr4CKJJEwsOapFyIw= + + Modules/Result.swiftmodule/arm64.swiftdoc + + 9jCrEKYn7DgAx6LqSZMLL3Nxl6s= + + Modules/Result.swiftmodule/arm64.swiftmodule + + 3LKHN6mKBrESVbcQjRW56SyV0D8= + + Modules/module.modulemap + + A9qDcpgbzcrA5e3QYP/4TvbkUvg= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/.gitignore b/DemoApp/Carthage/Checkouts/Alamofire/.gitignore new file mode 100644 index 0000000..ee2640c --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/.gitignore @@ -0,0 +1,23 @@ +# Mac OS X +.DS_Store + +# Xcode +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate + +# Carthage +Carthage/Build diff --git a/DemoApp/Carthage/Checkouts/Alamofire/.travis.yml b/DemoApp/Carthage/Checkouts/Alamofire/.travis.yml new file mode 100644 index 0000000..692efa6 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/.travis.yml @@ -0,0 +1,16 @@ +language: objective-c +osx_image: xcode63 +branches: + only: + - master +env: +- LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 +before_install: +- gem install xcpretty -N +script: +- set -o pipefail +- xcodebuild -project Alamofire.xcodeproj -scheme "Alamofire iOS" -sdk iphonesimulator + -destination "platform=iOS Simulator,name=iPhone 6" ONLY_ACTIVE_ARCH=NO test | xcpretty -c +- xcodebuild -project "iOS Example.xcodeproj" -scheme "iOS Example" -sdk iphonesimulator + -destination "platform=iOS Simulator,name=iPhone 6" ONLY_ACTIVE_ARCH=YES build | xcpretty -c +- pod lib lint --quick diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.playground/contents.xcplayground b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.playground/contents.xcplayground new file mode 100644 index 0000000..3b51ce8 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.playground/contents.xcplayground @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.playground/section-1.swift b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.playground/section-1.swift new file mode 100644 index 0000000..06469b2 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.playground/section-1.swift @@ -0,0 +1,13 @@ +import XCPlayground +import Foundation +import Alamofire + +// Allow network requests to complete +XCPSetExecutionShouldContinueIndefinitely() + +Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) + .responseString { (request, response, string, error) in + println(request) + println(response) + println(string) + } diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.podspec b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.podspec new file mode 100644 index 0000000..ffadd14 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.podspec @@ -0,0 +1,17 @@ +Pod::Spec.new do |s| + s.name = 'Alamofire' + s.version = '1.2.2' + s.license = 'MIT' + s.summary = 'Elegant HTTP Networking in Swift' + s.homepage = 'https://github.com/Alamofire/Alamofire' + s.social_media_url = 'http://twitter.com/mattt' + s.authors = { 'Mattt Thompson' => 'm@mattt.me' } + s.source = { :git => 'https://github.com/Alamofire/Alamofire.git', :tag => s.version } + + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.9' + + s.source_files = 'Source/*.swift' + + s.requires_arc = true +end diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5e5e952 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj @@ -0,0 +1,762 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; + 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; + 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; + 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; + 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; + 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; + 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; + 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; + 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; + 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; + 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; + 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; + 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; + 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; + 4DD67C241A5C58FB00ED2280 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; + F8111E3919A95C8B0040E7D1 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; + F8111E6119A9674D0040E7D1 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; + F8111E6419A9674D0040E7D1 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; + F829C6B81A7A94F100A2CD59 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; }; + F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; + F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; + F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; + F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; + F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; + F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; + F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; + F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; + F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; + F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; + F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; + F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; + F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; + F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; + F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; + F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + F8111E6519A967880040E7D1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F8111E3219A95C8B0040E7D1; + remoteInfo = Alamofire; + }; + F829C6B91A7A94F100A2CD59 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4DD67C0A1A5C55C900ED2280; + remoteInfo = "Alamofire OSX"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 4CDE2C361AF8932A00BABAE5 /* Manager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Manager.swift; sourceTree = ""; }; + 4CDE2C391AF899EC00BABAE5 /* Request.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; + 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Download.swift; sourceTree = ""; }; + 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Upload.swift; sourceTree = ""; }; + 4CDE2C421AF89F0900BABAE5 /* Validation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validation.swift; sourceTree = ""; }; + 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerialization.swift; sourceTree = ""; }; + 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncoding.swift; sourceTree = ""; }; + 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F8111E3319A95C8B0040E7D1 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F8111E3719A95C8B0040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F8111E3819A95C8B0040E7D1 /* Alamofire.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Alamofire.h; sourceTree = ""; }; + F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + F8111E4119A95C8B0040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadTests.swift; sourceTree = ""; }; + F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncodingTests.swift; sourceTree = ""; }; + F8111E5D19A9674D0040E7D1 /* RequestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; + F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseTests.swift; sourceTree = ""; }; + F8111E5F19A9674D0040E7D1 /* UploadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = ""; }; + F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire OSX Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLSEvaluationTests.swift; sourceTree = ""; }; + F897FF4019AA800700AB5182 /* Alamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Alamofire.swift; sourceTree = ""; }; + F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationTests.swift; sourceTree = ""; }; + F8D1C6F419D52968002E74FE /* ManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagerTests.swift; sourceTree = ""; }; + F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationTests.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4DD67C071A5C55C900ED2280 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8111E2F19A95C8B0040E7D1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8111E3B19A95C8B0040E7D1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F829C6AF1A7A94F100A2CD59 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F829C6B81A7A94F100A2CD59 /* Alamofire.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4CDE2C481AF8A14A00BABAE5 /* Core */ = { + isa = PBXGroup; + children = ( + 4CDE2C361AF8932A00BABAE5 /* Manager.swift */, + 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */, + 4CDE2C391AF899EC00BABAE5 /* Request.swift */, + ); + name = Core; + sourceTree = ""; + }; + 4CDE2C491AF8A14E00BABAE5 /* Features */ = { + isa = PBXGroup; + children = ( + 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */, + 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */, + 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */, + 4CDE2C421AF89F0900BABAE5 /* Validation.swift */, + ); + name = Features; + sourceTree = ""; + }; + F8111E2919A95C8B0040E7D1 = { + isa = PBXGroup; + children = ( + F8111E3519A95C8B0040E7D1 /* Source */, + F8111E3F19A95C8B0040E7D1 /* Tests */, + F8111E3419A95C8B0040E7D1 /* Products */, + ); + sourceTree = ""; + }; + F8111E3419A95C8B0040E7D1 /* Products */ = { + isa = PBXGroup; + children = ( + F8111E3319A95C8B0040E7D1 /* Alamofire.framework */, + F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */, + 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */, + F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + F8111E3519A95C8B0040E7D1 /* Source */ = { + isa = PBXGroup; + children = ( + F897FF4019AA800700AB5182 /* Alamofire.swift */, + 4CDE2C481AF8A14A00BABAE5 /* Core */, + 4CDE2C491AF8A14E00BABAE5 /* Features */, + F8111E3619A95C8B0040E7D1 /* Supporting Files */, + ); + path = Source; + sourceTree = ""; + }; + F8111E3619A95C8B0040E7D1 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F8111E3819A95C8B0040E7D1 /* Alamofire.h */, + F8111E3719A95C8B0040E7D1 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + F8111E3F19A95C8B0040E7D1 /* Tests */ = { + isa = PBXGroup; + children = ( + F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */, + F8111E5D19A9674D0040E7D1 /* RequestTests.swift */, + F8D1C6F419D52968002E74FE /* ManagerTests.swift */, + F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */, + F8111E5F19A9674D0040E7D1 /* UploadTests.swift */, + F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */, + F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */, + F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */, + F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */, + F8111E4019A95C8B0040E7D1 /* Supporting Files */, + ); + path = Tests; + sourceTree = ""; + }; + F8111E4019A95C8B0040E7D1 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F8111E4119A95C8B0040E7D1 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 4DD67C081A5C55C900ED2280 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4DD67C241A5C58FB00ED2280 /* Alamofire.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8111E3019A95C8B0040E7D1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + F8111E3919A95C8B0040E7D1 /* Alamofire.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */; + buildPhases = ( + 4DD67C061A5C55C900ED2280 /* Sources */, + 4DD67C071A5C55C900ED2280 /* Frameworks */, + 4DD67C081A5C55C900ED2280 /* Headers */, + 4DD67C091A5C55C900ED2280 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Alamofire OSX"; + productName = AlamofireOSX; + productReference = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + F8111E3219A95C8B0040E7D1 /* Alamofire iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8111E4619A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS" */; + buildPhases = ( + F8111E2E19A95C8B0040E7D1 /* Sources */, + F8111E2F19A95C8B0040E7D1 /* Frameworks */, + F8111E3019A95C8B0040E7D1 /* Headers */, + F8111E3119A95C8B0040E7D1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Alamofire iOS"; + productName = Alamofire; + productReference = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + F8111E3D19A95C8B0040E7D1 /* Alamofire iOS Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8111E4919A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS Tests" */; + buildPhases = ( + F8111E3A19A95C8B0040E7D1 /* Sources */, + F8111E3B19A95C8B0040E7D1 /* Frameworks */, + F8111E3C19A95C8B0040E7D1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F8111E6619A967880040E7D1 /* PBXTargetDependency */, + ); + name = "Alamofire iOS Tests"; + productName = AlamofireTests; + productReference = F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */; + buildPhases = ( + F829C6AE1A7A94F100A2CD59 /* Sources */, + F829C6AF1A7A94F100A2CD59 /* Frameworks */, + F829C6B01A7A94F100A2CD59 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */, + ); + name = "Alamofire OSX Tests"; + productName = "Alamofire OSX Tests"; + productReference = F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F8111E2A19A95C8B0040E7D1 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + ORGANIZATIONNAME = Alamofire; + TargetAttributes = { + 4DD67C0A1A5C55C900ED2280 = { + CreatedOnToolsVersion = 6.1.1; + }; + F8111E3219A95C8B0040E7D1 = { + CreatedOnToolsVersion = 6.0; + }; + F8111E3D19A95C8B0040E7D1 = { + CreatedOnToolsVersion = 6.0; + }; + F829C6B11A7A94F100A2CD59 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Alamofire" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = F8111E2919A95C8B0040E7D1; + productRefGroup = F8111E3419A95C8B0040E7D1 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F8111E3219A95C8B0040E7D1 /* Alamofire iOS */, + 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */, + F8111E3D19A95C8B0040E7D1 /* Alamofire iOS Tests */, + F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4DD67C091A5C55C900ED2280 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8111E3119A95C8B0040E7D1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8111E3C19A95C8B0040E7D1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F829C6B01A7A94F100A2CD59 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4DD67C061A5C55C900ED2280 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */, + 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, + 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */, + 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, + 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */, + 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */, + 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */, + 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8111E2E19A95C8B0040E7D1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */, + 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, + 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */, + 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, + 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */, + F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */, + 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */, + 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8111E3A19A95C8B0040E7D1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */, + F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */, + F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */, + F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */, + F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */, + F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */, + F8111E6119A9674D0040E7D1 /* ParameterEncodingTests.swift in Sources */, + F8111E6419A9674D0040E7D1 /* UploadTests.swift in Sources */, + F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F829C6AE1A7A94F100A2CD59 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */, + F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */, + F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */, + F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */, + F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */, + F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */, + F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */, + F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */, + F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + F8111E6619A967880040E7D1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F8111E3219A95C8B0040E7D1 /* Alamofire iOS */; + targetProxy = F8111E6519A967880040E7D1 /* PBXContainerItemProxy */; + }; + F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */; + targetProxy = F829C6B91A7A94F100A2CD59 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 4DD67C1F1A5C55C900ED2280 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = Alamofire; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 4DD67C201A5C55C900ED2280 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = Alamofire; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; + F8111E4419A95C8B0040E7D1 /* 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; + MACOSX_DEPLOYMENT_TARGET = 10.9; + 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; + }; + F8111E4519A95C8B0040E7D1 /* 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; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + F8111E4719A95C8B0040E7D1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Alamofire; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + F8111E4819A95C8B0040E7D1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Alamofire; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + }; + name = Release; + }; + F8111E4A19A95C8B0040E7D1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + F8111E4B19A95C8B0040E7D1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + F829C6BC1A7A94F100A2CD59 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + F829C6BD1A7A94F100A2CD59 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4DD67C1F1A5C55C900ED2280 /* Debug */, + 4DD67C201A5C55C900ED2280 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Alamofire" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8111E4419A95C8B0040E7D1 /* Debug */, + F8111E4519A95C8B0040E7D1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8111E4619A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8111E4719A95C8B0040E7D1 /* Debug */, + F8111E4819A95C8B0040E7D1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8111E4919A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8111E4A19A95C8B0040E7D1 /* Debug */, + F8111E4B19A95C8B0040E7D1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F829C6BC1A7A94F100A2CD59 /* Debug */, + F829C6BD1A7A94F100A2CD59 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F8111E2A19A95C8B0040E7D1 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme new file mode 100644 index 0000000..023e0d1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme new file mode 100644 index 0000000..43344a9 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/CHANGELOG.md b/DemoApp/Carthage/Checkouts/Alamofire/CHANGELOG.md new file mode 100644 index 0000000..bb1ae99 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/CHANGELOG.md @@ -0,0 +1,407 @@ +# Change Log +All notable changes to this project will be documented in this file. +`Alamofire` adheres to [Semantic Versioning](http://semver.org/). + +- `1.2.x` Releases - [1.2.0](#120) | [1.2.1](#121) | [1.2.2](#122) +- `1.1.x` Releases - [1.1.0](#110) | [1.1.1](#111) | [1.1.2](#112) | [1.1.3](#113) | [1.1.4](#114) | [1.1.5](#115) +- `1.0.x` Releases - [1.0.0](#100) | [1.0.1](#101) + +--- + +## 1.2.2 +Released on 2015-05-13. + +#### Added +- Contributing Guidelines document to the project. + - Added by [Mattt Thompson](https://github.com/mattt). +- Documentation to the `URLStringConvertible` protocol around RFC specs. + - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue + [#464](https://github.com/Alamofire/Alamofire/pull/464). +- The `Carthage/Build` ignore flag to the `.gitignore` file. + - Added by [Tomáš Slíž](https://github.com/tomassliz) in Pull Request + [#451](https://github.com/Alamofire/Alamofire/pull/451). +- The `.DS_Store` ignore flag to the `.gitignore` file. + - Added by [Christian Noon](https://github.com/cnoon). +- Response status code asserts for redirect tests. + - Added by [Christian Noon](https://github.com/cnoon). +- A CHANGELOG to the project documenting each official release. + - Added by [Christian Noon](https://github.com/cnoon). + +#### Updated +- `SessionDelegate` override closure properties to match the method signatures. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#456](https://github.com/Alamofire/Alamofire/pull/456). +- Documentation for the `Printable` protocol on `Request` to reference output stream +rather than the specific `OutputStreamType`. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Deployment targets to iOS 8.0 and OS X 10.9 for the respective frameworks. + - Updated by [Christian Noon](https://github.com/cnoon). +- `SessionDelegate` willPerformHTTPRedirection method to accept optional return type +from override closure. + - Updated by [Chungsub Kim](https://github.com/subicura) in Pull Request + [#469](https://github.com/Alamofire/Alamofire/pull/469). +- Embedded Framework and Source File documentation in the README. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#427](https://github.com/Alamofire/Alamofire/pull/427). +- Alamofire source to be split into multiple core files and feature files. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#471](https://github.com/Alamofire/Alamofire/pull/471). +- `TaskDelegate` override closure signatures and delegate method implementations. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Removed +- Travis-CI build status from the README until Xcode 6.3 is supported. + - Removed by [Mattt Thompson](https://github.com/mattt). +- Unnecessary parentheses from closure parameters and typealiases. + - Removed by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- `SessionDelegate` override closure documentation. + - Fixed by [Siemen Sikkema](https://github.com/siemensikkema) in Pull Request + [#448](https://github.com/Alamofire/Alamofire/pull/448). +- Some inaccurate documentation on several of the public `SessionDelegate` closures. + - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#456](https://github.com/Alamofire/Alamofire/pull/456). +- A deinit race condition where the task delegate queue could fail to `dispatch_release`. + - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#379](https://github.com/Alamofire/Alamofire/pull/379). +- `TaskDelegate` to only set `qualityOfService` for `NSOperationQueue` on iOS 8+. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#472](https://github.com/Alamofire/Alamofire/pull/472). +- Expectation order issue in the redirect tests. + - Fixed by [Christian Noon](https://github.com/cnoon). +- `DataTaskDelegate` behavior ensuring `NSProgress` values and `progress` override +closures are always updated and executed. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#407](https://github.com/Alamofire/Alamofire/pull/407). + +## 1.2.1 +Released on 2015-04-21. + +#### Added +- Redirect tests for the `SessionDelegate`. + - Added by [Jonathan Hersh](https://github.com/jhersh) in Pull Request + [#424](https://github.com/Alamofire/Alamofire/pull/424). +- TLS evaluation test case. + - Added by [Mattt Thompson](https://github.com/mattt). +- Additional guards to ensure unique task identifiers for upload and download tasks. + - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue + [#393](https://github.com/Alamofire/Alamofire/pull/393). + +#### Updated +- Required Xcode version to Xcode to 6.3 in the README. + - Updated by [Mattt Thompson](https://github.com/mattt). +- SSL validation to use default system validation by default. + - Updated by [Michael Thole](https://github.com/mthole) in Pull Request + [#394](https://github.com/Alamofire/Alamofire/pull/394). + +## 1.2.0 +Released on 2015-04-09. + +#### Added +- New `testURLParameterEncodeStringWithSlashKeyStringWithQuestionMarkValueParameter` +test. + - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue + [#370](https://github.com/Alamofire/Alamofire/pull/370). +- New `backgroundCompletionHandler` property to the `Manager` called when the +session background tasks finish. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#317](https://github.com/Alamofire/Alamofire/pull/317). + +#### Updated +- `Request` computed property `progress` to no longer be an optional type. + - Updated by [Pitiphong Phongpattranont](https://github.com/pitiphong-p) in + Pull Request + [#404](https://github.com/Alamofire/Alamofire/pull/404). +- All logic to Swift 1.2. + - Updated by [Aron Cedercrantz](https://github.com/rastersize) and + [Mattt Thompson](https://github.com/mattt). +- The `responseString` serializer to respect server provided character encoding with +overrideable configuration, default string response serialization to ISO-8859-1, as +per the HTTP/1.1 specification. + - Updated by [Kyle Fuller](https://github.com/kylef) and + [Mattt Thompson](https://github.com/mattt) in Pull Request + [#359](https://github.com/Alamofire/Alamofire/pull/359) which also resolved Issue + [#358](https://github.com/Alamofire/Alamofire/pull/358). +- `SessionDelegate` methods to first call the override closures if set. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#317](https://github.com/Alamofire/Alamofire/pull/317). +- `SessionDelegate` and all override closures to a public ACL allowing for customization. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#317](https://github.com/Alamofire/Alamofire/pull/317). +- `SessionDelegate` class to `final`. + - Updated by [Mattt Thompson](https://github.com/mattt). +- `SessionDelegate` header documentation for method override properties. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Xcode project to set `APPLICATION_EXTENSION_API_ONLY` to `YES` for OS X target. + - Updated by [Mattt Thompson](https://github.com/mattt). + +#### Removed +- Ambiguous response serializer methods that collided with default parameters. + - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#408](https://github.com/Alamofire/Alamofire/pull/408). +- `SessionDelegate` initializer and replaced with default property value. + - Removed by [Mattt Thompson](https://github.com/mattt). + +#### Fixed +- Async tests where asserts were potentially not being run by by moving +`expectation.fullfill()` to end of closures. + - Fixed by [Nate Cook](https://github.com/natecook1000) in Pull Request + [#420](https://github.com/Alamofire/Alamofire/pull/420). +- Small grammatical error in the ParameterEncoding section of the README. + - Fixed by [Aaron Brager](https://github.com/getaaron) in Pull Request + [#416](https://github.com/Alamofire/Alamofire/pull/416). +- Typo in a download test comment. + - Fixed by [Aaron Brager](https://github.com/getaaron) in Pull Request + [#413](https://github.com/Alamofire/Alamofire/pull/413). +- Signature mismatch in the `dataTaskDidBecomeDownloadTask` override closure. + - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#317](https://github.com/Alamofire/Alamofire/pull/317). +- Issue in the `SessionDelegate` where the `DataTaskDelegate` was not being called. + - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#317](https://github.com/Alamofire/Alamofire/pull/317). + +--- + +## 1.1.5 +Released on 2015-03-26. + +#### Added +- Convenience upload functions to the `Manager`. + - Added by [Olivier Bohrer](https://github.com/obohrer) in Pull Request + [#334](https://github.com/Alamofire/Alamofire/pull/334). +- Info to the README about Swift 1.2 support. + - Added by [Mattt Thompson](https://github.com/mattt). + +#### Updated +- All request / upload / download methods on `Manager` to match the top-level functions. + - Updated by [Mattt Thompson](https://github.com/mattt). +- The `testDownloadRequest` to no longer remove the downloaded file. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Ono XML response serializer example in the README. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Travis-CI settings to only build the master branch. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Code signing identities for the frameworks and targets to better support Carthage. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#400](https://github.com/Alamofire/Alamofire/pull/400). +- iOS deployment target to iOS 8.0 for iOS target and tests. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#401](https://github.com/Alamofire/Alamofire/pull/401). +- Legal characters to be escaped according to RFC 3986 Section 3.4. + - Updated by [Stephane Lizeray](https://github.com/slizeray) in Pull Request + [#370](https://github.com/Alamofire/Alamofire/pull/370). + +#### Fixed +- Travis-CI scheme issue, added podspec linting and added ENV variables. + - Fixed by [Jonathan Hersh](https://github.com/jhersh) in Pull Request + [#351](https://github.com/Alamofire/Alamofire/pull/351). +- Code sample in the README in the Manual Parameter Encoding section. + - Fixed by [Petr Korolev](https://github.com/skywinder) in Pull Request + [#381](https://github.com/Alamofire/Alamofire/pull/381). + +## 1.1.4 +Released on 2015-01-30. + +#### Added +- Podspec argument `requires_arc` to the podspec file. + - Added by [Mattt Thompson](https://github.com/mattt). +- Support for Travis-CI for automated testing purposes. + - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request + [#279](https://github.com/Alamofire/Alamofire/pull/279). + +#### Updated +- Installation instructions in the README to include CocoaPods, Carthage and +Embedded Frameworks. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Travis-CI to use Xcode 6.1.1. + - Updated by [Mattt Thompson](https://github.com/mattt). +- The `download` method on `Manager` to use `Request.DownloadFileDestination` typealias. + - Updated by [Alexander Strakovich](https://github.com/astrabot) in Pull Request + [#318](https://github.com/Alamofire/Alamofire/pull/318). +- `RequestTests` to no longer delete all cookies in default session configuration. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Travis-CI yaml file to only build the active architecture. + - Updated by [Mattt Thompson](https://github.com/mattt). +- Deployment targets to iOS 7.0 and Mac OS X 10.9. + - Updated by [Mattt Thompson](https://github.com/mattt). + +#### Removed +- The `tearDown` method in the `AlamofireDownloadResponseTestCase`. + - Removed by [Mattt Thompson](https://github.com/mattt). + +#### Fixed +- Small formatting issue in the CocoaPods Podfile example in the README. + - Fixed by [rborkow](https://github.com/rborkow) in Pull Request + [#313](https://github.com/Alamofire/Alamofire/pull/313). +- Several issues with the iOS and OSX targets in the Xcode project. + - Fixed by [Mattt Thompson](https://github.com/mattt). +- The `testDownloadRequest` in `DownloadTests` by adding `.json` file extension. + - Fixed by [Martin Kavalar](https://github.com/mk) in Pull Request + [#302](https://github.com/Alamofire/Alamofire/pull/302). +- The `AlamofireRequestDebugDescriptionTestCase` on OSX. + - Fixed by [Mattt Thompson](https://github.com/mattt). +- Spec validation error with CocoaPods 0.36.0.beta-1 by disabling -b flags in `cURL` +debug on OSX. + - Fixed by [Mattt Thompson](https://github.com/mattt). +- Travis-CI build issue by adding suppport for an `iOS Example` scheme. + - Fixed by [Yasuharu Ozaki](https://github.com/yasuoza) in Pull Request + [#322](https://github.com/Alamofire/Alamofire/pull/322). + +## 1.1.3 +Released on 2015-01-09. + +#### Added +- Podspec file to support CocoaPods deployment. + - Added by [Marius Rackwitz](https://github.com/mrackwitz) in Pull Request + [#218](https://github.com/Alamofire/Alamofire/pull/218). +- Shared scheme to support Carthage deployments. + - Added by [Yosuke Ishikawa](https://github.com/ishkawa) in Pull Request + [#228](https://github.com/Alamofire/Alamofire/pull/228). +- New target for Alamofire OSX framework. + - Added by [Martin Kavalar](https://github.com/mk) in Pull Request + [#293](https://github.com/Alamofire/Alamofire/pull/293). + +#### Updated +- Upload and Download progress state to be updated before calling progress closure. + - Updated by [Alexander Strakovich](https://github.com/astrabot) in Pull Request + [#278](https://github.com/Alamofire/Alamofire/pull/278). + +#### Fixed +- Some casting code logic in the Generic Response Object Serialization example in +the README. + - Fixed by [Philip Heinser](https://github.com/philipheinser) in Pull Request + [#258](https://github.com/Alamofire/Alamofire/pull/258). +- Indentation formatting of the `responseString` parameter documentation. + - Fixed by [Ah.Miao](https://github.com/mrahmiao) in Pull Request + [#291](https://github.com/Alamofire/Alamofire/pull/291). + +## 1.1.2 +Released on 2014-12-21. + +#### Added +- POST request JSON response test. + - Added by [Mattt Thompson](https://github.com/mattt). + +#### Updated +- The response object example to use a failable initializer in the README. + - Updated by [Mattt Thompson](https://github.com/mattt) in regards to Issue + [#230](https://github.com/Alamofire/Alamofire/pull/230). +- Router example in the README by removing extraneous force unwrap. + - Updated by [Arnaud Mesureur](https://github.com/nsarno) in Pull Request + [#247](https://github.com/Alamofire/Alamofire/pull/247). +- Xcode project `APPLICATION_EXTENSION_API_ONLY` flag to `YES`. + - Updated by [Michael Latta](https://github.com/technomage) in Pull Request + [#273](https://github.com/Alamofire/Alamofire/pull/273). +- Default HTTP header creation by moving it into a public class method. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#261](https://github.com/Alamofire/Alamofire/pull/261). + +#### Fixed +- Upload stream method to set `HTTPBodyStream` for streamed request. + - Fixed by [Florent Vilmart](https://github.com/flovilmart) and + [Mattt Thompson](https://github.com/mattt) in Pull Request + [#241](https://github.com/Alamofire/Alamofire/pull/241). +- ParameterEncoding to compose percent-encoded query strings from +percent-encoded components. + - Fixed by [Oleh Sannikov](https://github.com/sunnycows) in Pull Request + [#249](https://github.com/Alamofire/Alamofire/pull/249). +- Serialization handling of NSData with 0 bytes. + - Fixed by [Mike Owens](https://github.com/mowens) in Pull Request + [#254](https://github.com/Alamofire/Alamofire/pull/254). +- Issue where `suggestedDownloadDestination` parameters were being ignored. + - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#257](https://github.com/Alamofire/Alamofire/pull/257). +- Crash caused by `Manager` deinitialization and added documentation. + - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue + [#269](https://github.com/Alamofire/Alamofire/pull/269). + +## 1.1.1 +Released on 2014-11-20. + +#### Updated +- Dispatch-based synchronized access to subdelegates. + - Updated by [Mattt Thompson](https://github.com/mattt) in regards to Pull Request + [#175](https://github.com/Alamofire/Alamofire/pull/175). +- iOS 7 instructions in the README. + - Updated by [Mattt Thompson](https://github.com/mattt). +- CRUD example in the README to work on Xcode 6.1. + - Updated by [John Beynon](https://github.com/johnbeynon) in Pull Request + [#187](https://github.com/Alamofire/Alamofire/pull/187). +- The `cURL` example annotation in the README to pick up `bash` syntax highlighting. + - Updated by [Samuel E. Giddins](https://github.com/segiddins) in Pull Request + [#208](https://github.com/Alamofire/Alamofire/pull/208). + +#### Fixed +- Out-of-memory exception by replacing `stringByAddingPercentEncodingWithAllowedCharacters` +with `CFURLCreateStringByAddingPercentEscapes`. + - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue + [#206](https://github.com/Alamofire/Alamofire/pull/206). +- Several issues in the README examples where an NSURL initializer needs to be unwrapped. + - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Pull Request + [#213](https://github.com/Alamofire/Alamofire/pull/213). +- Possible exception when force unwrapping optional header properties. + - Fixed by [Mattt Thompson](https://github.com/mattt). +- Optional cookie entry in `cURL` output. + - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue + [#226](https://github.com/Alamofire/Alamofire/pull/226). +- Optional `textLabel` property on cells in the example app. + - Fixed by [Mattt Thompson](https://github.com/mattt). + +## 1.1.0 +Released on 2014-10-20. + +#### Updated +- Project to support Swift 1.1 and Xcode 6.1. + - Updated by [Aral Balkan](https://github.com/aral), + [Ross Kimes](https://github.com/rosskimes), + [Orta Therox](https://github.com/orta), + [Nico du Plessis](https://github.com/nduplessis) + and [Mattt Thompson](https://github.com/mattt). + +--- + +## 1.0.1 +Released on 2014-10-20. + +#### Added +- Tests for upload and download with progress. + - Added by [Mattt Thompson](https://github.com/mattt). +- Test for question marks in url encoded query. + - Added by [Mattt Thompson](https://github.com/mattt). +- The `NSURLSessionConfiguration` headers to `cURL` representation. + - Added by [Matthias Ryne Cheow](https://github.com/rynecheow) in Pull Request + [#140](https://github.com/Alamofire/Alamofire/pull/140). +- Parameter encoding tests for key/value pairs containing spaces. + - Added by [Mattt Thompson](https://github.com/mattt). +- Percent character encoding for the `+` character. + - Added by [Niels van Hoorn](https://github.com/nvh) in Pull Request + [#167](https://github.com/Alamofire/Alamofire/pull/167). +- Escaping for quotes to support JSON in `cURL` commands. + - Added by [John Gibb](https://github.com/johngibb) in Pull Request + [#178](https://github.com/Alamofire/Alamofire/pull/178). +- The `request` method to the `Manager` bringing it more inline with the top-level methods. + - Added by Brian Smith. + +#### Fixed +- Parameter encoding of ampersands and escaping of characters. + - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issues + [#146](https://github.com/Alamofire/Alamofire/pull/146) and + [#162](https://github.com/Alamofire/Alamofire/pull/162). +- Parameter encoding of `HTTPBody` from occurring twice. + - Fixed by Yuri in Pull Request + [#153](https://github.com/Alamofire/Alamofire/pull/153). +- Extraneous dispatch to background by using weak reference for delegate in response. + - Fixed by [Mattt Thompson](https://github.com/mattt). +- Response handler threading issue by adding a `subdelegateQueue` to the `SessionDelegate`. + - Fixed by [Essan Parto](https://github.com/parto) in Pull Request + [#171](https://github.com/Alamofire/Alamofire/pull/171). +- Challenge issue where basic auth credentials were not being unwrapped. + - Fixed by [Mattt Thompson](https://github.com/mattt). + +## 1.0.0 +Released on 2014-09-25. + +#### Added +- Initial release of Alamofire. + - Added by [Mattt Thompson](https://github.com/mattt). diff --git a/DemoApp/Carthage/Checkouts/Alamofire/CONTRIBUTING.md b/DemoApp/Carthage/Checkouts/Alamofire/CONTRIBUTING.md new file mode 100644 index 0000000..5de3be7 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/CONTRIBUTING.md @@ -0,0 +1,91 @@ +# Contributing Guidelines + +This document contains information and guidelines about contributing to this project. +Please read it before you start participating. + +**Topics** + +* [Asking Questions](#asking-questions) +* [Reporting Security Issues](#reporting-security-issues) +* [Reporting Issues](#reporting-other-issues) +* [Developers Certificate of Origin](#developers-certificate-of-origin) +* [Code of Conduct](#code-of-conduct) + +## Asking Questions + +We don't use GitHub as a support forum. +For any usage questions that are not specific to the project itself, +please ask on [Stack Overflow](https://stackoverflow.com) instead. +By doing so, you'll be more likely to quickly solve your problem, +and you'll allow anyone else with the same question to find the answer. +This also allows maintainers to focus on improving the project for others. + +## Reporting Security Issues + +The Alamofire Software Foundation takes security seriously. +If you discover a security issue, please bring it to our attention right away! + +Please **DO NOT** file a public issue, +instead send your report privately to . +This will help ensure that any vulnerabilities that _are_ found +can be [disclosed responsibly](http://en.wikipedia.org/wiki/Responsible_disclosure) +to any affected parties. + +## Reporting Other Issues + +A great way to contribute to the project +is to send a detailed issue when you encounter an problem. +We always appreciate a well-written, thorough bug report. + +Check that the project issues database +doesn't already include that problem or suggestion before submitting an issue. +If you find a match, add a quick "+1" or "I have this problem too." +Doing this helps prioritize the most common problems and requests. + +When reporting issues, please include the following: + +* The version of Xcode you're using +* The version of iOS or OS X you're targeting +* The full output of any stack trace or compiler error +* A code snippet that reproduces the described behavior, if applicable +* Any other details that would be useful in understanding the problem + +This information will help us review and fix your issue faster. + +## Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +- (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +- (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +- (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +- (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Code of Conduct + +The Code of Conduct governs how we behave in public or in private +whenever the project will be judged by our actions. +We expect it to be honored by everyone who contributes to this project. + +See [CONDUCT.md](https://github.com/Alamofire/Foundation/blob/master/CONDUCT.md) for details. + +--- + +*Some of the ideas and wording for the statements above were based on work by the [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) and [Linux](http://elinux.org/Developer_Certificate_Of_Origin) communities. We commend them for their efforts to facilitate collaboration in their projects.* diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/AppDelegate.swift b/DemoApp/Carthage/Checkouts/Alamofire/Example/AppDelegate.swift new file mode 100644 index 0000000..5946f41 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/AppDelegate.swift @@ -0,0 +1,54 @@ +// AppDelegate.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { + + var window: UIWindow? + + // MARK: - UIApplicationDelegate + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { + let splitViewController = self.window!.rootViewController as! UISplitViewController + let navigationController = splitViewController.viewControllers.last as! UINavigationController + navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() + splitViewController.delegate = self + + return true + } + + // MARK: - UISplitViewControllerDelegate + + func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController: UIViewController!, ontoPrimaryViewController primaryViewController: UIViewController!) -> Bool { + if let secondaryAsNavController = secondaryViewController as? UINavigationController { + if let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController { + return topAsDetailController.request == nil + } + } + + return false + } + +} + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/Base.lproj/Main.storyboard b/DemoApp/Carthage/Checkouts/Alamofire/Example/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b447295 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/Base.lproj/Main.storyboard @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/DetailViewController.swift b/DemoApp/Carthage/Checkouts/Alamofire/Example/DetailViewController.swift new file mode 100644 index 0000000..3c599d3 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/DetailViewController.swift @@ -0,0 +1,159 @@ +// DetailViewController.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import UIKit +import Alamofire + +class DetailViewController: UITableViewController { + enum Sections: Int { + case Headers, Body + } + + var request: Alamofire.Request? { + didSet { + oldValue?.cancel() + + self.title = self.request?.description + self.refreshControl?.endRefreshing() + self.headers.removeAll() + self.body = nil + self.elapsedTime = nil + } + } + + var headers: [String: String] = [:] + var body: String? + var elapsedTime: NSTimeInterval? + + override func awakeFromNib() { + super.awakeFromNib() + self.refreshControl?.addTarget(self, action: "refresh", forControlEvents: .ValueChanged) + + } + + // MARK: - UIViewController + + override func viewDidAppear(animated: Bool) { + super.viewDidAppear(animated) + + self.refresh() + } + + // MARK: - IBAction + + @IBAction func refresh() { + if self.request == nil { + return + } + + self.refreshControl?.beginRefreshing() + + let start = CACurrentMediaTime() + self.request?.responseString { (request, response, body, error) in + let end = CACurrentMediaTime() + self.elapsedTime = end - start + + for (field, value) in response!.allHeaderFields { + self.headers["\(field)"] = "\(value)" + } + + self.body = body + + self.tableView.reloadData() + self.refreshControl?.endRefreshing() + } + } + + // MARK: UITableViewDataSource + + override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + switch Sections(rawValue: section)! { + case .Headers: + return self.headers.count + case .Body: + return self.body == nil ? 0 : 1 + default: + return 0 + } + } + + override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + + switch Sections(rawValue: indexPath.section)! { + case .Headers: + let cell = self.tableView.dequeueReusableCellWithIdentifier("Header") as! UITableViewCell + let field = self.headers.keys.array.sorted(<)[indexPath.row] + let value = self.headers[field] + + cell.textLabel?.text = field + cell.detailTextLabel!.text = value + + return cell + case .Body: + let cell = self.tableView.dequeueReusableCellWithIdentifier("Body") as! UITableViewCell + + cell.textLabel?.text = self.body + + return cell + } + } + + // MARK: UITableViewDelegate + + override func numberOfSectionsInTableView(tableView: UITableView) -> Int { + return 2 + } + + override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String { + if self.tableView(tableView, numberOfRowsInSection: section) == 0 { + return "" + } + + switch Sections(rawValue: section)! { + case .Headers: + return "Headers" + case .Body: + return "Body" + } + } + + override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { + switch Sections(rawValue: indexPath.section)! { + case .Body: + return 300 + default: + return tableView.rowHeight + } + } + + override func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String { + if Sections(rawValue: section)! == .Body && self.elapsedTime != nil { + let numberFormatter = NSNumberFormatter() + numberFormatter.numberStyle = .DecimalStyle + + return "Elapsed Time: \(numberFormatter.stringFromNumber(self.elapsedTime!)) sec" + } + + return "" + } +} + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/HTTPBin.swift b/DemoApp/Carthage/Checkouts/Alamofire/Example/HTTPBin.swift new file mode 100644 index 0000000..820d211 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/HTTPBin.swift @@ -0,0 +1,44 @@ +// MasterViewController.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire + +enum HTTPBinRoute: URLStringConvertible { + case Method(Alamofire.Method) + case BasicAuth(String, String) + + var URLString: String { + let baseURLString = "http://httpbin.org/" + let path: String = { + switch self { + case .Method(let method): + return "/\(method.rawValue.lowercaseString)" + case .BasicAuth(let user, let password): + return "/basic-auth/\(user)/\(password)" + } + }() + + return NSURL(string: path, relativeToURL: NSURL(string: baseURLString))!.absoluteString! + } +} + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/AppIcon.appiconset/Contents.json b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..91bf9c1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/LaunchImage.launchimage/Contents.json b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..6f870a4 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,51 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Contents.json b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Contents.json new file mode 100644 index 0000000..b75f650 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Logo.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Logo@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Logo.png b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Logo.png new file mode 100644 index 0000000..4060979 Binary files /dev/null and b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Logo.png differ diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Logo@2x.png b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Logo@2x.png new file mode 100644 index 0000000..adbb083 Binary files /dev/null and b/DemoApp/Carthage/Checkouts/Alamofire/Example/Images.xcassets/Logo.imageset/Logo@2x.png differ diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/Info.plist b/DemoApp/Carthage/Checkouts/Alamofire/Example/Info.plist new file mode 100644 index 0000000..2a41964 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/Info.plist @@ -0,0 +1,55 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.alamofire.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Alamofire + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Example/MasterViewController.swift b/DemoApp/Carthage/Checkouts/Alamofire/Example/MasterViewController.swift new file mode 100644 index 0000000..5e533ef --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Example/MasterViewController.swift @@ -0,0 +1,75 @@ +// MasterViewController.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import UIKit +import Alamofire + +class MasterViewController: UITableViewController { + + @IBOutlet weak var titleImageView: UIImageView! + + var detailViewController: DetailViewController? = nil + var objects = NSMutableArray() + + override func awakeFromNib() { + super.awakeFromNib() + + self.navigationItem.titleView = self.titleImageView + } + + // MARK: - UIViewController + + override func viewDidLoad() { + super.viewDidLoad() + + if let split = self.splitViewController { + let controllers = split.viewControllers + self.detailViewController = controllers.last?.topViewController as? DetailViewController + } + } + + // MARK: - UIStoryboardSegue + + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + if let detailViewController = segue.destinationViewController.topViewController as? DetailViewController { + func requestForSegue(segue: UIStoryboardSegue) -> Request? { + switch segue.identifier as String! { + case "GET": + return Alamofire.request(.GET, "http://httpbin.org/get") + case "POST": + return Alamofire.request(.POST, "http://httpbin.org/post") + case "PUT": + return Alamofire.request(.PUT, "http://httpbin.org/put") + case "DELETE": + return Alamofire.request(.DELETE, "http://httpbin.org/delete") + default: + return nil + } + } + + if let request = requestForSegue(segue) { + detailViewController.request = request + } + } + } +} + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/LICENSE b/DemoApp/Carthage/Checkouts/Alamofire/LICENSE new file mode 100644 index 0000000..5b7934d --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) + +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. diff --git a/DemoApp/Carthage/Checkouts/Alamofire/README.md b/DemoApp/Carthage/Checkouts/Alamofire/README.md new file mode 100644 index 0000000..3b9416a --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/README.md @@ -0,0 +1,828 @@ +![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/assets/alamofire.png) + +Alamofire is an HTTP networking library written in Swift. + +## Features + +- [x] Chainable Request / Response methods +- [x] URL / JSON / plist Parameter Encoding +- [x] Upload File / Data / Stream +- [x] Download using Request or Resume data +- [x] Authentication with NSURLCredential +- [x] HTTP Response Validation +- [x] Progress Closure & NSProgress +- [x] cURL Debug Output +- [x] Comprehensive Unit Test Coverage +- [x] Complete Documentation + +## Requirements + +- iOS 7.0+ / Mac OS X 10.9+ +- Xcode 6.3 + +## Communication + +- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') +- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). +- If you **found a bug**, open an issue. +- If you **have a feature request**, open an issue. +- If you **want to contribute**, submit a pull request. + +## Installation + +> **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks.** +> +> To use Alamofire with a project targeting iOS 7, you must include the `Alamofire.swift` source file directly in your project. See the ['Source File'](#source-file) section for instructions. + +### CocoaPods + +[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. + +CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '8.0' +use_frameworks! + +pod 'Alamofire', '~> 1.2' +``` + +Then, run the following command: + +```bash +$ pod install +``` + +### Carthage + +Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application. + +You can install Carthage with [Homebrew](http://brew.sh/) using the following command: + +```bash +$ brew update +$ brew install carthage +``` + +To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "Alamofire/Alamofire" >= 1.2 +``` + +### Manually + +If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. + +#### Embedded Framework + +- Add Alamofire as a [submodule](http://git-scm.com/docs/git-submodule) by opening the Terminal, `cd`-ing into your top-level project directory, and entering the following command: + +```bash +$ git submodule add https://github.com/Alamofire/Alamofire.git +``` + +- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. + + > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. + +- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. +- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. +- In the tab bar at the top of that window, open the "General" panel. +- Click on the `+` button under the "Embedded Binaries" section. +- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. + + > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. + +- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. + + > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS` or `Alamofire OSX`. + +- And that's it! + +> The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. + +#### Source File + +For application targets that do not support embedded frameworks, such as iOS 7, Alamofire can be integrated by adding the `Alamofire.swift` source file directly into your project. Note that you will no longer need to `import Alamofire` since you are not actually loading a framework. Additionally, any of the calling conventions described in the ['Usage'](#usage) section with the `Alamofire` prefix would instead omit it (for example, `Alamofire.request` becomes `request`), since this functionality is incorporated into the top-level namespace. + +--- + +## Usage + +### Making a Request + +```swift +import Alamofire + +Alamofire.request(.GET, "http://httpbin.org/get") +``` + +### Response Handling + +```swift +Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) + .response { (request, response, data, error) in + println(request) + println(response) + println(error) + } +``` + +> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. + +> Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) is specified to handle the response once it's received. The result of a request is only available inside the scope of a response handler. Any execution contingent on the response or data received from the server must be done within a handler. + +### Response Serialization + +**Built-in Response Methods** + +- `response()` +- `responseString(encoding: NSStringEncoding)` +- `responseJSON(options: NSJSONReadingOptions)` +- `responsePropertyList(options: NSPropertyListReadOptions)` + +#### Response String Handler + +```swift +Alamofire.request(.GET, "http://httpbin.org/get") + .responseString { (_, _, string, _) in + println(string) + } +``` + +#### Response JSON Handler + +```swift +Alamofire.request(.GET, "http://httpbin.org/get") + .responseJSON { (_, _, JSON, _) in + println(JSON) + } +``` + +#### Chained Response Handlers + +Response handlers can even be chained: + +```swift +Alamofire.request(.GET, "http://httpbin.org/get") + .responseString { (_, _, string, _) in + println(string) + } + .responseJSON { (_, _, JSON, _) in + println(JSON) + } +``` + +### HTTP Methods + +`Alamofire.Method` lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): + +```swift +public enum Method: String { + case OPTIONS = "OPTIONS" + case GET = "GET" + case HEAD = "HEAD" + case POST = "POST" + case PUT = "PUT" + case PATCH = "PATCH" + case DELETE = "DELETE" + case TRACE = "TRACE" + case CONNECT = "CONNECT" +} +``` + +These values can be passed as the first argument of the `Alamofire.request` method: + +```swift +Alamofire.request(.POST, "http://httpbin.org/post") + +Alamofire.request(.PUT, "http://httpbin.org/put") + +Alamofire.request(.DELETE, "http://httpbin.org/delete") +``` + +### Parameters + +#### GET Request With URL-Encoded Parameters + +```swift +Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) +// http://httpbin.org/get?foo=bar +``` + +#### POST Request With URL-Encoded Parameters + +```swift +let parameters = [ + "foo": "bar", + "baz": ["a", 1], + "qux": [ + "x": 1, + "y": 2, + "z": 3 + ] +] + +Alamofire.request(.POST, "http://httpbin.org/post", parameters: parameters) +// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 +``` + +### Parameter Encoding + +Parameters can also be encoded as JSON, Property List, or any custom format, using the `ParameterEncoding` enum: + +```swift +enum ParameterEncoding { + case URL + case JSON + case PropertyList(format: NSPropertyListFormat, + options: NSPropertyListWriteOptions) + + func encode(request: NSURLRequest, + parameters: [String: AnyObject]?) -> + (NSURLRequest, NSError?) + { ... } +} +``` + +- `URL`: A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. _Since there is no published specification for how to encode collection types, Alamofire follows the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`)._ +- `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. +- `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. +- `Custom`: Uses the associated closure value to construct a new request given an existing request and parameters. + +#### Manual Parameter Encoding of an NSURLRequest + +```swift +let URL = NSURL(string: "http://httpbin.org/get")! +var request = NSURLRequest(URL: URL) + +let parameters = ["foo": "bar"] +let encoding = Alamofire.ParameterEncoding.URL +(request, _) = encoding.encode(request, parameters: parameters) +``` + +#### POST Request with JSON-encoded Parameters + +```swift +let parameters = [ + "foo": [1,2,3], + "bar": [ + "baz": "qux" + ] +] + +Alamofire.request(.POST, "http://httpbin.org/post", parameters: parameters, encoding: .JSON) +// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} +``` + +### Caching + +Caching is handled on the system framework level by [`NSURLCache`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache). + +### Uploading + +**Supported Upload Types** + +- File +- Data +- Stream + +#### Uploading a File + +```swift +let fileURL = NSBundle.mainBundle() + .URLForResource("Default", + withExtension: "png") + +Alamofire.upload(.POST, "http://httpbin.org/post", file: fileURL) +``` + +#### Uploading w/Progress + +```swift +Alamofire.upload(.POST, "http://httpbin.org/post", file: fileURL) + .progress { (bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) in + println(totalBytesWritten) + } + .responseJSON { (request, response, JSON, error) in + println(JSON) + } +``` + +### Downloading + +**Supported Download Types** + +- Request +- Resume Data + +#### Downloading a File + +```swift +Alamofire.download(.GET, "http://httpbin.org/stream/100", destination: { (temporaryURL, response) in + if let directoryURL = NSFileManager.defaultManager() + .URLsForDirectory(.DocumentDirectory, + inDomains: .UserDomainMask)[0] + as? NSURL { + let pathComponent = response.suggestedFilename + + return directoryURL.URLByAppendingPathComponent(pathComponent!) + } + + return temporaryURL +}) +``` + +#### Using the Default Download Destination + +```swift +let destination = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask) + +Alamofire.download(.GET, "http://httpbin.org/stream/100", destination: destination) +``` + +#### Downloading a File w/Progress + +```swift +Alamofire.download(.GET, "http://httpbin.org/stream/100", destination: destination) + .progress { (bytesRead, totalBytesRead, totalBytesExpectedToRead) in + println(totalBytesRead) + } + .response { (request, response, _, error) in + println(response) + } +``` + +### Authentication + +Authentication is handled on the system framework level by [`NSURLCredential` and `NSURLAuthenticationChallenge`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html). + +**Supported Authentication Schemes** + +- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) +- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) +- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) +- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) + +#### HTTP Basic Authentication + +```swift +let user = "user" +let password = "password" + +Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") + .authenticate(user: user, password: password) + .response {(request, response, _, error) in + println(response) + } +``` + +#### Authentication with NSURLCredential + +```swift +let user = "user" +let password = "password" + +let credential = NSURLCredential(user: user, password: password, persistence: .ForSession) + +Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") + .authenticate(usingCredential: credential) + .response {(request, response, _, error) in + println(response) + } +``` + +### Validation + +By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. + +#### Manual Validation + +```swift +Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) + .validate(statusCode: 200..<300) + .validate(contentType: ["application/json"]) + .response { (_, _, _, error) in + println(error) + } +``` + +#### Automatic Validation + +Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. + +```swift +Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) + .validate() + .response { (_, _, _, error) in + println(error) + } +``` + +### Printable + +```swift +let request = Alamofire.request(.GET, "http://httpbin.org/ip") + +println(request) +// GET http://httpbin.org/ip (200) +``` + +### DebugPrintable + +```swift +let request = Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) + +debugPrintln(request) +``` + +#### Output (cURL) + +```bash +$ curl -i \ + -H "User-Agent: Alamofire" \ + -H "Accept-Encoding: Accept-Encoding: gzip;q=1.0,compress;q=0.5" \ + -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ + "http://httpbin.org/get?foo=bar" +``` + +--- + +## Advanced Usage + +> Alamofire is built on `NSURLSession` and the Foundation URL Loading System. To make the most of +this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. + +**Recommended Reading** + +- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) +- [NSURLSession Class Reference](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/Introduction/Introduction.html#//apple_ref/occ/cl/NSURLSession) +- [NSURLCache Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache) +- [NSURLAuthenticationChallenge Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html) + +### Manager + +Top-level convenience methods like `Alamofire.request` use a shared instance of `Alamofire.Manager`, which is configured with the default `NSURLSessionConfiguration`. + +As such, the following two statements are equivalent: + +```swift +Alamofire.request(.GET, "http://httpbin.org/get") +``` + +```swift +let manager = Alamofire.Manager.sharedInstance +manager.request(NSURLRequest(URL: NSURL(string: "http://httpbin.org/get"))) +``` + +Applications can create managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`HTTPAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). + +#### Creating a Manager with Default Configuration + +```swift +let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() +let manager = Alamofire.Manager(configuration: configuration) +``` + +#### Creating a Manager with Background Configuration + +```swift +let configuration = NSURLSessionConfiguration.backgroundSessionConfiguration("com.example.app.background") +let manager = Alamofire.Manager(configuration: configuration) +``` + +#### Creating a Manager with Ephemeral Configuration + +```swift +let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() +let manager = Alamofire.Manager(configuration: configuration) +``` + +#### Modifying Session Configuration + +```swift +var defaultHeaders = Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders ?? [:] +defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" + +let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() +configuration.HTTPAdditionalHeaders = defaultHeaders + +let manager = Alamofire.Manager(configuration: configuration) +``` + +> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use `URLRequestConvertible` and `ParameterEncoding`, respectively. + +### Request + +The result of a `request`, `upload`, or `download` method is an instance of `Alamofire.Request`. A request is always created using a constructor method from an owning manager, and never initialized directly. + +Methods like `authenticate`, `validate`, and `response` return the caller in order to facilitate chaining. + +Requests can be suspended, resumed, and cancelled: + +- `suspend()`: Suspends the underlying task and dispatch queue +- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. +- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. + +### Response Serialization + +#### Creating a Custom Response Serializer + +Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.Request`. + +For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: + +```swift +extension Request { + class func XMLResponseSerializer() -> Serializer { + return { (request, response, data) in + if data == nil { + return (nil, nil) + } + + var XMLSerializationError: NSError? + let XML = ONOXMLDocument(data: data, &XMLSerializationError) + + return (XML, XMLSerializationError) + } + } + + func responseXMLDocument(completionHandler: (NSURLRequest, NSHTTPURLResponse?, ONOXMLDocument?, NSError?) -> Void) -> Self { + return response(serializer: Request.XMLResponseSerializer(), completionHandler: { (request, response, XML, error) in + completionHandler(request, response, XML as? ONOXMLDocument, error) + }) + } +} +``` + +#### Generic Response Object Serialization + +Generics can be used to provide automatic, type-safe response object serialization. + +```swift +@objc public protocol ResponseObjectSerializable { + init?(response: NSHTTPURLResponse, representation: AnyObject) +} + +extension Alamofire.Request { + public func responseObject(completionHandler: (NSURLRequest, NSHTTPURLResponse?, T?, NSError?) -> Void) -> Self { + let serializer: Serializer = { (request, response, data) in + let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments) + let (JSON: AnyObject?, serializationError) = JSONSerializer(request, response, data) + if response != nil && JSON != nil { + return (T(response: response!, representation: JSON!), nil) + } else { + return (nil, serializationError) + } + } + + return response(serializer: serializer, completionHandler: { (request, response, object, error) in + completionHandler(request, response, object as? T, error) + }) + } +} +``` + +```swift +final class User: ResponseObjectSerializable { + let username: String + let name: String + + required init?(response: NSHTTPURLResponse, representation: AnyObject) { + self.username = response.URL!.lastPathComponent + self.name = representation.valueForKeyPath("name") as String + } +} +``` + +```swift +Alamofire.request(.GET, "http://example.com/users/mattt") + .responseObject { (_, _, user: User?, _) in + println(user) + } +``` + +The same approach can also be used to handle endpoints that return a representation of a collection of objects: + +```swift +@objc public protocol ResponseCollectionSerializable { + class func collection(#response: NSHTTPURLResponse, representation: AnyObject) -> [Self] +} + +extension Alamofire.Request { + public func responseCollection(completionHandler: (NSURLRequest, NSHTTPURLResponse?, [T]?, NSError?) -> Void) -> Self { + let serializer: Serializer = { (request, response, data) in + let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments) + let (JSON: AnyObject?, serializationError) = JSONSerializer(request, response, data) + if response != nil && JSON != nil { + return (T.collection(response: response!, representation: JSON!), nil) + } else { + return (nil, serializationError) + } + } + + return response(serializer: serializer, completionHandler: { (request, response, object, error) in + completionHandler(request, response, object as? [T], error) + }) + } +} +``` + +### URLStringConvertible + +Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to construct URL requests. `NSString`, `NSURL`, `NSURLComponents`, and `NSURLRequest` conform to `URLStringConvertible` by default, allowing any of them to be passed as `URLString` parameters to the `request`, `upload`, and `download` methods: + +```swift +let string = NSString(string: "http://httpbin.org/post") +Alamofire.request(.POST, string) + +let URL = NSURL(string: string)! +Alamofire.request(.POST, URL) + +let URLRequest = NSURLRequest(URL: URL) +Alamofire.request(.POST, URLRequest) // overrides `HTTPMethod` of `URLRequest` + +let URLComponents = NSURLComponents(URL: URL, resolvingAgainstBaseURL: true) +Alamofire.request(.POST, URLComponents) +``` + +Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLStringConvertible` as a convenient way to map domain-specific models to server resources. + +#### Type-Safe Routing + +```swift +extension User: URLStringConvertible { + static let baseURLString = "http://example.com" + + var URLString: String { + return User.baseURLString + "/users/\(username)/" + } +} +``` + +```swift +let user = User(username: "mattt") +Alamofire.request(.GET, user) // http://example.com/users/mattt +``` + +### URLRequestConvertible + +Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `NSURLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP header fields or HTTP body for individual requests): + +```swift +let URL = NSURL(string: "http://httpbin.org/post")! +let mutableURLRequest = NSMutableURLRequest(URL: URL) +mutableURLRequest.HTTPMethod = "POST" + +let parameters = ["foo": "bar"] +var JSONSerializationError: NSError? = nil +mutableURLRequest.HTTPBody = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: &JSONSerializationError) +mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + +Alamofire.request(mutableURLRequest) +``` + +Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. + +#### API Parameter Abstraction + +```swift +enum Router: URLRequestConvertible { + static let baseURLString = "http://example.com" + static let perPage = 50 + + case Search(query: String, page: Int) + + // MARK: URLRequestConvertible + + var URLRequest: NSURLRequest { + let (path: String, parameters: [String: AnyObject]?) = { + switch self { + case .Search(let query, let page) where page > 1: + return ("/search", ["q": query, "offset": Router.perPage * page]) + case .Search(let query, _): + return ("/search", ["q": query]) + } + }() + + let URL = NSURL(string: Router.baseURLString)! + let URLRequest = NSURLRequest(URL: URL.URLByAppendingPathComponent(path)) + let encoding = Alamofire.ParameterEncoding.URL + + return encoding.encode(URLRequest, parameters: parameters).0 + } +} +``` + +```swift +Alamofire.request(Router.Search(query: "foo bar", page: 1)) // ?q=foo+bar&offset=50 +``` + +#### CRUD & Authorization + +```swift +enum Router: URLRequestConvertible { + static let baseURLString = "http://example.com" + static var OAuthToken: String? + + case CreateUser([String: AnyObject]) + case ReadUser(String) + case UpdateUser(String, [String: AnyObject]) + case DestroyUser(String) + + var method: Alamofire.Method { + switch self { + case .CreateUser: + return .POST + case .ReadUser: + return .GET + case .UpdateUser: + return .PUT + case .DestroyUser: + return .DELETE + } + } + + var path: String { + switch self { + case .CreateUser: + return "/users" + case .ReadUser(let username): + return "/users/\(username)" + case .UpdateUser(let username, _): + return "/users/\(username)" + case .DestroyUser(let username): + return "/users/\(username)" + } + } + + // MARK: URLRequestConvertible + + var URLRequest: NSURLRequest { + let URL = NSURL(string: Router.baseURLString)! + let mutableURLRequest = NSMutableURLRequest(URL: URL.URLByAppendingPathComponent(path)) + mutableURLRequest.HTTPMethod = method.rawValue + + if let token = Router.OAuthToken { + mutableURLRequest.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") + } + + switch self { + case .CreateUser(let parameters): + return Alamofire.ParameterEncoding.JSON.encode(mutableURLRequest, parameters: parameters).0 + case .UpdateUser(_, let parameters): + return Alamofire.ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0 + default: + return mutableURLRequest + } + } +} +``` + +```swift +Alamofire.request(Router.ReadUser("mattt")) // GET /users/mattt +``` + +* * * + +## FAQ + +### When should I use Alamofire? + +If you're starting a new project in Swift, and want to take full advantage of its conventions and language features, Alamofire is a great choice. Although not as fully-featured as AFNetworking, Alamofire is much nicer to work with, and should satisfy the vast majority of networking use cases. + +> It's important to note that two libraries aren't mutually exclusive: AFNetworking and Alamofire can peacefully exist in the same code base. + +### When should I use AFNetworking? + +AFNetworking remains the premiere networking library available for OS X and iOS, and can easily be used in Swift, just like any other Objective-C code. AFNetworking is stable and reliable, and isn't going anywhere. + +Use AFNetworking for any of the following: + +- UIKit extensions, such as asynchronously loading images to `UIImageView` +- TLS verification, using `AFSecurityManager` +- Situations requiring `NSOperation` or `NSURLConnection`, using `AFURLConnectionOperation` +- Network reachability monitoring, using `AFNetworkReachabilityManager` +- Multipart HTTP request construction, using `AFHTTPRequestSerializer` + +### What's the origin of the name Alamofire? + +Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. + +* * * + +## Credits + +Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). + +## License + +Alamofire is released under the MIT license. See LICENSE for details. diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Alamofire.h b/DemoApp/Carthage/Checkouts/Alamofire/Source/Alamofire.h new file mode 100644 index 0000000..f56a1e1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Alamofire.h @@ -0,0 +1,26 @@ +// Alamofire.h +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Alamofire.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/Alamofire.swift new file mode 100644 index 0000000..6ee1ddc --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Alamofire.swift @@ -0,0 +1,248 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +/// Alamofire errors +public let AlamofireErrorDomain = "com.alamofire.error" + +// MARK: - URLStringConvertible + +/** + Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to construct URL requests. +*/ +public protocol URLStringConvertible { + /** + A URL that conforms to RFC 2396. + + Methods accepting a `URLStringConvertible` type parameter parse it according to RFCs 1738 and 1808. + + See http://tools.ietf.org/html/rfc2396 + See http://tools.ietf.org/html/rfc1738 + See http://tools.ietf.org/html/rfc1808 + */ + var URLString: String { get } +} + +extension String: URLStringConvertible { + public var URLString: String { + return self + } +} + +extension NSURL: URLStringConvertible { + public var URLString: String { + return absoluteString! + } +} + +extension NSURLComponents: URLStringConvertible { + public var URLString: String { + return URL!.URLString + } +} + +extension NSURLRequest: URLStringConvertible { + public var URLString: String { + return URL!.URLString + } +} + +// MARK: - URLRequestConvertible + +/** + Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. +*/ +public protocol URLRequestConvertible { + /// The URL request. + var URLRequest: NSURLRequest { get } +} + +extension NSURLRequest: URLRequestConvertible { + public var URLRequest: NSURLRequest { + return self + } +} + +// MARK: - Convenience + +func URLRequest(method: Method, URL: URLStringConvertible) -> NSURLRequest { + let mutableURLRequest = NSMutableURLRequest(URL: NSURL(string: URL.URLString)!) + mutableURLRequest.HTTPMethod = method.rawValue + + return mutableURLRequest +} + +// MARK: - Request Methods + +/** + Creates a request using the shared manager instance for the specified method, URL string, parameters, and parameter encoding. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: parameters The parameters. `nil` by default. + :param: encoding The parameter encoding. `.URL` by default. + + :returns: The created request. +*/ +public func request(method: Method, URLString: URLStringConvertible, parameters: [String: AnyObject]? = nil, encoding: ParameterEncoding = .URL) -> Request { + return Manager.sharedInstance.request(method, URLString, parameters: parameters, encoding: encoding) +} + +/** + Creates a request using the shared manager instance for the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: URLRequest The URL request + + :returns: The created request. +*/ +public func request(URLRequest: URLRequestConvertible) -> Request { + return Manager.sharedInstance.request(URLRequest.URLRequest) +} + +// MARK: - Upload Methods + +// MARK: File + +/** + Creates an upload request using the shared manager instance for the specified method, URL string, and file. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: file The file to upload. + + :returns: The created upload request. +*/ +public func upload(method: Method, URLString: URLStringConvertible, file: NSURL) -> Request { + return Manager.sharedInstance.upload(method, URLString, file: file) +} + +/** + Creates an upload request using the shared manager instance for the specified URL request and file. + + :param: URLRequest The URL request. + :param: file The file to upload. + + :returns: The created upload request. +*/ +public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { + return Manager.sharedInstance.upload(URLRequest, file: file) +} + +// MARK: Data + +/** + Creates an upload request using the shared manager instance for the specified method, URL string, and data. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: data The data to upload. + + :returns: The created upload request. +*/ +public func upload(method: Method, URLString: URLStringConvertible, data: NSData) -> Request { + return Manager.sharedInstance.upload(method, URLString, data: data) +} + +/** + Creates an upload request using the shared manager instance for the specified URL request and data. + + :param: URLRequest The URL request. + :param: data The data to upload. + + :returns: The created upload request. +*/ +public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { + return Manager.sharedInstance.upload(URLRequest, data: data) +} + +// MARK: Stream + +/** + Creates an upload request using the shared manager instance for the specified method, URL string, and stream. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: stream The stream to upload. + + :returns: The created upload request. +*/ +public func upload(method: Method, URLString: URLStringConvertible, stream: NSInputStream) -> Request { + return Manager.sharedInstance.upload(method, URLString, stream: stream) +} + +/** + Creates an upload request using the shared manager instance for the specified URL request and stream. + + :param: URLRequest The URL request. + :param: stream The stream to upload. + + :returns: The created upload request. +*/ +public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { + return Manager.sharedInstance.upload(URLRequest, stream: stream) +} + +// MARK: - Download Methods + +// MARK: URL Request + +/** + Creates a download request using the shared manager instance for the specified method and URL string. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: destination The closure used to determine the destination of the downloaded file. + + :returns: The created download request. +*/ +public func download(method: Method, URLString: URLStringConvertible, destination: Request.DownloadFileDestination) -> Request { + return Manager.sharedInstance.download(method, URLString, destination: destination) +} + +/** + Creates a download request using the shared manager instance for the specified URL request. + + :param: URLRequest The URL request. + :param: destination The closure used to determine the destination of the downloaded file. + + :returns: The created download request. +*/ +public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { + return Manager.sharedInstance.download(URLRequest, destination: destination) +} + +// MARK: Resume Data + +/** + Creates a request using the shared manager instance for downloading from the resume data produced from a previous request cancellation. + + :param: resumeData The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional information. + :param: destination The closure used to determine the destination of the downloaded file. + + :returns: The created download request. +*/ +public func download(resumeData data: NSData, destination: Request.DownloadFileDestination) -> Request { + return Manager.sharedInstance.download(data, destination: destination) +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Download.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/Download.swift new file mode 100644 index 0000000..985eece --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Download.swift @@ -0,0 +1,185 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +extension Manager { + private enum Downloadable { + case Request(NSURLRequest) + case ResumeData(NSData) + } + + private func download(downloadable: Downloadable, destination: Request.DownloadFileDestination) -> Request { + var downloadTask: NSURLSessionDownloadTask! + + switch downloadable { + case .Request(let request): + dispatch_sync(queue) { + downloadTask = self.session.downloadTaskWithRequest(request) + } + case .ResumeData(let resumeData): + dispatch_sync(queue) { + downloadTask = self.session.downloadTaskWithResumeData(resumeData) + } + } + + let request = Request(session: session, task: downloadTask) + if let downloadDelegate = request.delegate as? Request.DownloadTaskDelegate { + downloadDelegate.downloadTaskDidFinishDownloadingToURL = { session, downloadTask, URL in + return destination(URL, downloadTask.response as! NSHTTPURLResponse) + } + } + delegate[request.delegate.task] = request.delegate + + if startRequestsImmediately { + request.resume() + } + + return request + } + + // MARK: Request + + /** + Creates a download request using the shared manager instance for the specified method and URL string. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: destination The closure used to determine the destination of the downloaded file. + + :returns: The created download request. + */ + public func download(method: Method, _ URLString: URLStringConvertible, destination: Request.DownloadFileDestination) -> Request { + return download(URLRequest(method, URLString), destination: destination) + } + + /** + Creates a request for downloading from the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: URLRequest The URL request + :param: destination The closure used to determine the destination of the downloaded file. + + :returns: The created download request. + */ + public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { + return download(.Request(URLRequest.URLRequest), destination: destination) + } + + // MARK: Resume Data + + /** + Creates a request for downloading from the resume data produced from a previous request cancellation. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: resumeData The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional information. + :param: destination The closure used to determine the destination of the downloaded file. + + :returns: The created download request. + */ + public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request { + return download(.ResumeData(resumeData), destination: destination) + } +} + +// MARK: - + +extension Request { + /** + A closure executed once a request has successfully completed in order to determine where to move the temporary file written to during the download process. The closure takes two arguments: the temporary file URL and the URL response, and returns a single argument: the file URL where the temporary file should be moved. + */ + public typealias DownloadFileDestination = (NSURL, NSHTTPURLResponse) -> NSURL + + /** + Creates a download file destination closure which uses the default file manager to move the temporary file to a file URL in the first available directory with the specified search path directory and search path domain mask. + + :param: directory The search path directory. `.DocumentDirectory` by default. + :param: domain The search path domain mask. `.UserDomainMask` by default. + + :returns: A download file destination closure. + */ + public class func suggestedDownloadDestination(directory: NSSearchPathDirectory = .DocumentDirectory, domain: NSSearchPathDomainMask = .UserDomainMask) -> DownloadFileDestination { + + return { (temporaryURL, response) -> (NSURL) in + if let directoryURL = NSFileManager.defaultManager().URLsForDirectory(directory, inDomains: domain)[0] as? NSURL { + return directoryURL.URLByAppendingPathComponent(response.suggestedFilename!) + } + + return temporaryURL + } + } + + // MARK: - DownloadTaskDelegate + + class DownloadTaskDelegate: TaskDelegate, NSURLSessionDownloadDelegate { + var downloadTask: NSURLSessionDownloadTask? { return task as? NSURLSessionDownloadTask } + var downloadProgress: ((Int64, Int64, Int64) -> Void)? + + var resumeData: NSData? + override var data: NSData? { return resumeData } + + // MARK: - NSURLSessionDownloadDelegate + + // MARK: Override Closures + + var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> NSURL)? + var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? + + // MARK: Delegate Methods + + func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL location: NSURL) { + if downloadTaskDidFinishDownloadingToURL != nil { + let destination = downloadTaskDidFinishDownloadingToURL!(session, downloadTask, location) + var fileManagerError: NSError? + + NSFileManager.defaultManager().moveItemAtURL(location, toURL: destination, error: &fileManagerError) + + if fileManagerError != nil { + error = fileManagerError + } + } + } + + func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { + if downloadTaskDidWriteData != nil { + downloadTaskDidWriteData!(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) + } else { + progress.totalUnitCount = totalBytesExpectedToWrite + progress.completedUnitCount = totalBytesWritten + + downloadProgress?(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) + } + } + + func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) { + if downloadTaskDidResumeAtOffset != nil { + downloadTaskDidResumeAtOffset!(session, downloadTask, fileOffset, expectedTotalBytes) + } else { + progress.totalUnitCount = expectedTotalBytes + progress.completedUnitCount = fileOffset + } + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Info.plist b/DemoApp/Carthage/Checkouts/Alamofire/Source/Info.plist new file mode 100644 index 0000000..9fff68f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.alamofire.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.2.2 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Manager.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/Manager.swift new file mode 100644 index 0000000..9602523 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Manager.swift @@ -0,0 +1,404 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +/** + Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. +*/ +public class Manager { + + // MARK: - Properties + + /** + A shared instance of `Manager`, used by top-level Alamofire request methods, and suitable for use directly for any ad hoc requests. + */ + public static let sharedInstance: Manager = { + let configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration() + configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders + + return Manager(configuration: configuration) + }() + + /** + Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. + + :returns: The default header values. + */ + public static let defaultHTTPHeaders: [String: String] = { + // Accept-Encoding HTTP Header; see http://tools.ietf.org/html/rfc7230#section-4.2.3 + let acceptEncoding: String = "gzip;q=1.0,compress;q=0.5" + + // Accept-Language HTTP Header; see http://tools.ietf.org/html/rfc7231#section-5.3.5 + let acceptLanguage: String = { + var components: [String] = [] + for (index, languageCode) in enumerate(NSLocale.preferredLanguages() as! [String]) { + let q = 1.0 - (Double(index) * 0.1) + components.append("\(languageCode);q=\(q)") + if q <= 0.5 { + break + } + } + + return join(",", components) + }() + + // User-Agent Header; see http://tools.ietf.org/html/rfc7231#section-5.5.3 + let userAgent: String = { + if let info = NSBundle.mainBundle().infoDictionary { + let executable: AnyObject = info[kCFBundleExecutableKey] ?? "Unknown" + let bundle: AnyObject = info[kCFBundleIdentifierKey] ?? "Unknown" + let version: AnyObject = info[kCFBundleVersionKey] ?? "Unknown" + let os: AnyObject = NSProcessInfo.processInfo().operatingSystemVersionString ?? "Unknown" + + var mutableUserAgent = NSMutableString(string: "\(executable)/\(bundle) (\(version); OS \(os))") as CFMutableString + let transform = NSString(string: "Any-Latin; Latin-ASCII; [:^ASCII:] Remove") as CFString + if CFStringTransform(mutableUserAgent, nil, transform, 0) == 1 { + return mutableUserAgent as NSString as! String + } + } + + return "Alamofire" + }() + + return [ + "Accept-Encoding": acceptEncoding, + "Accept-Language": acceptLanguage, + "User-Agent": userAgent + ] + }() + + let queue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL) + + /// The underlying session. + public let session: NSURLSession + + /// The session delegate handling all the task and session delegate callbacks. + public let delegate: SessionDelegate + + /// Whether to start requests immediately after being constructed. `true` by default. + public var startRequestsImmediately: Bool = true + + /// The background completion handler closure provided by the UIApplicationDelegate `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation will automatically call the handler. If you need to handle your own events before the handler is called, then you need to override the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. `nil` by default. + public var backgroundCompletionHandler: (() -> Void)? + + // MARK: - Lifecycle + + /** + :param: configuration The configuration used to construct the managed session. + */ + required public init(configuration: NSURLSessionConfiguration? = nil) { + self.delegate = SessionDelegate() + self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) + + self.delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in + if let strongSelf = self { + strongSelf.backgroundCompletionHandler?() + } + } + } + + deinit { + self.session.invalidateAndCancel() + } + + // MARK: - Request + + /** + Creates a request for the specified method, URL string, parameters, and parameter encoding. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: parameters The parameters. `nil` by default. + :param: encoding The parameter encoding. `.URL` by default. + + :returns: The created request. + */ + public func request(method: Method, _ URLString: URLStringConvertible, parameters: [String: AnyObject]? = nil, encoding: ParameterEncoding = .URL) -> Request { + return request(encoding.encode(URLRequest(method, URLString), parameters: parameters).0) + } + + /** + Creates a request for the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: URLRequest The URL request + + :returns: The created request. + */ + public func request(URLRequest: URLRequestConvertible) -> Request { + var dataTask: NSURLSessionDataTask? + dispatch_sync(queue) { + dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) + } + + let request = Request(session: session, task: dataTask!) + delegate[request.delegate.task] = request.delegate + + if startRequestsImmediately { + request.resume() + } + + return request + } + + // MARK: - SessionDelegate + + /** + Responsible for handling all delegate callbacks for the underlying session. + */ + public final class SessionDelegate: NSObject, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate { + private var subdelegates: [Int: Request.TaskDelegate] = [:] + private let subdelegateQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT) + + subscript(task: NSURLSessionTask) -> Request.TaskDelegate? { + get { + var subdelegate: Request.TaskDelegate? + dispatch_sync(subdelegateQueue) { + subdelegate = self.subdelegates[task.taskIdentifier] + } + + return subdelegate + } + + set { + dispatch_barrier_async(subdelegateQueue) { + self.subdelegates[task.taskIdentifier] = newValue + } + } + } + + // MARK: - NSURLSessionDelegate + + // MARK: Override Closures + + /// NSURLSessionDelegate override closure for `URLSession:didBecomeInvalidWithError:` method. + public var sessionDidBecomeInvalidWithError: ((NSURLSession, NSError?) -> Void)? + + /// NSURLSessionDelegate override closure for `URLSession:didReceiveChallenge:completionHandler:` method. + public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential!))? + + /// NSURLSessionDelegate override closure for `URLSessionDidFinishEventsForBackgroundURLSession:` method. + public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)? + + // MARK: Delegate Methods + + public func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) { + sessionDidBecomeInvalidWithError?(session, error) + } + + public func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential!) -> Void)) { + if sessionDidReceiveChallenge != nil { + completionHandler(sessionDidReceiveChallenge!(session, challenge)) + } else { + completionHandler(.PerformDefaultHandling, nil) + } + } + + public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) { + sessionDidFinishEventsForBackgroundURLSession?(session) + } + + // MARK: - NSURLSessionTaskDelegate + + // MARK: Override Closures + + /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`. + public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? + + /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:`. + public var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential!))? + + /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:`. + public var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream!)? + + /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. + public var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didCompleteWithError:`. + public var taskDidComplete: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? + + // MARK: Delegate Methods + + public func URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection response: NSHTTPURLResponse, newRequest request: NSURLRequest, completionHandler: ((NSURLRequest!) -> Void)) { + var redirectRequest: NSURLRequest? = request + + if taskWillPerformHTTPRedirection != nil { + redirectRequest = taskWillPerformHTTPRedirection!(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + public func URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential!) -> Void)) { + if taskDidReceiveChallenge != nil { + completionHandler(taskDidReceiveChallenge!(session, task, challenge)) + } else if let delegate = self[task] { + delegate.URLSession(session, task: task, didReceiveChallenge: challenge, completionHandler: completionHandler) + } else { + URLSession(session, didReceiveChallenge: challenge, completionHandler: completionHandler) + } + } + + public func URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream completionHandler: ((NSInputStream!) -> Void)) { + if taskNeedNewBodyStream != nil { + completionHandler(taskNeedNewBodyStream!(session, task)) + } else if let delegate = self[task] { + delegate.URLSession(session, task: task, needNewBodyStream: completionHandler) + } + } + + public func URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { + if taskDidSendBodyData != nil { + taskDidSendBodyData!(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else if let delegate = self[task] as? Request.UploadTaskDelegate { + delegate.URLSession(session, task: task, didSendBodyData: bytesSent, totalBytesSent: totalBytesSent, totalBytesExpectedToSend: totalBytesExpectedToSend) + } + } + + public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { + if taskDidComplete != nil { + taskDidComplete!(session, task, error) + } else if let delegate = self[task] { + delegate.URLSession(session, task: task, didCompleteWithError: error) + + self[task] = nil + } + } + + // MARK: - NSURLSessionDataDelegate + + // MARK: Override Closures + + /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:`. + public var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? + + /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didBecomeDownloadTask:`. + public var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? + + /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveData:`. + public var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? + + /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`. + public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse!)? + + // MARK: Delegate Methods + + public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveResponse response: NSURLResponse, completionHandler: ((NSURLSessionResponseDisposition) -> Void)) { + var disposition: NSURLSessionResponseDisposition = .Allow + + if dataTaskDidReceiveResponse != nil { + disposition = dataTaskDidReceiveResponse!(session, dataTask, response) + } + + completionHandler(disposition) + } + + public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) { + if dataTaskDidBecomeDownloadTask != nil { + dataTaskDidBecomeDownloadTask!(session, dataTask, downloadTask) + } else { + let downloadDelegate = Request.DownloadTaskDelegate(task: downloadTask) + self[downloadTask] = downloadDelegate + } + } + + public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { + if dataTaskDidReceiveData != nil { + dataTaskDidReceiveData!(session, dataTask, data) + } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { + delegate.URLSession(session, dataTask: dataTask, didReceiveData: data) + } + } + + public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, willCacheResponse proposedResponse: NSCachedURLResponse, completionHandler: ((NSCachedURLResponse!) -> Void)) { + if dataTaskWillCacheResponse != nil { + completionHandler(dataTaskWillCacheResponse!(session, dataTask, proposedResponse)) + } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { + delegate.URLSession(session, dataTask: dataTask, willCacheResponse: proposedResponse, completionHandler: completionHandler) + } else { + completionHandler(proposedResponse) + } + } + + // MARK: - NSURLSessionDownloadDelegate + + // MARK: Override Closures + + /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didFinishDownloadingToURL:`. + public var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> Void)? + + /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`. + public var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. + public var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? + + // MARK: Delegate Methods + + public func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL location: NSURL) { + if downloadTaskDidFinishDownloadingToURL != nil { + downloadTaskDidFinishDownloadingToURL!(session, downloadTask, location) + } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { + delegate.URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location) + } + } + + public func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { + if downloadTaskDidWriteData != nil { + downloadTaskDidWriteData!(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) + } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { + delegate.URLSession(session, downloadTask: downloadTask, didWriteData: bytesWritten, totalBytesWritten: totalBytesWritten, totalBytesExpectedToWrite: totalBytesExpectedToWrite) + } + } + + public func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) { + if downloadTaskDidResumeAtOffset != nil { + downloadTaskDidResumeAtOffset!(session, downloadTask, fileOffset, expectedTotalBytes) + } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { + delegate.URLSession(session, downloadTask: downloadTask, didResumeAtOffset: fileOffset, expectedTotalBytes: expectedTotalBytes) + } + } + + // MARK: - NSObject + + public override func respondsToSelector(selector: Selector) -> Bool { + switch selector { + case "URLSession:didBecomeInvalidWithError:": + return (sessionDidBecomeInvalidWithError != nil) + case "URLSession:didReceiveChallenge:completionHandler:": + return (sessionDidReceiveChallenge != nil) + case "URLSessionDidFinishEventsForBackgroundURLSession:": + return (sessionDidFinishEventsForBackgroundURLSession != nil) + case "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:": + return (taskWillPerformHTTPRedirection != nil) + case "URLSession:dataTask:didReceiveResponse:completionHandler:": + return (dataTaskDidReceiveResponse != nil) + case "URLSession:dataTask:willCacheResponse:completionHandler:": + return (dataTaskWillCacheResponse != nil) + default: + return self.dynamicType.instancesRespondToSelector(selector) + } + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift new file mode 100644 index 0000000..50096ae --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift @@ -0,0 +1,157 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +/** + HTTP method definitions. + + See http://tools.ietf.org/html/rfc7231#section-4.3 +*/ +public enum Method: String { + case OPTIONS = "OPTIONS" + case GET = "GET" + case HEAD = "HEAD" + case POST = "POST" + case PUT = "PUT" + case PATCH = "PATCH" + case DELETE = "DELETE" + case TRACE = "TRACE" + case CONNECT = "CONNECT" +} + +// MARK: - ParameterEncoding + +/** + Used to specify the way in which a set of parameters are applied to a URL request. +*/ +public enum ParameterEncoding { + /** + A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. Since there is no published specification for how to encode collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). + */ + case URL + + /** + Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. + */ + case JSON + + /** + Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. + */ + case PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions) + + /** + Uses the associated closure value to construct a new request given an existing request and parameters. + */ + case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSURLRequest, NSError?)) + + /** + Creates a URL request by encoding parameters and applying them onto an existing request. + + :param: URLRequest The request to have parameters applied + :param: parameters The parameters to apply + + :returns: A tuple containing the constructed request and the error that occurred during parameter encoding, if any. + */ + public func encode(URLRequest: URLRequestConvertible, parameters: [String: AnyObject]?) -> (NSURLRequest, NSError?) { + if parameters == nil { + return (URLRequest.URLRequest, nil) + } + + var mutableURLRequest: NSMutableURLRequest! = URLRequest.URLRequest.mutableCopy() as! NSMutableURLRequest + var error: NSError? = nil + + switch self { + case .URL: + func query(parameters: [String: AnyObject]) -> String { + var components: [(String, String)] = [] + for key in sorted(Array(parameters.keys), <) { + let value: AnyObject! = parameters[key] + components += self.queryComponents(key, value) + } + + return join("&", components.map{"\($0)=\($1)"} as [String]) + } + + func encodesParametersInURL(method: Method) -> Bool { + switch method { + case .GET, .HEAD, .DELETE: + return true + default: + return false + } + } + + let method = Method(rawValue: mutableURLRequest.HTTPMethod) + if method != nil && encodesParametersInURL(method!) { + if let URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false) { + URLComponents.percentEncodedQuery = (URLComponents.percentEncodedQuery != nil ? URLComponents.percentEncodedQuery! + "&" : "") + query(parameters!) + mutableURLRequest.URL = URLComponents.URL + } + } else { + if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil { + mutableURLRequest.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") + } + + mutableURLRequest.HTTPBody = query(parameters!).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) + } + case .JSON: + let options = NSJSONWritingOptions.allZeros + if let data = NSJSONSerialization.dataWithJSONObject(parameters!, options: options, error: &error) { + mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + mutableURLRequest.HTTPBody = data + } + case .PropertyList(let (format, options)): + if let data = NSPropertyListSerialization.dataWithPropertyList(parameters!, format: format, options: options, error: &error) { + mutableURLRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") + mutableURLRequest.HTTPBody = data + } + case .Custom(let closure): + return closure(mutableURLRequest, parameters) + } + + return (mutableURLRequest, error) + } + + func queryComponents(key: String, _ value: AnyObject) -> [(String, String)] { + var components: [(String, String)] = [] + if let dictionary = value as? [String: AnyObject] { + for (nestedKey, value) in dictionary { + components += queryComponents("\(key)[\(nestedKey)]", value) + } + } else if let array = value as? [AnyObject] { + for value in array { + components += queryComponents("\(key)[]", value) + } + } else { + components.extend([(escape(key), escape("\(value)"))]) + } + + return components + } + + func escape(string: String) -> String { + let legalURLCharactersToBeEscaped: CFStringRef = ":&=;+!@#$()',*" + return CFURLCreateStringByAddingPercentEscapes(nil, string, nil, legalURLCharactersToBeEscaped, CFStringBuiltInEncodings.UTF8.rawValue) as String + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Request.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/Request.swift new file mode 100644 index 0000000..4ce1fff --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Request.swift @@ -0,0 +1,467 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +/** + Responsible for sending a request and receiving the response and associated data from the server, as well as managing its underlying `NSURLSessionTask`. +*/ +public class Request { + + // MARK: - Properties + + let delegate: TaskDelegate + + /// The underlying task. + public var task: NSURLSessionTask { return delegate.task } + + /// The session belonging to the underlying task. + public let session: NSURLSession + + /// The request sent or to be sent to the server. + public var request: NSURLRequest { return task.originalRequest } + + /// The response received from the server, if any. + public var response: NSHTTPURLResponse? { return task.response as? NSHTTPURLResponse } + + /// The progress of the request lifecycle. + public var progress: NSProgress { return delegate.progress } + + // MARK: - Lifecycle + + init(session: NSURLSession, task: NSURLSessionTask) { + self.session = session + + switch task { + case is NSURLSessionUploadTask: + self.delegate = UploadTaskDelegate(task: task) + case is NSURLSessionDataTask: + self.delegate = DataTaskDelegate(task: task) + case is NSURLSessionDownloadTask: + self.delegate = DownloadTaskDelegate(task: task) + default: + self.delegate = TaskDelegate(task: task) + } + } + + // MARK: - Authentication + + /** + Associates an HTTP Basic credential with the request. + + :param: user The user. + :param: password The password. + + :returns: The request. + */ + public func authenticate(#user: String, password: String) -> Self { + let credential = NSURLCredential(user: user, password: password, persistence: .ForSession) + + return authenticate(usingCredential: credential) + } + + /** + Associates a specified credential with the request. + + :param: credential The credential. + + :returns: The request. + */ + public func authenticate(usingCredential credential: NSURLCredential) -> Self { + delegate.credential = credential + + return self + } + + // MARK: - Progress + + /** + Sets a closure to be called periodically during the lifecycle of the request as data is written to or read from the server. + + - For uploads, the progress closure returns the bytes written, total bytes written, and total bytes expected to write. + - For downloads and data tasks, the progress closure returns the bytes read, total bytes read, and total bytes expected to read. + + :param: closure The code to be executed periodically during the lifecycle of the request. + + :returns: The request. + */ + public func progress(closure: ((Int64, Int64, Int64) -> Void)? = nil) -> Self { + if let uploadDelegate = delegate as? UploadTaskDelegate { + uploadDelegate.uploadProgress = closure + } else if let dataDelegate = delegate as? DataTaskDelegate { + dataDelegate.dataProgress = closure + } else if let downloadDelegate = delegate as? DownloadTaskDelegate { + downloadDelegate.downloadProgress = closure + } + + return self + } + + // MARK: - Response + + /** + A closure used by response handlers that takes a request, response, and data and returns a serialized object and any error that occured in the process. + */ + public typealias Serializer = (NSURLRequest, NSHTTPURLResponse?, NSData?) -> (AnyObject?, NSError?) + + /** + Creates a response serializer that returns the associated data as-is. + + :returns: A data response serializer. + */ + public class func responseDataSerializer() -> Serializer { + return { request, response, data in + return (data, nil) + } + } + + /** + Adds a handler to be called once the request has finished. + + :param: completionHandler The code to be executed once the request has finished. + + :returns: The request. + */ + public func response(completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self { + return response(serializer: Request.responseDataSerializer(), completionHandler: completionHandler) + } + + /** + Adds a handler to be called once the request has finished. + + :param: queue The queue on which the completion handler is dispatched. + :param: serializer The closure responsible for serializing the request, response, and data. + :param: completionHandler The code to be executed once the request has finished. + + :returns: The request. + */ + public func response(queue: dispatch_queue_t? = nil, serializer: Serializer, completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self { + delegate.queue.addOperationWithBlock { + let (responseObject: AnyObject?, serializationError: NSError?) = serializer(self.request, self.response, self.delegate.data) + + dispatch_async(queue ?? dispatch_get_main_queue()) { + completionHandler(self.request, self.response, responseObject, self.delegate.error ?? serializationError) + } + } + + return self + } + + // MARK: - State + + /** + Suspends the request. + */ + public func suspend() { + task.suspend() + } + + /** + Resumes the request. + */ + public func resume() { + task.resume() + } + + /** + Cancels the request. + */ + public func cancel() { + if let downloadDelegate = delegate as? DownloadTaskDelegate, + downloadTask = downloadDelegate.downloadTask + { + downloadTask.cancelByProducingResumeData { data in + downloadDelegate.resumeData = data + } + } else { + task.cancel() + } + } + + // MARK: - TaskDelegate + + class TaskDelegate: NSObject, NSURLSessionTaskDelegate { + let task: NSURLSessionTask + let queue: NSOperationQueue + let progress: NSProgress + + var data: NSData? { return nil } + var error: NSError? + + var credential: NSURLCredential? + + init(task: NSURLSessionTask) { + self.task = task + self.progress = NSProgress(totalUnitCount: 0) + self.queue = { + let operationQueue = NSOperationQueue() + operationQueue.maxConcurrentOperationCount = 1 + operationQueue.suspended = true + + if operationQueue.respondsToSelector("qualityOfService") { + operationQueue.qualityOfService = NSQualityOfService.Utility + } + + return operationQueue + }() + } + + deinit { + queue.cancelAllOperations() + queue.suspended = true + } + + // MARK: - NSURLSessionTaskDelegate + + // MARK: Override Closures + + var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? + var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? + var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)? + var taskDidCompleteWithError: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? + + // MARK: Delegate Methods + + func URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection response: NSHTTPURLResponse, newRequest request: NSURLRequest, completionHandler: ((NSURLRequest!) -> Void)) { + var redirectRequest: NSURLRequest? = request + + if taskWillPerformHTTPRedirection != nil { + redirectRequest = taskWillPerformHTTPRedirection!(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + func URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential!) -> Void)) { + var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling + var credential: NSURLCredential? + + if taskDidReceiveChallenge != nil { + (disposition, credential) = taskDidReceiveChallenge!(session, task, challenge) + } else { + if challenge.previousFailureCount > 0 { + disposition = .CancelAuthenticationChallenge + } else { + credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace) + + if credential != nil { + disposition = .UseCredential + } + } + } + + completionHandler(disposition, credential) + } + + func URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream completionHandler: ((NSInputStream!) -> Void)) { + var bodyStream: NSInputStream? + + if taskNeedNewBodyStream != nil { + bodyStream = taskNeedNewBodyStream!(session, task) + } + + completionHandler(bodyStream) + } + + func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { + if taskDidCompleteWithError != nil { + taskDidCompleteWithError!(session, task, error) + } else { + if error != nil { + self.error = error + } + + queue.suspended = false + } + } + } + + // MARK: - DataTaskDelegate + + class DataTaskDelegate: TaskDelegate, NSURLSessionDataDelegate { + var dataTask: NSURLSessionDataTask? { return task as? NSURLSessionDataTask } + + private var mutableData: NSMutableData + override var data: NSData? { + return mutableData + } + + private var expectedContentLength: Int64? + + + var dataProgress: ((bytesReceived: Int64, totalBytesReceived: Int64, totalBytesExpectedToReceive: Int64) -> Void)? + + override init(task: NSURLSessionTask) { + self.mutableData = NSMutableData() + super.init(task: task) + } + + // MARK: - NSURLSessionDataDelegate + + // MARK: Override Closures + + var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? + var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? + var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? + var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)? + + // MARK: Delegate Methods + + func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveResponse response: NSURLResponse, completionHandler: ((NSURLSessionResponseDisposition) -> Void)) { + var disposition: NSURLSessionResponseDisposition = .Allow + + expectedContentLength = response.expectedContentLength + + if dataTaskDidReceiveResponse != nil { + disposition = dataTaskDidReceiveResponse!(session, dataTask, response) + } + + completionHandler(disposition) + } + + func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) { + dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) + } + + func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { + if dataTaskDidReceiveData != nil { + dataTaskDidReceiveData!(session, dataTask, data) + } else { + mutableData.appendData(data) + + let totalBytesReceived = Int64(mutableData.length) + let totalBytesExpectedToReceive = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown + + progress.totalUnitCount = totalBytesExpectedToReceive + progress.completedUnitCount = totalBytesReceived + + dataProgress?(bytesReceived: Int64(data.length), totalBytesReceived: totalBytesReceived, totalBytesExpectedToReceive: totalBytesExpectedToReceive) + } + } + + func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, willCacheResponse proposedResponse: NSCachedURLResponse, completionHandler: ((NSCachedURLResponse!) -> Void)) { + var cachedResponse: NSCachedURLResponse? = proposedResponse + + if dataTaskWillCacheResponse != nil { + cachedResponse = dataTaskWillCacheResponse!(session, dataTask, proposedResponse) + } + + completionHandler(cachedResponse) + } + } +} + +// MARK: - Printable + +extension Request: Printable { + /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as well as the response status code if a response has been received. + public var description: String { + var components: [String] = [] + if request.HTTPMethod != nil { + components.append(request.HTTPMethod!) + } + + components.append(request.URL!.absoluteString!) + + if response != nil { + components.append("(\(response!.statusCode))") + } + + return join(" ", components) + } +} + +// MARK: - DebugPrintable + +extension Request: DebugPrintable { + func cURLRepresentation() -> String { + var components: [String] = ["$ curl -i"] + + let URL = request.URL + + if request.HTTPMethod != nil && request.HTTPMethod != "GET" { + components.append("-X \(request.HTTPMethod!)") + } + + if let credentialStorage = self.session.configuration.URLCredentialStorage { + let protectionSpace = NSURLProtectionSpace(host: URL!.host!, port: URL!.port?.integerValue ?? 0, `protocol`: URL!.scheme!, realm: URL!.host!, authenticationMethod: NSURLAuthenticationMethodHTTPBasic) + if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values.array { + for credential: NSURLCredential in (credentials as! [NSURLCredential]) { + components.append("-u \(credential.user!):\(credential.password!)") + } + } else { + if let credential = delegate.credential { + components.append("-u \(credential.user!):\(credential.password!)") + } + } + } + + // Temporarily disabled on OS X due to build failure for CocoaPods + // See https://github.com/CocoaPods/swift/issues/24 + #if !os(OSX) + if let cookieStorage = session.configuration.HTTPCookieStorage, + cookies = cookieStorage.cookiesForURL(URL!) as? [NSHTTPCookie] + where !cookies.isEmpty + { + let string = cookies.reduce(""){ $0 + "\($1.name)=\($1.value ?? String());" } + components.append("-b \"\(string.substringToIndex(string.endIndex.predecessor()))\"") + } + #endif + + if request.allHTTPHeaderFields != nil { + for (field, value) in request.allHTTPHeaderFields! { + switch field { + case "Cookie": + continue + default: + components.append("-H \"\(field): \(value)\"") + } + } + } + + if session.configuration.HTTPAdditionalHeaders != nil { + for (field, value) in session.configuration.HTTPAdditionalHeaders! { + switch field { + case "Cookie": + continue + default: + components.append("-H \"\(field): \(value)\"") + } + } + } + + if let HTTPBody = request.HTTPBody, + escapedBody = NSString(data: HTTPBody, encoding: NSUTF8StringEncoding)?.stringByReplacingOccurrencesOfString("\"", withString: "\\\"") + { + components.append("-d \"\(escapedBody)\"") + } + + components.append("\"\(URL!.absoluteString!)\"") + + return join(" \\\n\t", components) + } + + /// The textual representation used when written to an output stream, in the form of a cURL command. + public var debugDescription: String { + return cURLRepresentation() + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift new file mode 100644 index 0000000..3766dfa --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift @@ -0,0 +1,142 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +// MARK: String + +extension Request { + /** + Creates a response serializer that returns a string initialized from the response data with the specified string encoding. + + :param: encoding The string encoding. If `nil`, the string encoding will be determined from the server response, falling back to the default HTTP default character set, ISO-8859-1. + + :returns: A string response serializer. + */ + public class func stringResponseSerializer(var encoding: NSStringEncoding? = nil) -> Serializer { + return { _, response, data in + if data == nil || data?.length == 0 { + return (nil, nil) + } + + if encoding == nil { + if let encodingName = response?.textEncodingName { + encoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding(encodingName)) + } + } + + let string = NSString(data: data!, encoding: encoding ?? NSISOLatin1StringEncoding) + + return (string, nil) + } + } + + /** + Adds a handler to be called once the request has finished. + + :param: encoding The string encoding. If `nil`, the string encoding will be determined from the server response, falling back to the default HTTP default character set, ISO-8859-1. + :param: completionHandler A closure to be executed once the request has finished. The closure takes 4 arguments: the URL request, the URL response, if one was received, the string, if one could be created from the URL response and data, and any error produced while creating the string. + + :returns: The request. + */ + public func responseString(encoding: NSStringEncoding? = nil, completionHandler: (NSURLRequest, NSHTTPURLResponse?, String?, NSError?) -> Void) -> Self { + return response(serializer: Request.stringResponseSerializer(encoding: encoding), completionHandler: { request, response, string, error in + completionHandler(request, response, string as? String, error) + }) + } +} + +// MARK: - JSON + +extension Request { + /** + Creates a response serializer that returns a JSON object constructed from the response data using `NSJSONSerialization` with the specified reading options. + + :param: options The JSON serialization reading options. `.AllowFragments` by default. + + :returns: A JSON object response serializer. + */ + public class func JSONResponseSerializer(options: NSJSONReadingOptions = .AllowFragments) -> Serializer { + return { request, response, data in + if data == nil || data?.length == 0 { + return (nil, nil) + } + + var serializationError: NSError? + let JSON: AnyObject? = NSJSONSerialization.JSONObjectWithData(data!, options: options, error: &serializationError) + + return (JSON, serializationError) + } + } + + /** + Adds a handler to be called once the request has finished. + + :param: options The JSON serialization reading options. `.AllowFragments` by default. + :param: completionHandler A closure to be executed once the request has finished. The closure takes 4 arguments: the URL request, the URL response, if one was received, the JSON object, if one could be created from the URL response and data, and any error produced while creating the JSON object. + + :returns: The request. + */ + public func responseJSON(options: NSJSONReadingOptions = .AllowFragments, completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self { + return response(serializer: Request.JSONResponseSerializer(options: options), completionHandler: { request, response, JSON, error in + completionHandler(request, response, JSON, error) + }) + } +} + +// MARK: - Property List + +extension Request { + /** + Creates a response serializer that returns an object constructed from the response data using `NSPropertyListSerialization` with the specified reading options. + + :param: options The property list reading options. `0` by default. + + :returns: A property list object response serializer. + */ + public class func propertyListResponseSerializer(options: NSPropertyListReadOptions = 0) -> Serializer { + return { request, response, data in + if data == nil || data?.length == 0 { + return (nil, nil) + } + + var propertyListSerializationError: NSError? + let plist: AnyObject? = NSPropertyListSerialization.propertyListWithData(data!, options: options, format: nil, error: &propertyListSerializationError) + + return (plist, propertyListSerializationError) + } + } + + /** + Adds a handler to be called once the request has finished. + + :param: options The property list reading options. `0` by default. + :param: completionHandler A closure to be executed once the request has finished. The closure takes 4 arguments: the URL request, the URL response, if one was received, the property list, if one could be created from the URL response and data, and any error produced while creating the property list. + + :returns: The request. + */ + public func responsePropertyList(options: NSPropertyListReadOptions = 0, completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self { + return response(serializer: Request.propertyListResponseSerializer(options: options), completionHandler: { request, response, plist, error in + completionHandler(request, response, plist, error) + }) + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Upload.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/Upload.swift new file mode 100644 index 0000000..4d4bf73 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Upload.swift @@ -0,0 +1,190 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +extension Manager { + private enum Uploadable { + case Data(NSURLRequest, NSData) + case File(NSURLRequest, NSURL) + case Stream(NSURLRequest, NSInputStream) + } + + private func upload(uploadable: Uploadable) -> Request { + var uploadTask: NSURLSessionUploadTask! + var HTTPBodyStream: NSInputStream? + + switch uploadable { + case .Data(let request, let data): + dispatch_sync(queue) { + uploadTask = self.session.uploadTaskWithRequest(request, fromData: data) + } + case .File(let request, let fileURL): + dispatch_sync(queue) { + uploadTask = self.session.uploadTaskWithRequest(request, fromFile: fileURL) + } + case .Stream(let request, var stream): + dispatch_sync(queue) { + uploadTask = self.session.uploadTaskWithStreamedRequest(request) + } + HTTPBodyStream = stream + } + + let request = Request(session: session, task: uploadTask) + if HTTPBodyStream != nil { + request.delegate.taskNeedNewBodyStream = { _, _ in + return HTTPBodyStream + } + } + delegate[request.delegate.task] = request.delegate + + if startRequestsImmediately { + request.resume() + } + + return request + } + + // MARK: File + + /** + Creates a request for uploading a file to the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: URLRequest The URL request + :param: file The file to upload + + :returns: The created upload request. + */ + public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { + return upload(.File(URLRequest.URLRequest, file)) + } + + /** + Creates a request for uploading a file to the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: file The file to upload + + :returns: The created upload request. + */ + public func upload(method: Method, _ URLString: URLStringConvertible, file: NSURL) -> Request { + return upload(URLRequest(method, URLString), file: file) + } + + // MARK: Data + + /** + Creates a request for uploading data to the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: URLRequest The URL request + :param: data The data to upload + + :returns: The created upload request. + */ + public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { + return upload(.Data(URLRequest.URLRequest, data)) + } + + /** + Creates a request for uploading data to the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: data The data to upload + + :returns: The created upload request. + */ + public func upload(method: Method, _ URLString: URLStringConvertible, data: NSData) -> Request { + return upload(URLRequest(method, URLString), data: data) + } + + // MARK: Stream + + /** + Creates a request for uploading a stream to the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: URLRequest The URL request + :param: stream The stream to upload + + :returns: The created upload request. + */ + public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { + return upload(.Stream(URLRequest.URLRequest, stream)) + } + + /** + Creates a request for uploading a stream to the specified URL request. + + If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + + :param: method The HTTP method. + :param: URLString The URL string. + :param: stream The stream to upload. + + :returns: The created upload request. + */ + public func upload(method: Method, _ URLString: URLStringConvertible, stream: NSInputStream) -> Request { + return upload(URLRequest(method, URLString), stream: stream) + } +} + +// MARK: - + +extension Request { + + // MARK: - UploadTaskDelegate + + class UploadTaskDelegate: DataTaskDelegate { + var uploadTask: NSURLSessionUploadTask? { return task as? NSURLSessionUploadTask } + var uploadProgress: ((Int64, Int64, Int64) -> Void)! + + // MARK: - NSURLSessionTaskDelegate + + // MARK: Override Closures + + var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? + + // MARK: Delegate Methods + + func URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { + if taskDidSendBodyData != nil { + taskDidSendBodyData!(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else { + progress.totalUnitCount = totalBytesExpectedToSend + progress.completedUnitCount = totalBytesSent + + uploadProgress?(bytesSent, totalBytesSent, totalBytesExpectedToSend) + } + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Source/Validation.swift b/DemoApp/Carthage/Checkouts/Alamofire/Source/Validation.swift new file mode 100644 index 0000000..e03c5c6 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Source/Validation.swift @@ -0,0 +1,147 @@ +// Alamofire.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation + +extension Request { + + /** + A closure used to validate a request that takes a URL request and URL response, and returns whether the request was valid. + */ + public typealias Validation = (NSURLRequest, NSHTTPURLResponse) -> Bool + + /** + Validates the request, using the specified closure. + + If validation fails, subsequent calls to response handlers will have an associated error. + + :param: validation A closure to validate the request. + + :returns: The request. + */ + public func validate(validation: Validation) -> Self { + delegate.queue.addOperationWithBlock { + if self.response != nil && self.delegate.error == nil { + if !validation(self.request, self.response!) { + self.delegate.error = NSError(domain: AlamofireErrorDomain, code: -1, userInfo: nil) + } + } + } + + return self + } + + // MARK: - Status Code + + /** + Validates that the response has a status code in the specified range. + + If validation fails, subsequent calls to response handlers will have an associated error. + + :param: range The range of acceptable status codes. + + :returns: The request. + */ + public func validate(statusCode acceptableStatusCode: S) -> Self { + return validate { _, response in + return contains(acceptableStatusCode, response.statusCode) + } + } + + // MARK: - Content-Type + + private struct MIMEType { + let type: String + let subtype: String + + init?(_ string: String) { + let components = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).substringToIndex(string.rangeOfString(";")?.endIndex ?? string.endIndex).componentsSeparatedByString("/") + + if let type = components.first, + subtype = components.last + { + self.type = type + self.subtype = subtype + } else { + return nil + } + } + + func matches(MIME: MIMEType) -> Bool { + switch (type, subtype) { + case (MIME.type, MIME.subtype), (MIME.type, "*"), ("*", MIME.subtype), ("*", "*"): + return true + default: + return false + } + } + } + + /** + Validates that the response has a content type in the specified array. + + If validation fails, subsequent calls to response handlers will have an associated error. + + :param: contentType The acceptable content types, which may specify wildcard types and/or subtypes. + + :returns: The request. + */ + public func validate(contentType acceptableContentTypes: S) -> Self { + return validate { _, response in + if let responseContentType = response.MIMEType, + responseMIMEType = MIMEType(responseContentType) + { + for contentType in acceptableContentTypes { + if let acceptableMIMEType = MIMEType(contentType) + where acceptableMIMEType.matches(responseMIMEType) + { + return true + } + } + } + + return false + } + } + + // MARK: - Automatic + + /** + Validates that the response has a status code in the default acceptable range of 200...299, and that the content type matches any specified in the Accept HTTP header field. + + If validation fails, subsequent calls to response handlers will have an associated error. + + :returns: The request. + */ + public func validate() -> Self { + let acceptableStatusCodes: Range = 200..<300 + let acceptableContentTypes: [String] = { + if let accept = self.request.valueForHTTPHeaderField("Accept") { + return accept.componentsSeparatedByString(",") + } + + return ["*/*"] + }() + + return validate(statusCode: acceptableStatusCodes).validate(contentType: acceptableContentTypes) + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift new file mode 100644 index 0000000..c1a5077 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift @@ -0,0 +1,100 @@ +// DownloadTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireAuthenticationTestCase: XCTestCase { + func testHTTPBasicAuthentication() { + let user = "user" + let password = "password" + let URL = "http://httpbin.org/basic-auth/\(user)/\(password)" + + let invalidCredentialsExpectation = expectationWithDescription("\(URL) 401") + + Alamofire.request(.GET, URL) + .authenticate(user: "invalid", password: "credentials") + .response { request, response, _, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNil(response, "response should be nil") + XCTAssertNotNil(error, "error should not be nil") + XCTAssert(error?.code == -999, "error should be NSURLErrorDomain Code -999 'cancelled'") + + invalidCredentialsExpectation.fulfill() + } + + let validCredentialsExpectation = expectationWithDescription("\(URL) 200") + + Alamofire.request(.GET, URL) + .authenticate(user: user, password: password) + .response { request, response, _, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssert(response?.statusCode == 200, "response status code should be 200") + XCTAssertNil(error, "error should be nil") + + validCredentialsExpectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testHTTPDigestAuthentication() { + let qop = "auth" + let user = "user" + let password = "password" + let URL = "http://httpbin.org/digest-auth/\(qop)/\(user)/\(password)" + + let invalidCredentialsExpectation = expectationWithDescription("\(URL) 401") + + Alamofire.request(.GET, URL) + .authenticate(user: "invalid", password: "credentials") + .response { request, response, _, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNil(response, "response should be nil") + XCTAssertNotNil(error, "error should not be nil") + XCTAssert(error?.code == -999, "error should be NSURLErrorDomain Code -999 'cancelled'") + + invalidCredentialsExpectation.fulfill() + } + + let validCredentialsExpectation = expectationWithDescription("\(URL) 200") + + Alamofire.request(.GET, URL) + .authenticate(user: user, password: password) + .response { request, response, _, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssert(response?.statusCode == 200, "response status code should be 200") + XCTAssertNil(error, "error should be nil") + + validCredentialsExpectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift new file mode 100644 index 0000000..09fae07 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift @@ -0,0 +1,107 @@ +// DownloadTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireDownloadResponseTestCase: XCTestCase { + let searchPathDirectory: NSSearchPathDirectory = .DocumentDirectory + let searchPathDomain: NSSearchPathDomainMask = .UserDomainMask + + // MARK: - + + func testDownloadRequest() { + let numberOfLines = 100 + let URL = "http://httpbin.org/stream/\(numberOfLines)" + + let expectation = expectationWithDescription(URL) + + let destination = Alamofire.Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain) + + Alamofire.download(.GET, URL, destination) + .response { request, response, _, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + + XCTAssertNil(error, "error should be nil") + + let fileManager = NSFileManager.defaultManager() + let directory = fileManager.URLsForDirectory(self.searchPathDirectory, inDomains: self.searchPathDomain)[0] as! NSURL + + var fileManagerError: NSError? + let contents = fileManager.contentsOfDirectoryAtURL(directory, includingPropertiesForKeys: nil, options: NSDirectoryEnumerationOptions.SkipsHiddenFiles, error: &fileManagerError)! + XCTAssertNil(fileManagerError, "fileManagerError should be nil") + + #if os(iOS) + let suggestedFilename = "\(numberOfLines)" + #elseif os(OSX) + let suggestedFilename = "\(numberOfLines).json" + #endif + + let predicate = NSPredicate(format: "lastPathComponent = '\(suggestedFilename)'") + let filteredContents = (contents as NSArray).filteredArrayUsingPredicate(predicate) + XCTAssertEqual(filteredContents.count, 1, "should have one file in Documents") + + let file = filteredContents.first as! NSURL + XCTAssertEqual(file.lastPathComponent!, "\(suggestedFilename)", "filename should be \(suggestedFilename)") + + if let data = NSData(contentsOfURL: file) { + XCTAssertGreaterThan(data.length, 0, "data length should be non-zero") + } else { + XCTFail("data should exist for contents of URL") + } + + fileManager.removeItemAtURL(file, error: nil) + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testDownloadRequestWithProgress() { + let numberOfLines = 100 + let URL = "http://httpbin.org/stream/\(numberOfLines)" + + let expectation = expectationWithDescription(URL) + + let destination = Alamofire.Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain) + + let download = Alamofire.download(.GET, URL, destination) + download.progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in + XCTAssert(bytesRead > 0, "bytesRead should be > 0") + XCTAssert(totalBytesRead > 0, "totalBytesRead should be > 0") + XCTAssert(totalBytesExpectedToRead == -1, "totalBytesExpectedToRead should be -1") + + download.cancel() + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/Info.plist b/DemoApp/Carthage/Checkouts/Alamofire/Tests/Info.plist new file mode 100644 index 0000000..69853ea --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.alamofire.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift new file mode 100644 index 0000000..75dd52f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift @@ -0,0 +1,76 @@ +// RequestTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireManagerTestCase: XCTestCase { + func testSetStartRequestsImmediatelyToFalseAndResumeRequest() { + let manager = Alamofire.Manager() + manager.startRequestsImmediately = false + + let URL = NSURL(string: "http://httpbin.org/get")! + let URLRequest = NSURLRequest(URL: URL) + + let expectation = expectationWithDescription("\(URL)") + + manager.request(URLRequest) + .response { _, _, _, _ in expectation.fulfill() } + .resume() + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testReleasingManagerWithPendingRequestDeinitializesSuccessfully() { + var manager: Manager? = Alamofire.Manager() + manager!.startRequestsImmediately = false + + let URL = NSURL(string: "http://httpbin.org/get")! + let URLRequest = NSURLRequest(URL: URL) + + let request = manager!.request(URLRequest) + + manager = nil + + XCTAssert(request.task.state == .Suspended) + XCTAssertNil(manager) + } + + func testReleasingManagerWithPendingCanceledRequestDeinitializesSuccessfully() { + var manager: Manager? = Alamofire.Manager() + manager!.startRequestsImmediately = false + + let URL = NSURL(string: "http://httpbin.org/get")! + let URLRequest = NSURLRequest(URL: URL) + + let request = manager!.request(URLRequest) + request.cancel() + + manager = nil + + XCTAssert(request.task.state == .Canceling) + XCTAssertNil(manager) + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift new file mode 100644 index 0000000..e0beeff --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift @@ -0,0 +1,358 @@ +// ParameterEncodingTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireURLParameterEncodingTestCase: XCTestCase { + let encoding: ParameterEncoding = .URL + var URLRequest: NSURLRequest! + + override func setUp() { + super.setUp() + + let URL = NSURL(string: "http://example.com/")! + self.URLRequest = NSURLRequest(URL: URL) + } + + // MARK: - + + func testURLParameterEncodeNilParameters() { + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: nil) + + XCTAssertNil(URLRequest.URL!.query, "query should be nil") + } + + func testURLParameterEncodeOneStringKeyStringValueParameter() { + let parameters = ["foo": "bar"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo=bar", "query is incorrect") + } + + func testURLParameterEncodeOneStringKeyStringValueParameterAppendedToQuery() { + var mutableURLRequest = self.URLRequest.mutableCopy() as! NSMutableURLRequest + let URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false)! + URLComponents.query = "baz=qux" + mutableURLRequest.URL = URLComponents.URL + + let parameters = ["foo": "bar"] + let (URLRequest, error) = self.encoding.encode(mutableURLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "baz=qux&foo=bar", "query is incorrect") + } + + func testURLParameterEncodeTwoStringKeyStringValueParameters() { + let parameters = ["foo": "bar", "baz": "qux"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "baz=qux&foo=bar", "query is incorrect") + } + + func testURLParameterEncodeStringKeyIntegerValueParameter() { + let parameters = ["foo": 1] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo=1", "query is incorrect") + } + + func testURLParameterEncodeStringKeyDoubleValueParameter() { + let parameters = ["foo": 1.1] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo=1.1", "query is incorrect") + } + + func testURLParameterEncodeStringKeyBoolValueParameter() { + let parameters = ["foo": true] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo=1", "query is incorrect") + } + + func testURLParameterEncodeStringKeyArrayValueParameter() { + let parameters = ["foo": ["a", 1, true]] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo%5B%5D=a&foo%5B%5D=1&foo%5B%5D=1", "query is incorrect") + } + + func testURLParameterEncodeStringKeyDictionaryValueParameter() { + let parameters = ["foo": ["bar": 1]] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo%5Bbar%5D=1", "query is incorrect") + } + + func testURLParameterEncodeStringKeyNestedDictionaryValueParameter() { + let parameters = ["foo": ["bar": ["baz": 1]]] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo%5Bbar%5D%5Bbaz%5D=1", "query is incorrect") + } + + func testURLParameterEncodeStringKeyNestedDictionaryArrayValueParameter() { + let parameters = ["foo": ["bar": ["baz": ["a", 1, true]]]] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo%5Bbar%5D%5Bbaz%5D%5B%5D=a&foo%5Bbar%5D%5Bbaz%5D%5B%5D=1&foo%5Bbar%5D%5Bbaz%5D%5B%5D=1", "query is incorrect") + } + + func testURLParameterEncodeStringWithAmpersandKeyStringWithAmpersandValueParameter() { + let parameters = ["foo&bar": "baz&qux", "foobar": "bazqux"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo%26bar=baz%26qux&foobar=bazqux", "query is incorrect") + } + + func testURLParameterEncodeStringWithQuestionMarkKeyStringWithQuestionMarkValueParameter() { + let parameters = ["?foo?": "?bar?"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "?foo?=?bar?", "query is incorrect") + } + + func testURLParameterEncodeStringWithSlashKeyStringWithQuestionMarkValueParameter() { + let parameters = ["foo": "/bar/baz/qux"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "foo=/bar/baz/qux", "query is incorrect") + } + + func testURLParameterEncodeStringWithSpaceKeyStringWithSpaceValueParameter() { + let parameters = [" foo ": " bar "] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "%20foo%20=%20bar%20", "query is incorrect") + } + + func testURLParameterEncodeStringWithPlusKeyStringWithPlusValueParameter() { + let parameters = ["+foo+": "+bar+"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "%2Bfoo%2B=%2Bbar%2B", "query is incorrect") + } + + func testURLParameterEncodeStringKeyAllowedCharactersStringValueParameter() { + let parameters = ["allowed": " =\"#%<>@\\^`{}[]|&"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "allowed=%20%3D%22%23%25%3C%3E%40%5C%5E%60%7B%7D%5B%5D%7C%26", "query is incorrect") + } + + func testURLParameterEncodeStringKeyPercentEncodedStringValueParameter() { + let parameters = ["percent": "%25"] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "percent=%2525", "query is incorrect") + } + + func testURLParameterEncodeStringKeyNonLatinStringValueParameter() { + let parameters = [ + "french": "français", + "japanese": "日本語", + "arabic": "العربية", + "emoji": "😃" + ] + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "arabic=%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9&emoji=%F0%9F%98%83&french=fran%C3%A7ais&japanese=%E6%97%A5%E6%9C%AC%E8%AA%9E", "query is incorrect") + } + + func testURLParameterEncodeStringForRequestWithPrecomposedQuery() { + let URL = NSURL(string: "http://example.com/movies?hd=[1]")! + + let parameters = ["page": "0"] + let (URLRequest, error) = self.encoding.encode(NSURLRequest(URL: URL), parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "hd=%5B1%5D&page=0", "query is incorrect") + } + + func testURLParameterEncodeStringWithPlusKeyStringWithPlusValueParameterForRequestWithPrecomposedQuery() { + let URL = NSURL(string: "http://example.com/movie?hd=[1]")! + + let parameters = ["+foo+": "+bar+"] + let (URLRequest, error) = self.encoding.encode(NSURLRequest(URL: URL), parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "hd=%5B1%5D&%2Bfoo%2B=%2Bbar%2B", "query is incorrect") + } + + func testURLParameterEncodeGETParametersInURL() { + var mutableURLRequest = self.URLRequest.mutableCopy() as! NSMutableURLRequest + mutableURLRequest.HTTPMethod = Method.GET.rawValue + + let parameters = ["foo": 1, "bar": 2] + let (URLRequest, error) = self.encoding.encode(mutableURLRequest, parameters: parameters) + + XCTAssertEqual(URLRequest.URL!.query!, "bar=2&foo=1", "query is incorrect") + XCTAssertNil(URLRequest.valueForHTTPHeaderField("Content-Type"), "Content-Type should be nil") + XCTAssertNil(URLRequest.HTTPBody, "HTTPBody should be nil") + } + + func testURLParameterEncodePOSTParametersInHTTPBody() { + var mutableURLRequest = self.URLRequest.mutableCopy() as! NSMutableURLRequest + mutableURLRequest.HTTPMethod = Method.POST.rawValue + + let parameters = ["foo": 1, "bar": 2] + let (URLRequest, error) = self.encoding.encode(mutableURLRequest, parameters: parameters) + + XCTAssertEqual(NSString(data: URLRequest.HTTPBody!, encoding: NSUTF8StringEncoding)!, "bar=2&foo=1", "HTTPBody is incorrect") + XCTAssertEqual(URLRequest.valueForHTTPHeaderField("Content-Type")!, "application/x-www-form-urlencoded", "Content-Type should be application/x-www-form-urlencoded") + XCTAssertNotNil(URLRequest.HTTPBody, "HTTPBody should not be nil") + } +} + +class AlamofireJSONParameterEncodingTestCase: XCTestCase { + let encoding: ParameterEncoding = .JSON + var URLRequest: NSURLRequest! + + override func setUp() { + super.setUp() + + let URL = NSURL(string: "http://example.com/")! + self.URLRequest = NSURLRequest(URL: URL) + } + + // MARK: - + + func testJSONParameterEncodeNilParameters() { + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: nil) + + XCTAssertNil(error, "error should be nil") + XCTAssertNil(URLRequest.URL!.query, "query should be nil") + XCTAssertNil(URLRequest.valueForHTTPHeaderField("Content-Type"), "Content-Type should be nil") + XCTAssertNil(URLRequest.HTTPBody, "HTTPBody should be nil") + } + + func testJSONParameterEncodeComplexParameters() { + let parameters = [ + "foo": "bar", + "baz": ["a", 1, true], + "qux": [ + "a": 1, + "b": [2, 2], + "c": [3, 3, 3] + ] + ] + + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertNil(error, "error should be nil") + XCTAssertNil(URLRequest.URL!.query, "query should be nil") + XCTAssertNotNil(URLRequest.valueForHTTPHeaderField("Content-Type"), "Content-Type should not be nil") + XCTAssert(URLRequest.valueForHTTPHeaderField("Content-Type")!.hasPrefix("application/json"), "Content-Type should be application/json") + XCTAssertNotNil(URLRequest.HTTPBody, "HTTPBody should not be nil") + + let JSON = NSJSONSerialization.JSONObjectWithData(URLRequest.HTTPBody!, options: .AllowFragments, error: nil) as! NSObject! + XCTAssertNotNil(JSON, "HTTPBody JSON is invalid") + XCTAssertEqual(JSON as NSObject, parameters as NSObject, "HTTPBody JSON does not equal parameters") + } +} + +class AlamofirePropertyListParameterEncodingTestCase: XCTestCase { + let encoding: ParameterEncoding = .PropertyList(.XMLFormat_v1_0, 0) + var URLRequest: NSURLRequest! + + override func setUp() { + super.setUp() + + let URL = NSURL(string: "http://example.com/")! + self.URLRequest = NSURLRequest(URL: URL) + } + + // MARK: - + + func testPropertyListParameterEncodeNilParameters() { + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: nil) + + XCTAssertNil(error, "error should be nil") + XCTAssertNil(URLRequest.URL!.query, "query should be nil") + XCTAssertNil(URLRequest.valueForHTTPHeaderField("Content-Type"), "Content-Type should be nil") + XCTAssertNil(URLRequest.HTTPBody, "HTTPBody should be nil") + } + + func testPropertyListParameterEncodeComplexParameters() { + let parameters = [ + "foo": "bar", + "baz": ["a", 1, true], + "qux": [ + "a": 1, + "b": [2, 2], + "c": [3, 3, 3] + ] + ] + + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertNil(error, "error should be nil") + XCTAssertNil(URLRequest.URL!.query, "query should be nil") + XCTAssertNotNil(URLRequest.valueForHTTPHeaderField("Content-Type"), "Content-Type should not be nil") + XCTAssert(URLRequest.valueForHTTPHeaderField("Content-Type")!.hasPrefix("application/x-plist"), "Content-Type should be application/x-plist") + XCTAssertNotNil(URLRequest.HTTPBody, "HTTPBody should not be nil") + + let plist = NSPropertyListSerialization.propertyListWithData(URLRequest.HTTPBody!, options: 0, format: nil, error: nil) as! NSObject + XCTAssertNotNil(plist, "HTTPBody JSON is invalid") + XCTAssertEqual(plist as NSObject, parameters as NSObject, "HTTPBody plist does not equal parameters") + } + + func testPropertyListParameterEncodeDateAndDataParameters() { + let date: NSDate = NSDate() + let data: NSData = "data".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! + + let parameters = [ + "date": date, + "data": data + ] + + let (URLRequest, error) = self.encoding.encode(self.URLRequest, parameters: parameters) + + XCTAssertNil(error, "error should be nil") + XCTAssertNil(URLRequest.URL!.query, "query should be nil") + XCTAssertNotNil(URLRequest.valueForHTTPHeaderField("Content-Type"), "Content-Type should not be nil") + XCTAssert(URLRequest.valueForHTTPHeaderField("Content-Type")!.hasPrefix("application/x-plist"), "Content-Type should be application/x-plist") + XCTAssertNotNil(URLRequest.HTTPBody, "HTTPBody should not be nil") + + let plist = NSPropertyListSerialization.propertyListWithData(URLRequest.HTTPBody!, options: 0, format: nil, error: nil) as! NSObject! + XCTAssertNotNil(plist, "HTTPBody JSON is invalid") + XCTAssert(plist.valueForKey("date") is NSDate, "date is not NSDate") + XCTAssert(plist.valueForKey("data") is NSData, "data is not NSData") + } +} + +class AlamofireCustomParameterEncodingTestCase: XCTestCase { + func testCustomParameterEncode() { + let encodingClosure: (URLRequestConvertible, [String: AnyObject]?) -> (NSURLRequest, NSError?) = { URLRequest, parameters in + let mutableURLRequest = URLRequest.URLRequest.mutableCopy() as! NSMutableURLRequest + mutableURLRequest.setValue("Xcode", forHTTPHeaderField: "User-Agent") + return (mutableURLRequest, nil) + } + + let encoding: ParameterEncoding = .Custom(encodingClosure) + + let URL = NSURL(string: "http://example.com")! + let URLRequest = NSURLRequest(URL: URL) + let parameters: [String: AnyObject] = [:] + + XCTAssertEqual(encoding.encode(URLRequest, parameters: parameters).0, encodingClosure(URLRequest, parameters).0, "URLRequest should be equal") + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift new file mode 100644 index 0000000..4633c92 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift @@ -0,0 +1,163 @@ +// RequestTests.swift +// +// Copyright (c) 2014 Alamofire (http://alamofire.org) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireRequestInitializationTestCase: XCTestCase { + func testRequestClassMethodWithMethodAndURL() { + let URL = "http://httpbin.org/" + let request = Alamofire.request(.GET, URL) + + XCTAssertNotNil(request.request, "request should not be nil") + XCTAssertEqual(request.request.URL!, NSURL(string: URL)!, "request URL should be equal") + XCTAssertNil(request.response, "response should be nil") + } + + func testRequestClassMethodWithMethodAndURLAndParameters() { + let URL = "http://httpbin.org/get" + let request = Alamofire.request(.GET, URL, parameters: ["foo": "bar"]) + + XCTAssertNotNil(request.request, "request should not be nil") + XCTAssertNotEqual(request.request.URL!, NSURL(string: URL)!, "request URL should be equal") + XCTAssertEqual(request.request.URL!.query!, "foo=bar", "query is incorrect") + XCTAssertNil(request.response, "response should be nil") + } +} + +class AlamofireRequestResponseTestCase: XCTestCase { + func testRequestResponse() { + let URL = "http://httpbin.org/get" + let serializer = Alamofire.Request.stringResponseSerializer(encoding: NSUTF8StringEncoding) + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL, parameters: ["foo": "bar"]) + .response(serializer: serializer){ (request, response, string, error) in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNotNil(string, "string should not be nil") + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} + +class AlamofireRequestDescriptionTestCase: XCTestCase { + func testRequestDescription() { + let URL = "http://httpbin.org/get" + let request = Alamofire.request(.GET, URL) + + XCTAssertEqual(request.description, "GET http://httpbin.org/get", "incorrect request description") + + let expectation = expectationWithDescription("\(URL)") + + request.response { _, response, _, _ in + XCTAssertEqual(request.description, "GET http://httpbin.org/get (\(response!.statusCode))", "incorrect request description") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} + +class AlamofireRequestDebugDescriptionTestCase: XCTestCase { + let manager: Alamofire.Manager = { + let manager = Alamofire.Manager(configuration: NSURLSessionConfiguration.defaultSessionConfiguration()) + manager.startRequestsImmediately = false + return manager + }() + + // MARK: - + + func testGETRequestDebugDescription() { + let URL = "http://httpbin.org/get" + let request = manager.request(.GET, URL) + let components = cURLCommandComponents(request) + + XCTAssert(components[0..<3] == ["$", "curl", "-i"], "components should be equal") + XCTAssert(!contains(components, "-X"), "command should not contain explicit -X flag") + XCTAssert(components.last! == "\"\(URL)\"", "URL component should be equal") + } + + func testPOSTRequestDebugDescription() { + let URL = "http://httpbin.org/post" + let request = manager.request(.POST, URL) + let components = cURLCommandComponents(request) + + XCTAssert(components[0..<3] == ["$", "curl", "-i"], "components should be equal") + XCTAssert(components[3..<5] == ["-X", "POST"], "command should contain explicit -X flag") + XCTAssert(components.last! == "\"\(URL)\"", "URL component should be equal") + } + + func testPOSTRequestWithJSONParametersDebugDescription() { + let URL = "http://httpbin.org/post" + let request = manager.request(.POST, URL, parameters: ["foo": "bar"], encoding: .JSON) + let components = cURLCommandComponents(request) + + XCTAssert(components[0..<3] == ["$", "curl", "-i"], "components should be equal") + XCTAssert(components[3..<5] == ["-X", "POST"], "command should contain explicit -X flag") + XCTAssert(request.debugDescription.rangeOfString("-H \"Content-Type: application/json\"") != nil) + XCTAssert(request.debugDescription.rangeOfString("-d \"{\\\"foo\\\":\\\"bar\\\"}\"") != nil) + XCTAssert(components.last! == "\"\(URL)\"", "URL component should be equal") + } + + // Temporarily disabled on OS X due to build failure for CocoaPods + // See https://github.com/CocoaPods/swift/issues/24 + #if !os(OSX) + func testPOSTRequestWithCookieDebugDescription() { + let URL = "http://httpbin.org/post" + + let properties = [ + NSHTTPCookieDomain: "httpbin.org", + NSHTTPCookiePath: "/post", + NSHTTPCookieName: "foo", + NSHTTPCookieValue: "bar", + ] + let cookie = NSHTTPCookie(properties: properties)! + manager.session.configuration.HTTPCookieStorage?.setCookie(cookie) + + let request = manager.request(.POST, URL) + let components = cURLCommandComponents(request) + + XCTAssert(components[0..<3] == ["$", "curl", "-i"], "components should be equal") + XCTAssert(components[3..<5] == ["-X", "POST"], "command should contain explicit -X flag") + XCTAssert(components[5..<6] == ["-b"], "command should contain -b flag") + XCTAssert(components.last! == "\"\(URL)\"", "URL component should be equal") + } + #endif + + // MARK: - + + private func cURLCommandComponents(request: Request) -> [String] { + return request.debugDescription.componentsSeparatedByCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).filter { $0 != "" && $0 != "\\" } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift new file mode 100644 index 0000000..983e2e0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift @@ -0,0 +1,131 @@ +// ResponseTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireJSONResponseTestCase: XCTestCase { + func testGETRequestJSONResponse() { + let URL = "http://httpbin.org/get" + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL, parameters: ["foo": "bar"]) + .responseJSON { request, response, JSON, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNotNil(JSON, "JSON should not be nil") + XCTAssertNil(error, "error should be nil") + + XCTAssertEqual(JSON!["args"] as! NSObject, ["foo": "bar"], "args should be equal") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testPOSTRequestJSONResponse() { + let URL = "http://httpbin.org/post" + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.POST, URL, parameters: ["foo": "bar"]) + .responseJSON { request, response, JSON, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNotNil(JSON, "JSON should not be nil") + XCTAssertNil(error, "error should be nil") + + XCTAssertEqual(JSON!["form"] as! NSObject, ["foo": "bar"], "args should be equal") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} + +class AlamofireRedirectResponseTestCase: XCTestCase { + func testGETRequestRedirectResponse() { + let URL = "http://google.com" + let expectation = expectationWithDescription("\(URL)") + + let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate + + delegate.taskWillPerformHTTPRedirection = { session, task, response, request in + // Accept the redirect by returning the updated request. + return request + } + + Alamofire.request(.GET, URL) + .response { request, response, data, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNotNil(data, "data should not be nil") + XCTAssertNil(error, "error should be nil") + + XCTAssertEqual(response!.URL!, NSURL(string: "http://www.google.com/")!, "request should have followed a redirect") + XCTAssertEqual(response!.statusCode, 200, "response should have a 200 status code") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testGETRequestDisallowRedirectResponse() { + let URL = "http://google.com/" + let expectation = expectationWithDescription("\(URL)") + + let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate + delegate.taskWillPerformHTTPRedirection = { session, task, response, request in + // Disallow redirects by returning nil. + // TODO: NSURLSessionDelegate's URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler: + // suggests that returning nil should refuse the redirect, but this causes a deadlock/timeout + + return NSURLRequest(URL: NSURL(string: URL)!) + } + + Alamofire.request(.GET, URL) + .response { request, response, data, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNotNil(data, "data should not be nil") + XCTAssertNil(error, "error should be nil") + + XCTAssertEqual(response!.URL!, NSURL(string: URL)!, "request should not have followed a redirect") + XCTAssertEqual(response!.statusCode, 301, "response should have a 301 status code") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/TLSEvaluationTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/TLSEvaluationTests.swift new file mode 100644 index 0000000..1958876 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/TLSEvaluationTests.swift @@ -0,0 +1,45 @@ +// DownloadTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireTLSEvaluationTestCase: XCTestCase { + func testSSLCertificateCommonNameValidation() { + let URL = "https://testssl-expire.disig.sk/" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .response { _, _, _, error in + XCTAssertNotNil(error, "error should not be nil") + XCTAssert(error?.code == NSURLErrorServerCertificateUntrusted, "error should be NSURLErrorServerCertificateUntrusted") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift new file mode 100644 index 0000000..699e372 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift @@ -0,0 +1,69 @@ +// UploadTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class UploadResponseTestCase: XCTestCase { + func testUploadRequest() { + let URL = "http://httpbin.org/post" + let data = "Lorem ipsum dolor sit amet".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) + + let expectation = expectationWithDescription(URL) + + Alamofire.upload(.POST, URL, data!) + .response { request, response, _, error in + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testUploadRequestWithProgress() { + let URL = "http://httpbin.org/post" + let data = "Lorem ipsum dolor sit amet".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) + + let expectation = expectationWithDescription(URL) + + let upload = Alamofire.upload(.POST, URL, data!) + upload.progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in + XCTAssert(bytesWritten > 0, "bytesWritten should be > 0") + XCTAssert(totalBytesWritten > 0, "totalBytesWritten should be > 0") + XCTAssert(totalBytesExpectedToWrite > 0, "totalBytesExpectedToWrite should be > 0") + + upload.cancel() + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/Tests/ValidationTests.swift b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ValidationTests.swift new file mode 100644 index 0000000..cf254c5 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/Tests/ValidationTests.swift @@ -0,0 +1,304 @@ +// DownloadTests.swift +// +// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +import Foundation +import Alamofire +import XCTest + +class AlamofireStatusCodeValidationTestCase: XCTestCase { + func testValidationForRequestWithAcceptableStatusCodeResponse() { + let URL = "http://httpbin.org/status/200" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(statusCode: 200..<300) + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithUnacceptableStatusCodeResponse() { + let URL = "http://httpbin.org/status/404" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(statusCode: [200]) + .response { _, _, _, error in + XCTAssertNotNil(error, "error should not be nil") + XCTAssertEqual(error!.domain, AlamofireErrorDomain, "error should be in Alamofire error domain") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithNoAcceptableStatusCodes() { + let URL = "http://httpbin.org/status/201" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(statusCode: []) + .response { _, _, _, error in + XCTAssertNotNil(error, "error should not be nil") + XCTAssertEqual(error!.domain, AlamofireErrorDomain, "error should be in Alamofire error domain") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} + +class AlamofireContentTypeValidationTestCase: XCTestCase { + func testValidationForRequestWithAcceptableContentTypeResponse() { + let URL = "http://httpbin.org/ip" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(contentType: ["application/json"]) + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithAcceptableWildcardContentTypeResponse() { + let URL = "http://httpbin.org/ip" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(contentType: ["*/*"]) + .validate(contentType: ["application/*"]) + .validate(contentType: ["*/json"]) + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithUnacceptableContentTypeResponse() { + let URL = "http://httpbin.org/xml" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(contentType: ["application/octet-stream"]) + .response { _, _, _, error in + XCTAssertNotNil(error, "error should not be nil") + XCTAssertEqual(error!.domain, AlamofireErrorDomain, "error should be in Alamofire error domain") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithNoAcceptableContentTypeResponse() { + let URL = "http://httpbin.org/xml" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(contentType: []) + .response { _, _, _, error in + XCTAssertNotNil(error, "error should not be nil") + XCTAssertEqual(error!.domain, AlamofireErrorDomain, "error should be in Alamofire error domain") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} + +class AlamofireMultipleValidationTestCase: XCTestCase { + func testValidationForRequestWithAcceptableStatusCodeAndContentTypeResponse() { + let URL = "http://httpbin.org/ip" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(statusCode: 200..<300) + .validate(contentType: ["application/json"]) + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithUnacceptableStatusCodeAndContentTypeResponse() { + let URL = "http://httpbin.org/xml" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate(statusCode: 400..<600) + .validate(contentType: ["application/octet-stream"]) + .response { _, _, _, error in + XCTAssertNotNil(error, "error should not be nil") + XCTAssertEqual(error!.domain, AlamofireErrorDomain, "error should be in Alamofire error domain") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} + +class AlamofireAutomaticValidationTestCase: XCTestCase { + func testValidationForRequestWithAcceptableStatusCodeAndContentTypeResponse() { + let URL = NSURL(string: "http://httpbin.org/ip")! + let mutableURLRequest = NSMutableURLRequest(URL: URL) + mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept") + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate() + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithUnacceptableStatusCodeResponse() { + let URL = "http://httpbin.org/status/404" + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate() + .response { _, _, _, error in + XCTAssertNotNil(error, "error should not be nil") + XCTAssertEqual(error!.domain, AlamofireErrorDomain, "error should be in Alamofire error domain") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + + func testValidationForRequestWithAcceptableWildcardContentTypeResponse() { + let URL = NSURL(string: "http://httpbin.org/ip")! + let mutableURLRequest = NSMutableURLRequest(URL: URL) + mutableURLRequest.setValue("application/*", forHTTPHeaderField: "Accept") + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate() + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithAcceptableComplexContentTypeResponse() { + let URL = NSURL(string: "http://httpbin.org/xml")! + let mutableURLRequest = NSMutableURLRequest(URL: URL) + mutableURLRequest.setValue("text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8,*/*;q=0.5", forHTTPHeaderField: "Accept") + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate() + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } + + func testValidationForRequestWithUnacceptableContentTypeResponse() { + let URL = NSURL(string: "http://httpbin.org/xml")! + let mutableURLRequest = NSMutableURLRequest(URL: URL) + mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept") + + let expectation = expectationWithDescription("\(URL)") + + Alamofire.request(.GET, URL) + .validate() + .response { _, _, _, error in + XCTAssertNil(error, "error should be nil") + + expectation.fulfill() + } + + waitForExpectationsWithTimeout(10) { error in + XCTAssertNil(error, "\(error)") + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/iOS Example.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Alamofire/iOS Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8532a38 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/iOS Example.xcodeproj/project.pbxproj @@ -0,0 +1,379 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + F8111E0B19A951050040E7D1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E0A19A951050040E7D1 /* AppDelegate.swift */; }; + F8111E0D19A951050040E7D1 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E0C19A951050040E7D1 /* MasterViewController.swift */; }; + F8111E0F19A951050040E7D1 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E0E19A951050040E7D1 /* DetailViewController.swift */; }; + F8111E1219A951050040E7D1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8111E1019A951050040E7D1 /* Main.storyboard */; }; + F8111E1419A951050040E7D1 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F8111E1319A951050040E7D1 /* Images.xcassets */; }; + F818D0E419CA8CFA006034B1 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8111E5419A95D7C0040E7D1 /* Alamofire.framework */; }; + F818D0E619CA8D25006034B1 /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F8111E5419A95D7C0040E7D1 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F8E6024019CB3C0700A3E7F1 /* HTTPBin.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6023F19CB3C0700A3E7F1 /* HTTPBin.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + F8111E5319A95D7C0040E7D1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8111E4E19A95D7C0040E7D1 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3319A95C8B0040E7D1; + remoteInfo = Alamofire; + }; + F8111E5519A95D7C0040E7D1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8111E4E19A95D7C0040E7D1 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; + remoteInfo = AlamofireTests; + }; + F8111E5719A95D9B0040E7D1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F8111E4E19A95D7C0040E7D1 /* Alamofire.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = F8111E3219A95C8B0040E7D1; + remoteInfo = Alamofire; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + F818D0E519CA8D15006034B1 /* Copy Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F818D0E619CA8D25006034B1 /* Alamofire.framework in Copy Frameworks */, + ); + name = "Copy Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + F8111E0519A951050040E7D1 /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + F8111E0919A951050040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F8111E0A19A951050040E7D1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + F8111E0C19A951050040E7D1 /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; + F8111E0E19A951050040E7D1 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; + F8111E1119A951050040E7D1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + F8111E1319A951050040E7D1 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + F8111E4E19A95D7C0040E7D1 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = Alamofire.xcodeproj; sourceTree = ""; }; + F8E6023F19CB3C0700A3E7F1 /* HTTPBin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPBin.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F8111E0219A951050040E7D1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F818D0E419CA8CFA006034B1 /* Alamofire.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F8111DFC19A951050040E7D1 = { + isa = PBXGroup; + children = ( + F8111E0719A951050040E7D1 /* Source */, + F8111E0619A951050040E7D1 /* Products */, + F8111E4E19A95D7C0040E7D1 /* Alamofire.xcodeproj */, + ); + sourceTree = ""; + }; + F8111E0619A951050040E7D1 /* Products */ = { + isa = PBXGroup; + children = ( + F8111E0519A951050040E7D1 /* iOS Example.app */, + ); + name = Products; + sourceTree = ""; + }; + F8111E0719A951050040E7D1 /* Source */ = { + isa = PBXGroup; + children = ( + F8111E0A19A951050040E7D1 /* AppDelegate.swift */, + F8111E0C19A951050040E7D1 /* MasterViewController.swift */, + F8111E0E19A951050040E7D1 /* DetailViewController.swift */, + F8E6023F19CB3C0700A3E7F1 /* HTTPBin.swift */, + F8111E1019A951050040E7D1 /* Main.storyboard */, + F8111E1319A951050040E7D1 /* Images.xcassets */, + F8111E0819A951050040E7D1 /* Supporting Files */, + ); + name = Source; + path = Example; + sourceTree = ""; + }; + F8111E0819A951050040E7D1 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F8111E0919A951050040E7D1 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + F8111E4F19A95D7C0040E7D1 /* Products */ = { + isa = PBXGroup; + children = ( + F8111E5419A95D7C0040E7D1 /* Alamofire.framework */, + F8111E5619A95D7C0040E7D1 /* AlamofireTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F8111E0419A951050040E7D1 /* iOS Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8111E2319A951050040E7D1 /* Build configuration list for PBXNativeTarget "iOS Example" */; + buildPhases = ( + F8111E0119A951050040E7D1 /* Sources */, + F8111E0219A951050040E7D1 /* Frameworks */, + F8111E0319A951050040E7D1 /* Resources */, + F818D0E519CA8D15006034B1 /* Copy Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + F8111E5819A95D9B0040E7D1 /* PBXTargetDependency */, + ); + name = "iOS Example"; + productName = Alamofire; + productReference = F8111E0519A951050040E7D1 /* iOS Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F8111DFD19A951050040E7D1 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + ORGANIZATIONNAME = Alamofire; + TargetAttributes = { + F8111E0419A951050040E7D1 = { + CreatedOnToolsVersion = 6.0; + }; + }; + }; + buildConfigurationList = F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F8111DFC19A951050040E7D1; + productRefGroup = F8111E0619A951050040E7D1 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = F8111E4F19A95D7C0040E7D1 /* Products */; + ProjectRef = F8111E4E19A95D7C0040E7D1 /* Alamofire.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + F8111E0419A951050040E7D1 /* iOS Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + F8111E5419A95D7C0040E7D1 /* Alamofire.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Alamofire.framework; + remoteRef = F8111E5319A95D7C0040E7D1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F8111E5619A95D7C0040E7D1 /* AlamofireTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = AlamofireTests.xctest; + remoteRef = F8111E5519A95D7C0040E7D1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + F8111E0319A951050040E7D1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8111E1219A951050040E7D1 /* Main.storyboard in Resources */, + F8111E1419A951050040E7D1 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F8111E0119A951050040E7D1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8111E0F19A951050040E7D1 /* DetailViewController.swift in Sources */, + F8E6024019CB3C0700A3E7F1 /* HTTPBin.swift in Sources */, + F8111E0D19A951050040E7D1 /* MasterViewController.swift in Sources */, + F8111E0B19A951050040E7D1 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + F8111E5819A95D9B0040E7D1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + targetProxy = F8111E5719A95D9B0040E7D1 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + F8111E1019A951050040E7D1 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F8111E1119A951050040E7D1 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F8111E2119A951050040E7D1 /* 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; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F8111E2219A951050040E7D1 /* 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; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F8111E2419A951050040E7D1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "iOS Example"; + }; + name = Debug; + }; + F8111E2519A951050040E7D1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "iOS Example"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8111E2119A951050040E7D1 /* Debug */, + F8111E2219A951050040E7D1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8111E2319A951050040E7D1 /* Build configuration list for PBXNativeTarget "iOS Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8111E2419A951050040E7D1 /* Debug */, + F8111E2519A951050040E7D1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F8111DFD19A951050040E7D1 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Alamofire/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/DemoApp/Carthage/Checkouts/Alamofire/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme new file mode 100644 index 0000000..e8750bd --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Alamofire/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Future/.gitignore b/DemoApp/Carthage/Checkouts/Future/.gitignore new file mode 100644 index 0000000..bb30d78 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/.gitignore @@ -0,0 +1,19 @@ +.DS_Store + +# Xcode +build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside + +Carthage/Build diff --git a/DemoApp/Carthage/Checkouts/Future/.travis.yml b/DemoApp/Carthage/Checkouts/Future/.travis.yml new file mode 100644 index 0000000..310574e --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/.travis.yml @@ -0,0 +1 @@ +language: swift diff --git a/DemoApp/Carthage/Checkouts/Future/Cartfile b/DemoApp/Carthage/Checkouts/Future/Cartfile new file mode 100644 index 0000000..8999379 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Cartfile @@ -0,0 +1 @@ +github "antitypical/Result" == 0.4.3 diff --git a/DemoApp/Carthage/Checkouts/Future/Cartfile.resolved b/DemoApp/Carthage/Checkouts/Future/Cartfile.resolved new file mode 100644 index 0000000..0d99185 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Cartfile.resolved @@ -0,0 +1,2 @@ +github "robrix/Box" "1.2.2" +github "antitypical/Result" "0.4.3" diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/.gitignore b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/.gitignore new file mode 100644 index 0000000..95ddb50 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +xcuserdata +*.xcuserdatad +*.xccheckout +*.mode* +*.pbxuser + +Carthage/Build diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/.gitmodules b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/.gitmodules new file mode 100644 index 0000000..a82a49f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Carthage/Checkouts/Box"] + path = Carthage/Checkouts/Box + url = https://github.com/robrix/Box.git diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Cartfile b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Cartfile new file mode 100644 index 0000000..c9ef8af --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Cartfile @@ -0,0 +1 @@ +github "robrix/Box" diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Cartfile.resolved b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Cartfile.resolved new file mode 100644 index 0000000..a1ad545 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Cartfile.resolved @@ -0,0 +1 @@ +github "robrix/Box" "1.2.2" diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/.gitignore b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/.gitignore new file mode 100644 index 0000000..c945e0c --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +build +xcuserdata +*.mode* +*.pbxuser +*.xcuserdatad +*.xccheckout diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/project.pbxproj new file mode 100644 index 0000000..65a5b50 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/project.pbxproj @@ -0,0 +1,668 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + D470AC3D19E86128003DA6C6 /* Box.h in Headers */ = {isa = PBXBuildFile; fileRef = D470AC3C19E86128003DA6C6 /* Box.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D470AC4319E86128003DA6C6 /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D470AC3719E86128003DA6C6 /* Box.framework */; }; + D470AC4A19E86128003DA6C6 /* BoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC4919E86128003DA6C6 /* BoxTests.swift */; }; + D470AC5619E861E2003DA6C6 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5519E861E2003DA6C6 /* Box.swift */; }; + D470AC5819E86790003DA6C6 /* BoxType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5719E86790003DA6C6 /* BoxType.swift */; }; + D470AC5A19E868D3003DA6C6 /* MutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5919E868D3003DA6C6 /* MutableBox.swift */; }; + D470AC5C19E86A2E003DA6C6 /* MutableBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */; }; + D470AC5E19E86B2C003DA6C6 /* BoxTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */; }; + F8BB81DE1A939B67001AA352 /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8BB81D31A939B66001AA352 /* Box.framework */; }; + F8BB81EC1A939C03001AA352 /* Box.h in Headers */ = {isa = PBXBuildFile; fileRef = D470AC3C19E86128003DA6C6 /* Box.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F8BB81ED1A939C09001AA352 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5519E861E2003DA6C6 /* Box.swift */; }; + F8BB81EE1A939C0D001AA352 /* BoxType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5719E86790003DA6C6 /* BoxType.swift */; }; + F8BB81EF1A939C0D001AA352 /* MutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5919E868D3003DA6C6 /* MutableBox.swift */; }; + F8BB81F01A939C1A001AA352 /* BoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC4919E86128003DA6C6 /* BoxTests.swift */; }; + F8BB81F11A939C1A001AA352 /* BoxTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */; }; + F8BB81F21A939C1A001AA352 /* MutableBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + D470AC4419E86128003DA6C6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D470AC2E19E86128003DA6C6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D470AC3619E86128003DA6C6; + remoteInfo = Box; + }; + F8BB81DF1A939B67001AA352 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D470AC2E19E86128003DA6C6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F8BB81D21A939B66001AA352; + remoteInfo = "Box-iOS"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + D470AC3719E86128003DA6C6 /* Box.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Box.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D470AC3B19E86128003DA6C6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D470AC3C19E86128003DA6C6 /* Box.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Box.h; sourceTree = ""; }; + D470AC4219E86128003DA6C6 /* Box-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Box-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D470AC4819E86128003DA6C6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D470AC4919E86128003DA6C6 /* BoxTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoxTests.swift; sourceTree = ""; }; + D470AC5519E861E2003DA6C6 /* Box.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Box.swift; sourceTree = ""; }; + D470AC5719E86790003DA6C6 /* BoxType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BoxType.swift; sourceTree = ""; }; + D470AC5919E868D3003DA6C6 /* MutableBox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MutableBox.swift; sourceTree = ""; }; + D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MutableBoxTests.swift; sourceTree = ""; }; + D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BoxTypeTests.swift; sourceTree = ""; }; + F8BB81D31A939B66001AA352 /* Box.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Box.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F8BB81DD1A939B67001AA352 /* Box-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Box-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D470AC3319E86128003DA6C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D470AC3F19E86128003DA6C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC4319E86128003DA6C6 /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81CF1A939B66001AA352 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81DA1A939B67001AA352 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81DE1A939B67001AA352 /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D470AC2D19E86128003DA6C6 = { + isa = PBXGroup; + children = ( + D470AC3919E86128003DA6C6 /* Box */, + D470AC4619E86128003DA6C6 /* BoxTests */, + D470AC3819E86128003DA6C6 /* Products */, + ); + sourceTree = ""; + }; + D470AC3819E86128003DA6C6 /* Products */ = { + isa = PBXGroup; + children = ( + D470AC3719E86128003DA6C6 /* Box.framework */, + D470AC4219E86128003DA6C6 /* Box-MacTests.xctest */, + F8BB81D31A939B66001AA352 /* Box.framework */, + F8BB81DD1A939B67001AA352 /* Box-iOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + D470AC3919E86128003DA6C6 /* Box */ = { + isa = PBXGroup; + children = ( + D470AC3C19E86128003DA6C6 /* Box.h */, + D470AC5519E861E2003DA6C6 /* Box.swift */, + D470AC5719E86790003DA6C6 /* BoxType.swift */, + D470AC5919E868D3003DA6C6 /* MutableBox.swift */, + D470AC3A19E86128003DA6C6 /* Supporting Files */, + ); + path = Box; + sourceTree = ""; + }; + D470AC3A19E86128003DA6C6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D470AC3B19E86128003DA6C6 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + D470AC4619E86128003DA6C6 /* BoxTests */ = { + isa = PBXGroup; + children = ( + D470AC4919E86128003DA6C6 /* BoxTests.swift */, + D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */, + D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */, + D470AC4719E86128003DA6C6 /* Supporting Files */, + ); + path = BoxTests; + sourceTree = ""; + }; + D470AC4719E86128003DA6C6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D470AC4819E86128003DA6C6 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D470AC3419E86128003DA6C6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC3D19E86128003DA6C6 /* Box.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81D01A939B66001AA352 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81EC1A939C03001AA352 /* Box.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D470AC3619E86128003DA6C6 /* Box-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = D470AC4D19E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-Mac" */; + buildPhases = ( + D470AC3219E86128003DA6C6 /* Sources */, + D470AC3319E86128003DA6C6 /* Frameworks */, + D470AC3419E86128003DA6C6 /* Headers */, + D470AC3519E86128003DA6C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Box-Mac"; + productName = Box; + productReference = D470AC3719E86128003DA6C6 /* Box.framework */; + productType = "com.apple.product-type.framework"; + }; + D470AC4119E86128003DA6C6 /* Box-MacTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D470AC5019E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-MacTests" */; + buildPhases = ( + D470AC3E19E86128003DA6C6 /* Sources */, + D470AC3F19E86128003DA6C6 /* Frameworks */, + D470AC4019E86128003DA6C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D470AC4519E86128003DA6C6 /* PBXTargetDependency */, + ); + name = "Box-MacTests"; + productName = BoxTests; + productReference = D470AC4219E86128003DA6C6 /* Box-MacTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + F8BB81D21A939B66001AA352 /* Box-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8BB81E61A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOS" */; + buildPhases = ( + F8BB81CE1A939B66001AA352 /* Sources */, + F8BB81CF1A939B66001AA352 /* Frameworks */, + F8BB81D01A939B66001AA352 /* Headers */, + F8BB81D11A939B66001AA352 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Box-iOS"; + productName = Box; + productReference = F8BB81D31A939B66001AA352 /* Box.framework */; + productType = "com.apple.product-type.framework"; + }; + F8BB81DC1A939B67001AA352 /* Box-iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8BB81E91A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOSTests" */; + buildPhases = ( + F8BB81D91A939B67001AA352 /* Sources */, + F8BB81DA1A939B67001AA352 /* Frameworks */, + F8BB81DB1A939B67001AA352 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F8BB81E01A939B67001AA352 /* PBXTargetDependency */, + ); + name = "Box-iOSTests"; + productName = "Box-iOSTests"; + productReference = F8BB81DD1A939B67001AA352 /* Box-iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D470AC2E19E86128003DA6C6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = "Rob Rix"; + TargetAttributes = { + D470AC3619E86128003DA6C6 = { + CreatedOnToolsVersion = 6.1; + }; + D470AC4119E86128003DA6C6 = { + CreatedOnToolsVersion = 6.1; + }; + F8BB81D21A939B66001AA352 = { + CreatedOnToolsVersion = 6.3; + }; + F8BB81DC1A939B67001AA352 = { + CreatedOnToolsVersion = 6.3; + }; + }; + }; + buildConfigurationList = D470AC3119E86128003DA6C6 /* Build configuration list for PBXProject "Box" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = D470AC2D19E86128003DA6C6; + productRefGroup = D470AC3819E86128003DA6C6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D470AC3619E86128003DA6C6 /* Box-Mac */, + D470AC4119E86128003DA6C6 /* Box-MacTests */, + F8BB81D21A939B66001AA352 /* Box-iOS */, + F8BB81DC1A939B67001AA352 /* Box-iOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D470AC3519E86128003DA6C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D470AC4019E86128003DA6C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81D11A939B66001AA352 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81DB1A939B67001AA352 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D470AC3219E86128003DA6C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC5619E861E2003DA6C6 /* Box.swift in Sources */, + D470AC5819E86790003DA6C6 /* BoxType.swift in Sources */, + D470AC5A19E868D3003DA6C6 /* MutableBox.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D470AC3E19E86128003DA6C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC5C19E86A2E003DA6C6 /* MutableBoxTests.swift in Sources */, + D470AC4A19E86128003DA6C6 /* BoxTests.swift in Sources */, + D470AC5E19E86B2C003DA6C6 /* BoxTypeTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81CE1A939B66001AA352 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81ED1A939C09001AA352 /* Box.swift in Sources */, + F8BB81EE1A939C0D001AA352 /* BoxType.swift in Sources */, + F8BB81EF1A939C0D001AA352 /* MutableBox.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81D91A939B67001AA352 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81F01A939C1A001AA352 /* BoxTests.swift in Sources */, + F8BB81F11A939C1A001AA352 /* BoxTypeTests.swift in Sources */, + F8BB81F21A939C1A001AA352 /* MutableBoxTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + D470AC4519E86128003DA6C6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D470AC3619E86128003DA6C6 /* Box-Mac */; + targetProxy = D470AC4419E86128003DA6C6 /* PBXContainerItemProxy */; + }; + F8BB81E01A939B67001AA352 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F8BB81D21A939B66001AA352 /* Box-iOS */; + targetProxy = F8BB81DF1A939B67001AA352 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + D470AC4B19E86128003DA6C6 /* 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; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D470AC4C19E86128003DA6C6 /* 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; + COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + D470AC4E19E86128003DA6C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Box/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VALID_ARCHS = x86_64; + }; + name = Debug; + }; + D470AC4F19E86128003DA6C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Box/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SKIP_INSTALL = YES; + VALID_ARCHS = x86_64; + }; + name = Release; + }; + D470AC5119E86128003DA6C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D470AC5219E86128003DA6C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + F8BB81E71A939B67001AA352 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "$(SRCROOT)/Box/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F8BB81E81A939B67001AA352 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Box/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F8BB81EA1A939B67001AA352 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + F8BB81EB1A939B67001AA352 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D470AC3119E86128003DA6C6 /* Build configuration list for PBXProject "Box" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D470AC4B19E86128003DA6C6 /* Debug */, + D470AC4C19E86128003DA6C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D470AC4D19E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D470AC4E19E86128003DA6C6 /* Debug */, + D470AC4F19E86128003DA6C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D470AC5019E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-MacTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D470AC5119E86128003DA6C6 /* Debug */, + D470AC5219E86128003DA6C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8BB81E61A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8BB81E71A939B67001AA352 /* Debug */, + F8BB81E81A939B67001AA352 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8BB81E91A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8BB81EA1A939B67001AA352 /* Debug */, + F8BB81EB1A939B67001AA352 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D470AC2E19E86128003DA6C6 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-Mac.xcscheme b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-Mac.xcscheme new file mode 100644 index 0000000..1071191 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-Mac.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-iOS.xcscheme b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-iOS.xcscheme new file mode 100644 index 0000000..bce5fc5 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-iOS.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.h b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.h new file mode 100644 index 0000000..f02cc1c --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.h @@ -0,0 +1,7 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Project version number for Box. +extern double BoxVersionNumber; + +/// Project version string for Box. +extern const unsigned char BoxVersionString[]; diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.swift new file mode 100644 index 0000000..491e68e --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.swift @@ -0,0 +1,33 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Wraps a type `T` in a reference type. +/// +/// Typically this is used to work around limitations of value types (for example, the lack of codegen for recursive value types and type-parameterized enums with >1 case). It is also useful for sharing a single (presumably large) value without copying it. +public final class Box: BoxType, Printable { + /// Initializes a `Box` with the given value. + public init(_ value: T) { + self.value = value + } + + + /// Constructs a `Box` with the given `value`. + public class func unit(value: T) -> Box { + return Box(value) + } + + + /// The (immutable) value wrapped by the receiver. + public let value: T + + /// Constructs a new Box by transforming `value` by `f`. + public func map(@noescape f: T -> U) -> Box { + return Box(f(value)) + } + + + // MARK: Printable + + public var description: String { + return toString(value) + } +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/BoxType.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/BoxType.swift new file mode 100644 index 0000000..78a08d0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/BoxType.swift @@ -0,0 +1,46 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +// MARK: BoxType + +/// The type conformed to by all boxes. +public protocol BoxType { + /// The type of the wrapped value. + typealias Value + + /// Initializes an intance of the type with a value. + init(_ value: Value) + + /// The wrapped value. + var value: Value { get } +} + +/// The type conformed to by mutable boxes. +public protocol MutableBoxType: BoxType { + /// The (mutable) wrapped value. + var value: Value { get set } +} + + +// MARK: Equality + +/// Equality of `BoxType`s of `Equatable` types. +/// +/// We cannot declare that e.g. `Box` conforms to `Equatable`, so this is a relatively ad hoc definition. +public func == (lhs: B, rhs: B) -> Bool { + return lhs.value == rhs.value +} + +/// Inequality of `BoxType`s of `Equatable` types. +/// +/// We cannot declare that e.g. `Box` conforms to `Equatable`, so this is a relatively ad hoc definition. +public func != (lhs: B, rhs: B) -> Bool { + return lhs.value != rhs.value +} + + +// MARK: Map + +/// Maps the value of a box into a new box. +public func map(v: B, @noescape f: B.Value -> C.Value) -> C { + return C(f(v.value)) +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Info.plist b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Info.plist new file mode 100644 index 0000000..b35c271 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.2.1 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2014 Rob Rix. All rights reserved. + NSPrincipalClass + + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/MutableBox.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/MutableBox.swift new file mode 100644 index 0000000..07f266e --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/MutableBox.swift @@ -0,0 +1,27 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Wraps a type `T` in a mutable reference type. +/// +/// While this, like `Box` could be used to work around limitations of value types, it is much more useful for sharing a single mutable value such that mutations are shared. +/// +/// As with all mutable state, this should be used carefully, for example as an optimization, rather than a default design choice. Most of the time, `Box` will suffice where any `BoxType` is needed. +public final class MutableBox: MutableBoxType, Printable { + /// Initializes a `MutableBox` with the given value. + public init(_ value: T) { + self.value = value + } + + /// The (mutable) value wrapped by the receiver. + public var value: T + + /// Constructs a new MutableBox by transforming `value` by `f`. + public func map(@noescape f: T -> U) -> MutableBox { + return MutableBox(f(value)) + } + + // MARK: Printable + + public var description: String { + return toString(value) + } +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTests.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTests.swift new file mode 100644 index 0000000..796190c --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTests.swift @@ -0,0 +1,11 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +import Box +import XCTest + +class BoxTests: XCTestCase { + func testBox() { + let box = Box(1) + XCTAssertEqual(box.value, 1) + } +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTypeTests.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTypeTests.swift new file mode 100644 index 0000000..36f7594 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTypeTests.swift @@ -0,0 +1,24 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +import Box +import XCTest + +class BoxTypeTests: XCTestCase { + func testEquality() { + let (a, b, c) = (Box(1), Box(1), Box(2)) + XCTAssertTrue(a == b) + XCTAssertFalse(b == c) + } + + func testInequality() { + let (a, b, c) = (Box(1), Box(1), Box(2)) + XCTAssertFalse(a != b) + XCTAssertTrue(b != c) + } + + func testMap() { + let a = Box(1) + let b: Box = map(a, toString) + XCTAssertEqual(b.value, "1") + } +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/Info.plist b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/Info.plist new file mode 100644 index 0000000..358bdf0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/MutableBoxTests.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/MutableBoxTests.swift new file mode 100644 index 0000000..c3c1150 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/MutableBoxTests.swift @@ -0,0 +1,17 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +import Box +import XCTest + +class MutableBoxTests: XCTestCase { + func testBox() { + let box = MutableBox(1) + XCTAssertEqual(box.value, 1) + } + + func testMutation() { + let box = MutableBox(1) + box.value = 2 + XCTAssertEqual(box.value, 2) + } +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/LICENSE b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/LICENSE new file mode 100644 index 0000000..3026ee1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +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. \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/README.md b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/README.md new file mode 100644 index 0000000..b9948a0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Carthage/Checkouts/Box/README.md @@ -0,0 +1,58 @@ +# Box + +This is a Swift microframework which implements `Box` & `MutableBox`, with implementations of `==`/`!=` where `T`: `Equatable`. + +`Box` is typically used to work around limitations of value types: + +- recursive `struct`s/`enum`s +- type-parameterized `enum`s where more than one `case` has a value + +## Use + +Wrapping & unwrapping a `Box`: + +```swift +// Wrap: +let box = Box(1) + +// Unwrap: +let value = box.value +``` + +Changing the value of a `MutableBox`: + +```swift +// Mutation: +let mutableBox = MutableBox(1) +mutableBox.value = 2 +``` + +Building a recursive value type: + +```swift +struct BinaryTree { + let value: Int + let left: Box? + let right: Box? +} +``` + +Building a parameterized `enum`: + +```swift +enum Result { + case Success(Box) + case Failure(NSError) +} +``` + +See the sources for more details. + +## Integration + +1. Add this repo as a submodule in e.g. `External/Box`: + + git submodule add https://github.com/robrix/Box.git External/Box +2. Drag `Box.xcodeproj` into your `.xcworkspace`/`.xcodeproj`. +3. Add `Box.framework` to your target’s `Link Binary With Libraries` build phase. +4. You may also want to add a `Copy Files` phase which copies `Box.framework` (and any other framework dependencies you need) into your bundle’s `Frameworks` directory. If your target is a framework, you may instead want the client app to include `Box.framework`. diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/LICENSE b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/LICENSE new file mode 100644 index 0000000..3026ee1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +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. \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/README.md b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/README.md new file mode 100644 index 0000000..cf4402d --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/README.md @@ -0,0 +1,21 @@ +# Result + +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![CocoaPods](https://img.shields.io/cocoapods/v/Result.svg)](https://cocoapods.org/) + +This is a Swift µframework providing `Result`. + +`Result` values are either successful (wrapping `Value`) or failed (wrapping `Error`). This is similar to Swift’s native `Optional` type, with the addition of an error value to pass some error code, message, or object along to be logged or displayed to the user. + + +## Use + +[API documentation](http://cocoadocs.org/docsets/Result/) is in the source. + + +## Integration + +1. Add this repository as a submodule and check out its dependencies, and/or [add it to your Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) if you’re using [carthage](https://github.com/Carthage/Carthage/) to manage your dependencies. +2. Drag `Result.xcodeproj` and `Box.xcodeproj` into your project or workspace. NB: `Result.xcworkspace` is for standalone development of Result, while `Result.xcodeproj` is for targets using Result as a dependency. +3. Link your target against `Result.framework` and `Box.framework`. +4. Application targets should ensure that the framework gets copied into their application bundle. (Framework targets should instead require the application linking them to include Result and Box.) diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ec6d774 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/project.pbxproj @@ -0,0 +1,656 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + BE740B561AEB28AB004B478F /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE740B551AEB28AB004B478F /* Box.framework */; }; + BE740B571AEB29F7004B478F /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE740B551AEB28AB004B478F /* Box.framework */; }; + D454805D1A9572F5009D7229 /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D45480681A9572F5009D7229 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D45480571A9572F5009D7229 /* Result.framework */; }; + D454806F1A9572F5009D7229 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; + D45480881A957362009D7229 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D454807D1A957361009D7229 /* Result.framework */; }; + D45480971A957465009D7229 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; + D45480981A957465009D7229 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; + D45480991A9574B8009D7229 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; + D454809A1A9574BB009D7229 /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + D45480691A9572F5009D7229 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D454804E1A9572F5009D7229 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D45480561A9572F5009D7229; + remoteInfo = Result; + }; + D45480891A957362009D7229 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D454804E1A9572F5009D7229 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D454807C1A957361009D7229; + remoteInfo = "Result-iOS"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + BE740B551AEB28AB004B478F /* Box.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Box.framework; path = "../Carthage/Checkouts/Box/build/Debug-iphoneos/Box.framework"; sourceTree = ""; }; + D45480571A9572F5009D7229 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D454805B1A9572F5009D7229 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D454805C1A9572F5009D7229 /* Result.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Result.h; sourceTree = ""; }; + D45480671A9572F5009D7229 /* Result-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D454806D1A9572F5009D7229 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D454806E1A9572F5009D7229 /* ResultTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultTests.swift; sourceTree = ""; }; + D454807D1A957361009D7229 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D45480871A957362009D7229 /* Result-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D45480961A957465009D7229 /* Result.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D45480531A9572F5009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BE740B571AEB29F7004B478F /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480641A9572F5009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480681A9572F5009D7229 /* Result.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480791A957361009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BE740B561AEB28AB004B478F /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480841A957362009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480881A957362009D7229 /* Result.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D454804D1A9572F5009D7229 = { + isa = PBXGroup; + children = ( + D45480591A9572F5009D7229 /* Result */, + D454806B1A9572F5009D7229 /* ResultTests */, + D45480581A9572F5009D7229 /* Products */, + ); + sourceTree = ""; + usesTabs = 1; + }; + D45480581A9572F5009D7229 /* Products */ = { + isa = PBXGroup; + children = ( + D45480571A9572F5009D7229 /* Result.framework */, + D45480671A9572F5009D7229 /* Result-MacTests.xctest */, + D454807D1A957361009D7229 /* Result.framework */, + D45480871A957362009D7229 /* Result-iOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + D45480591A9572F5009D7229 /* Result */ = { + isa = PBXGroup; + children = ( + D454805C1A9572F5009D7229 /* Result.h */, + D45480961A957465009D7229 /* Result.swift */, + D454805A1A9572F5009D7229 /* Supporting Files */, + ); + path = Result; + sourceTree = ""; + }; + D454805A1A9572F5009D7229 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + BE740B551AEB28AB004B478F /* Box.framework */, + D454805B1A9572F5009D7229 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + D454806B1A9572F5009D7229 /* ResultTests */ = { + isa = PBXGroup; + children = ( + D454806E1A9572F5009D7229 /* ResultTests.swift */, + D454806C1A9572F5009D7229 /* Supporting Files */, + ); + path = ResultTests; + sourceTree = ""; + }; + D454806C1A9572F5009D7229 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D454806D1A9572F5009D7229 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D45480541A9572F5009D7229 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D454805D1A9572F5009D7229 /* Result.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D454807A1A957361009D7229 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D454809A1A9574BB009D7229 /* Result.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D45480561A9572F5009D7229 /* Result-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480721A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-Mac" */; + buildPhases = ( + D45480521A9572F5009D7229 /* Sources */, + D45480531A9572F5009D7229 /* Frameworks */, + D45480541A9572F5009D7229 /* Headers */, + D45480551A9572F5009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Result-Mac"; + productName = Result; + productReference = D45480571A9572F5009D7229 /* Result.framework */; + productType = "com.apple.product-type.framework"; + }; + D45480661A9572F5009D7229 /* Result-MacTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480751A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-MacTests" */; + buildPhases = ( + D45480631A9572F5009D7229 /* Sources */, + D45480641A9572F5009D7229 /* Frameworks */, + D45480651A9572F5009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D454806A1A9572F5009D7229 /* PBXTargetDependency */, + ); + name = "Result-MacTests"; + productName = ResultTests; + productReference = D45480671A9572F5009D7229 /* Result-MacTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + D454807C1A957361009D7229 /* Result-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480941A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOS" */; + buildPhases = ( + D45480781A957361009D7229 /* Sources */, + D45480791A957361009D7229 /* Frameworks */, + D454807A1A957361009D7229 /* Headers */, + D454807B1A957361009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Result-iOS"; + productName = "Result-iOS"; + productReference = D454807D1A957361009D7229 /* Result.framework */; + productType = "com.apple.product-type.framework"; + }; + D45480861A957362009D7229 /* Result-iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480951A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOSTests" */; + buildPhases = ( + D45480831A957362009D7229 /* Sources */, + D45480841A957362009D7229 /* Frameworks */, + D45480851A957362009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D454808A1A957362009D7229 /* PBXTargetDependency */, + ); + name = "Result-iOSTests"; + productName = "Result-iOSTests"; + productReference = D45480871A957362009D7229 /* Result-iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D454804E1A9572F5009D7229 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0630; + ORGANIZATIONNAME = "Rob Rix"; + TargetAttributes = { + D45480561A9572F5009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + D45480661A9572F5009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + D454807C1A957361009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + D45480861A957362009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + }; + }; + buildConfigurationList = D45480511A9572F5009D7229 /* Build configuration list for PBXProject "Result" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = D454804D1A9572F5009D7229; + productRefGroup = D45480581A9572F5009D7229 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D45480561A9572F5009D7229 /* Result-Mac */, + D45480661A9572F5009D7229 /* Result-MacTests */, + D454807C1A957361009D7229 /* Result-iOS */, + D45480861A957362009D7229 /* Result-iOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D45480551A9572F5009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480651A9572F5009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D454807B1A957361009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480851A957362009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D45480521A9572F5009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480971A957465009D7229 /* Result.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480631A9572F5009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D454806F1A9572F5009D7229 /* ResultTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480781A957361009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480981A957465009D7229 /* Result.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480831A957362009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480991A9574B8009D7229 /* ResultTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + D454806A1A9572F5009D7229 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D45480561A9572F5009D7229 /* Result-Mac */; + targetProxy = D45480691A9572F5009D7229 /* PBXContainerItemProxy */; + }; + D454808A1A957362009D7229 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D454807C1A957361009D7229 /* Result-iOS */; + targetProxy = D45480891A957362009D7229 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + D45480701A9572F5009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; + 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; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D45480711A9572F5009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; + 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; + COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + D45480731A9572F5009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VALID_ARCHS = x86_64; + }; + name = Debug; + }; + D45480741A9572F5009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SKIP_INSTALL = YES; + VALID_ARCHS = x86_64; + }; + name = Release; + }; + D45480761A9572F5009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D45480771A9572F5009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + D45480901A957362009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D45480911A957362009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D45480921A957362009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + D45480931A957362009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D45480511A9572F5009D7229 /* Build configuration list for PBXProject "Result" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480701A9572F5009D7229 /* Debug */, + D45480711A9572F5009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480721A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480731A9572F5009D7229 /* Debug */, + D45480741A9572F5009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480751A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-MacTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480761A9572F5009D7229 /* Debug */, + D45480771A9572F5009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480941A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480901A957362009D7229 /* Debug */, + D45480911A957362009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480951A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480921A957362009D7229 /* Debug */, + D45480931A957362009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D454804E1A9572F5009D7229 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-Mac.xcscheme b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-Mac.xcscheme new file mode 100644 index 0000000..b5e5ab2 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-Mac.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-iOS.xcscheme b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-iOS.xcscheme new file mode 100644 index 0000000..8ff1a0f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-iOS.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Info.plist b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Info.plist new file mode 100644 index 0000000..0c9a82d --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.1 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2015 Rob Rix. All rights reserved. + NSPrincipalClass + + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Result.h b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Result.h new file mode 100644 index 0000000..4742701 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Result.h @@ -0,0 +1,8 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// Project version number for Result. +extern double ResultVersionNumber; + +/// Project version string for Result. +extern const unsigned char ResultVersionString[]; + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Result.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Result.swift new file mode 100644 index 0000000..1aeb1d8 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/Result/Result.swift @@ -0,0 +1,201 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// An enum representing either a failure with an explanatory error, or a success with a result value. +public enum Result: Printable, DebugPrintable { + case Success(Box) + case Failure(Box) + + // MARK: Constructors + + /// Constructs a success wrapping a `value`. + public init(value: T) { + self = .Success(Box(value)) + } + + /// Constructs a failure wrapping an `error`. + public init(error: Error) { + self = .Failure(Box(error)) + } + + /// Constructs a result from an Optional, failing with `Error` if `nil` + public init(_ value: T?, @autoclosure failWith: () -> Error) { + self = value.map { .success($0) } ?? .failure(failWith()) + } + + /// Constructs a success wrapping a `value`. + public static func success(value: T) -> Result { + return Result(value: value) + } + + /// Constructs a failure wrapping an `error`. + public static func failure(error: Error) -> Result { + return Result(error: error) + } + + + // MARK: Deconstruction + + /// Returns the value from `Success` Results, `nil` otherwise. + public var value: T? { + return analysis(ifSuccess: { $0 }, ifFailure: { _ in nil }) + } + + /// Returns the error from `Failure` Results, `nil` otherwise. + public var error: Error? { + return analysis(ifSuccess: { _ in nil }, ifFailure: { $0 }) + } + + /// Case analysis for Result. + /// + /// Returns the value produced by applying `ifFailure` to `Failure` Results, or `ifSuccess` to `Success` Results. + public func analysis(@noescape #ifSuccess: T -> Result, @noescape ifFailure: Error -> Result) -> Result { + switch self { + case let .Success(value): + return ifSuccess(value.value) + case let .Failure(value): + return ifFailure(value.value) + } + } + + + // MARK: Higher-order functions + + /// Returns a new Result by mapping `Success`es’ values using `transform`, or re-wrapping `Failure`s’ errors. + public func map(@noescape transform: T -> U) -> Result { + return flatMap { .success(transform($0)) } + } + + /// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. + public func flatMap(@noescape transform: T -> Result) -> Result { + return analysis( + ifSuccess: transform, + ifFailure: Result.failure) + } + + /// Returns `self.value` if this result is a .Success, or the given value otherwise. Equivalent with `??` + public func recover(@autoclosure value: () -> T) -> T { + return self.value ?? value() + } + + /// Returns this result if it is a .Success, or the given result otherwise. Equivalent with `??` + public func recoverWith(@autoclosure result: () -> Result) -> Result { + return analysis( + ifSuccess: { _ in self }, + ifFailure: { _ in result() }) + } + + + // MARK: Errors + + /// The domain for errors constructed by Result. + public static var errorDomain: String { return "com.antitypical.Result" } + + /// The userInfo key for source functions in errors constructed by Result. + public static var functionKey: String { return "\(errorDomain).function" } + + /// The userInfo key for source file paths in errors constructed by Result. + public static var fileKey: String { return "\(errorDomain).file" } + + /// The userInfo key for source file line numbers in errors constructed by Result. + public static var lineKey: String { return "\(errorDomain).line" } + + /// Constructs an error. + public static func error(function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__) -> NSError { + return NSError(domain: "com.antitypical.Result", code: 0, userInfo: [ + functionKey: function, + fileKey: file, + lineKey: line, + ]) + } + + + // MARK: Printable + + public var description: String { + return analysis( + ifSuccess: { ".Success(\($0))" }, + ifFailure: { ".Failure(\($0))" }) + } + + + // MARK: DebugPrintable + + public var debugDescription: String { + return description + } +} + + +/// Returns `true` if `left` and `right` are both `Success`es and their values are equal, or if `left` and `right` are both `Failure`s and their errors are equal. +public func == (left: Result, right: Result) -> Bool { + if let left = left.value, right = right.value { + return left == right + } else if let left = left.error, right = right.error { + return left == right + } + return false +} + +/// Returns `true` if `left` and `right` represent different cases, or if they represent the same case but different values. +public func != (left: Result, right: Result) -> Bool { + return !(left == right) +} + + +/// Returns the value of `left` if it is a `Success`, or `right` otherwise. Short-circuits. +public func ?? (left: Result, @autoclosure right: () -> T) -> T { + return left.recover(right()) +} + +/// Returns `left` if it is a `Success`es, or `right` otherwise. Short-circuits. +public func ?? (left: Result, @autoclosure right: () -> Result) -> Result { + return left.recoverWith(right()) +} + + +// MARK: - Cocoa API conveniences + +/// Constructs a Result with the result of calling `try` with an error pointer. +/// +/// This is convenient for wrapping Cocoa API which returns an object or `nil` + an error, by reference. e.g.: +/// +/// Result.try { NSData(contentsOfURL: URL, options: .DataReadingMapped, error: $0) } +public func try(function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__, try: NSErrorPointer -> T?) -> Result { + var error: NSError? + return try(&error).map(Result.success) ?? Result.failure(error ?? Result.error(function: function, file: file, line: line)) +} + +/// Constructs a Result with the result of calling `try` with an error pointer. +/// +/// This is convenient for wrapping Cocoa API which returns a `Bool` + an error, by reference. e.g.: +/// +/// Result.try { NSFileManager.defaultManager().removeItemAtURL(URL, error: $0) } +public func try(function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__, try: NSErrorPointer -> Bool) -> Result<(), NSError> { + var error: NSError? + return try(&error) ? + .success(()) + : .failure(error ?? Result<(), NSError>.error(function: function, file: file, line: line)) +} + + +// MARK: - Operators + +infix operator >>- { + // Left-associativity so that chaining works like you’d expect, and for consistency with Haskell, Runes, swiftz, etc. + associativity left + + // Higher precedence than function application, but lower than function composition. + precedence 150 +} + + +/// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. +/// +/// This is a synonym for `flatMap`. +public func >>- (result: Result, @noescape transform: T -> Result) -> Result { + return result.flatMap(transform) +} + + +import Box +import Foundation diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/ResultTests/Info.plist b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/ResultTests/Info.plist new file mode 100644 index 0000000..358bdf0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/ResultTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/ResultTests/ResultTests.swift b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/ResultTests/ResultTests.swift new file mode 100644 index 0000000..d0cd7c3 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Carthage/Checkouts/Result/ResultTests/ResultTests.swift @@ -0,0 +1,101 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +final class ResultTests: XCTestCase { + func testMapTransformsSuccesses() { + XCTAssertEqual(success.map(count) ?? 0, 7) + } + + func testMapRewrapsFailures() { + XCTAssertEqual(failure.map(count) ?? 0, 0) + } + + func testInitOptionalSuccess() { + XCTAssert(Result("success" as String?, failWith: error) == success) + } + + func testInitOptionalFailure() { + XCTAssert(Result(nil, failWith: error) == failure) + } + + + // MARK: Errors + + func testErrorsIncludeTheSourceFile() { + let file = __FILE__ + XCTAssertEqual(Result<(), NSError>.error().file ?? "", file) + } + + func testErrorsIncludeTheSourceLine() { + let (line, error) = (__LINE__, Result<(), NSError>.error()) + XCTAssertEqual(error.line ?? -1, line) + } + + func testErrorsIncludeTheCallingFunction() { + let function = __FUNCTION__ + XCTAssertEqual(Result<(), NSError>.error().function ?? "", function) + } + + + // MARK: Cocoa API idioms + + func testTryProducesFailuresForBooleanAPIWithErrorReturnedByReference() { + let result = try { attempt(true, succeed: false, error: $0) } + XCTAssertFalse(result ?? false) + XCTAssertNotNil(result.error) + } + + func testTryProducesFailuresForOptionalWithErrorReturnedByReference() { + let result = try { attempt(1, succeed: false, error: $0) } + XCTAssertEqual(result ?? 0, 0) + XCTAssertNotNil(result.error) + } + + func testTryProducesSuccessesForBooleanAPI() { + let result = try { attempt(true, succeed: true, error: $0) } + XCTAssertTrue(result ?? false) + XCTAssertNil(result.error) + } + + func testTryProducesSuccessesForOptionalAPI() { + let result = try { attempt(1, succeed: true, error: $0) } + XCTAssertEqual(result ?? 0, 1) + XCTAssertNil(result.error) + } +} + + +// MARK: - Fixtures + +let success = Result.success("success") +let error = NSError(domain: "com.antitypical.Result", code: 0xdeadbeef, userInfo: nil) +let failure = Result.failure(error) + + +// MARK: - Helpers + +func attempt(value: T, #succeed: Bool, #error: NSErrorPointer) -> T? { + if succeed { + return value + } else { + error.memory = Result<(), NSError>.error() + return nil + } +} + +extension NSError { + var function: String? { + return userInfo?[Result<(), NSError>.functionKey as NSString] as? String + } + + var file: String? { + return userInfo?[Result<(), NSError>.fileKey as NSString] as? String + } + + var line: Int? { + return userInfo?[Result<(), NSError>.lineKey as NSString] as? Int + } +} + + +import Result +import XCTest diff --git a/DemoApp/Carthage/Checkouts/Future/Future.podspec b/DemoApp/Carthage/Checkouts/Future/Future.podspec new file mode 100644 index 0000000..6b1d7db --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Future.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |s| + s.name = "Future" + s.version = "0.0.3" + s.summary = "Swift µframework providing Future." + s.homepage = "https://github.com/nghialv/Future" + s.license = { :type => "MIT", :file => "LICENSE" } + s.author = { "nghialv" => "nghialv2607@gmail.com" } + s.social_media_url = "http://twitter.com/nghialv" + + s.platform = :ios + s.ios.deployment_target = "8.0" + s.source = { :git => "https://github.com/nghialv/Future.git", :tag => "0.0.3" } + s.source_files = "Future/*.swift" + s.requires_arc = true + s.dependency "Result", "0.4.3" +end diff --git a/DemoApp/Carthage/Checkouts/Future/Future.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Future/Future.xcodeproj/project.pbxproj new file mode 100644 index 0000000..16e2467 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Future.xcodeproj/project.pbxproj @@ -0,0 +1,490 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8C1D912F1B1C2C090074458B /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C3904A31B1AF19800E4A444 /* Box.framework */; }; + 8C1D91301B1C2C090074458B /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C3904A41B1AF19800E4A444 /* Result.framework */; }; + 8C1D91331B1C30B40074458B /* FutureFunctionalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C1D91321B1C30B40074458B /* FutureFunctionalTests.swift */; }; + 8C1D91351B1C3EDA0074458B /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C1D91341B1C3EDA0074458B /* TestUtils.swift */; }; + 8C3904A51B1AF19800E4A444 /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C3904A31B1AF19800E4A444 /* Box.framework */; }; + 8C3904A61B1AF19800E4A444 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C3904A41B1AF19800E4A444 /* Result.framework */; }; + 8C3904A91B1AF20700E4A444 /* Future.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C3904A81B1AF20700E4A444 /* Future.swift */; }; + 8C977AE31B1AF0B900047BF7 /* Future.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C977AE21B1AF0B900047BF7 /* Future.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8C977AE91B1AF0B900047BF7 /* Future.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C977ADD1B1AF0B900047BF7 /* Future.framework */; }; + 8C977AF01B1AF0B900047BF7 /* FutureStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C977AEF1B1AF0B900047BF7 /* FutureStateTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8C977AEA1B1AF0B900047BF7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8C977AD41B1AF0B900047BF7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8C977ADC1B1AF0B900047BF7; + remoteInfo = Future; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8C1D91321B1C30B40074458B /* FutureFunctionalTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FutureFunctionalTests.swift; sourceTree = ""; }; + 8C1D91341B1C3EDA0074458B /* TestUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = ""; }; + 8C3904A31B1AF19800E4A444 /* Box.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Box.framework; path = Carthage/Build/iOS/Box.framework; sourceTree = ""; }; + 8C3904A41B1AF19800E4A444 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/iOS/Result.framework; sourceTree = ""; }; + 8C3904A81B1AF20700E4A444 /* Future.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Future.swift; sourceTree = ""; }; + 8C977ADD1B1AF0B900047BF7 /* Future.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Future.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8C977AE11B1AF0B900047BF7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8C977AE21B1AF0B900047BF7 /* Future.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Future.h; sourceTree = ""; }; + 8C977AE81B1AF0B900047BF7 /* FutureTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FutureTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 8C977AEE1B1AF0B900047BF7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8C977AEF1B1AF0B900047BF7 /* FutureStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FutureStateTests.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8C977AD91B1AF0B900047BF7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8C3904A51B1AF19800E4A444 /* Box.framework in Frameworks */, + 8C3904A61B1AF19800E4A444 /* Result.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8C977AE51B1AF0B900047BF7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8C1D912F1B1C2C090074458B /* Box.framework in Frameworks */, + 8C1D91301B1C2C090074458B /* Result.framework in Frameworks */, + 8C977AE91B1AF0B900047BF7 /* Future.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8C977AD31B1AF0B900047BF7 = { + isa = PBXGroup; + children = ( + 8C977ADF1B1AF0B900047BF7 /* Future */, + 8C3904A31B1AF19800E4A444 /* Box.framework */, + 8C3904A41B1AF19800E4A444 /* Result.framework */, + 8C977AEC1B1AF0B900047BF7 /* FutureTests */, + 8C977ADE1B1AF0B900047BF7 /* Products */, + ); + sourceTree = ""; + }; + 8C977ADE1B1AF0B900047BF7 /* Products */ = { + isa = PBXGroup; + children = ( + 8C977ADD1B1AF0B900047BF7 /* Future.framework */, + 8C977AE81B1AF0B900047BF7 /* FutureTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8C977ADF1B1AF0B900047BF7 /* Future */ = { + isa = PBXGroup; + children = ( + 8C977AE21B1AF0B900047BF7 /* Future.h */, + 8C3904A81B1AF20700E4A444 /* Future.swift */, + 8C977AE01B1AF0B900047BF7 /* Supporting Files */, + ); + path = Future; + sourceTree = ""; + }; + 8C977AE01B1AF0B900047BF7 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8C977AE11B1AF0B900047BF7 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8C977AEC1B1AF0B900047BF7 /* FutureTests */ = { + isa = PBXGroup; + children = ( + 8C977AEF1B1AF0B900047BF7 /* FutureStateTests.swift */, + 8C1D91321B1C30B40074458B /* FutureFunctionalTests.swift */, + 8C1D91341B1C3EDA0074458B /* TestUtils.swift */, + 8C977AED1B1AF0B900047BF7 /* Supporting Files */, + ); + path = FutureTests; + sourceTree = ""; + }; + 8C977AED1B1AF0B900047BF7 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8C977AEE1B1AF0B900047BF7 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8C977ADA1B1AF0B900047BF7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8C977AE31B1AF0B900047BF7 /* Future.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8C977ADC1B1AF0B900047BF7 /* Future */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8C977AF31B1AF0B900047BF7 /* Build configuration list for PBXNativeTarget "Future" */; + buildPhases = ( + 8C977AD81B1AF0B900047BF7 /* Sources */, + 8C977AD91B1AF0B900047BF7 /* Frameworks */, + 8C977ADA1B1AF0B900047BF7 /* Headers */, + 8C977ADB1B1AF0B900047BF7 /* Resources */, + 8C3904A71B1AF1AA00E4A444 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Future; + productName = Future; + productReference = 8C977ADD1B1AF0B900047BF7 /* Future.framework */; + productType = "com.apple.product-type.framework"; + }; + 8C977AE71B1AF0B900047BF7 /* FutureTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8C977AF61B1AF0B900047BF7 /* Build configuration list for PBXNativeTarget "FutureTests" */; + buildPhases = ( + 8C977AE41B1AF0B900047BF7 /* Sources */, + 8C977AE51B1AF0B900047BF7 /* Frameworks */, + 8C977AE61B1AF0B900047BF7 /* Resources */, + 8C1D91311B1C2DF40074458B /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 8C977AEB1B1AF0B900047BF7 /* PBXTargetDependency */, + ); + name = FutureTests; + productName = FutureTests; + productReference = 8C977AE81B1AF0B900047BF7 /* FutureTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8C977AD41B1AF0B900047BF7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0630; + ORGANIZATIONNAME = "Le VanNghia"; + TargetAttributes = { + 8C977ADC1B1AF0B900047BF7 = { + CreatedOnToolsVersion = 6.3.2; + }; + 8C977AE71B1AF0B900047BF7 = { + CreatedOnToolsVersion = 6.3.2; + }; + }; + }; + buildConfigurationList = 8C977AD71B1AF0B900047BF7 /* Build configuration list for PBXProject "Future" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 8C977AD31B1AF0B900047BF7; + productRefGroup = 8C977ADE1B1AF0B900047BF7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8C977ADC1B1AF0B900047BF7 /* Future */, + 8C977AE71B1AF0B900047BF7 /* FutureTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8C977ADB1B1AF0B900047BF7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8C977AE61B1AF0B900047BF7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 8C1D91311B1C2DF40074458B /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/iOS/Box.framework", + "$(SRCROOT)/Carthage/Build/iOS/Result.framework", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks"; + }; + 8C3904A71B1AF1AA00E4A444 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/iOS/Box.framework", + "$(SRCROOT)/Carthage/Build/iOS/Result.framework", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8C977AD81B1AF0B900047BF7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8C3904A91B1AF20700E4A444 /* Future.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8C977AE41B1AF0B900047BF7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8C977AF01B1AF0B900047BF7 /* FutureStateTests.swift in Sources */, + 8C1D91351B1C3EDA0074458B /* TestUtils.swift in Sources */, + 8C1D91331B1C30B40074458B /* FutureFunctionalTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8C977AEB1B1AF0B900047BF7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8C977ADC1B1AF0B900047BF7 /* Future */; + targetProxy = 8C977AEA1B1AF0B900047BF7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 8C977AF11B1AF0B900047BF7 /* 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; + 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.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; + }; + 8C977AF21B1AF0B900047BF7 /* 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; + CURRENT_PROJECT_VERSION = 1; + 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.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; + }; + 8C977AF41B1AF0B900047BF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Future/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8C977AF51B1AF0B900047BF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Future/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 8C977AF71B1AF0B900047BF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = FutureTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 8C977AF81B1AF0B900047BF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = FutureTests/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 */ + 8C977AD71B1AF0B900047BF7 /* Build configuration list for PBXProject "Future" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8C977AF11B1AF0B900047BF7 /* Debug */, + 8C977AF21B1AF0B900047BF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8C977AF31B1AF0B900047BF7 /* Build configuration list for PBXNativeTarget "Future" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8C977AF41B1AF0B900047BF7 /* Debug */, + 8C977AF51B1AF0B900047BF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8C977AF61B1AF0B900047BF7 /* Build configuration list for PBXNativeTarget "FutureTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8C977AF71B1AF0B900047BF7 /* Debug */, + 8C977AF81B1AF0B900047BF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8C977AD41B1AF0B900047BF7 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Future/Future.xcodeproj/xcshareddata/xcschemes/Future.xcscheme b/DemoApp/Carthage/Checkouts/Future/Future.xcodeproj/xcshareddata/xcschemes/Future.xcscheme new file mode 100644 index 0000000..3ad36b1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Future.xcodeproj/xcshareddata/xcschemes/Future.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Future/Future/Future.h b/DemoApp/Carthage/Checkouts/Future/Future/Future.h new file mode 100644 index 0000000..aa5c00d --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Future/Future.h @@ -0,0 +1,19 @@ +// +// Future.h +// Future +// +// Created by Le VanNghia on 5/31/15. +// Copyright (c) 2015 Le VanNghia. All rights reserved. +// + +#import + +//! Project version number for Future. +FOUNDATION_EXPORT double FutureVersionNumber; + +//! Project version string for Future. +FOUNDATION_EXPORT const unsigned char FutureVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/DemoApp/Carthage/Checkouts/Future/Future/Future.swift b/DemoApp/Carthage/Checkouts/Future/Future/Future.swift new file mode 100644 index 0000000..173aefc --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Future/Future.swift @@ -0,0 +1,247 @@ +// +// Future.swift +// Future +// +// Created by Le Van Nghia on 5/31/15. +// Copyright (c) 2015 Le Van Nghia. All rights reserved. +// + +import Foundation +import Result + +public class Future { + public typealias ResultType = Result + + // MARK: Properties + internal var result: Optional + private let operation: (ResultType -> Void) -> Void + + public var value: Optional { + return result?.value + } + + public var error: Optional { + return result?.error + } + + public var isCompleted: Bool { + return result != nil + } + + public var isSuccess: Bool { + return result?.value != nil + } + + public var isFailure: Bool { + return result?.error != nil + } + + // MAKR: Initilizers + + // Init a future with the given asynchronous operation. + public init(operation: (ResultType -> Void) -> Void) { + self.operation = operation + } + + // Init a future with the given result (Result). + public convenience init(result: ResultType) { + self.init(operation: { completion in + completion(result) + }) + } + + // Init a future that succeeded with the given `value`. + public convenience init(value: T) { + self.init(result: Result(value: value)) + } + + // Init a future that failed with the given `error`. + public convenience init(error: Error) { + self.init(result: Result(error: error)) + } + + + // MARK - Completing + + // Completes the future with the given `completion` closure. + // If the future is already completed, this will be applied immediately. + public func onComplete(completion: ResultType -> Void) { + if result != nil { + completion(result!) + return + } + self.operation { [weak self] result in + self?.result = result + completion(result) + } + } + + // Completes the future with `Success` completion. + // If the future is already completed, this will be applied immediately. + // And the `completion` closure is only executed if the future success. + public func onSuccess(completion: T -> Void) { + onComplete { result in + switch result { + case .Success(let bv): completion(bv.value) + default: break + } + } + } + + // Compeltes the future with `Failure` completion. + // If the future is already completed, this will be applied immediately. + // And the `completion` colosure is only executed if the future fails. + public func onFailure(completion: Error -> Void) { + onComplete { result in + switch result { + case .Failure(let be): completion(be.value) + default: break + } + } + } +} + +// MARK: Funtional composition + +extension Future { + + // map | you can also use `<^>` operator + // Creates a new future by applying a function to the successful result of this future. + // If this future is completed with an error then the new future will also contain this error. + public func map(f: T -> U) -> Future { + return Future(operation: { completion in + self.onComplete { result in + switch result { + case .Success(let bv): completion(Result(value: f(bv.value))) + case .Failure(let be): completion(Result(error: be.value)) + } + } + }) + } + + // flatMap | | you can also use `>>-` operator + // Creates a new future by applying a function to the successful result of this future, + // and returns the result of the function as the new future. + // If this future is completed with an error then the new future will also contain this error. + public func flatMap(f: T -> Future) -> Future { + return flatten(map(f)) + } + + // filter + // Creates a new future by filtering the value of the current future with a predicate. + // If the current future contains a value which satisfies the predicate, the new future will also hold that value. + // Otherwise, the resulting future will fail with `noSuchElementError`. + public func filter(noSuchElementError: Error, p: T -> Bool) -> Future { + return Future(operation: { completion in + self.onComplete { result in + switch result { + case .Success(let bv): + let r = p(bv.value) ? Result(value: bv.value) : Result(error: noSuchElementError) + completion(r) + case .Failure: completion(result) + } + } + }) + } + + // zip + // Creates a new future that holds the tupple of results of `this` and `that`. + public func zip(that: Future) -> Future<(T,U), Error> { + return self.flatMap { thisVal -> Future<(T,U), Error> in + return that.map { thatVal in + return (thisVal, thatVal) + } + } + } + + // recover + // Returns a future that succeeded if this is a success. + // Returns a future that succeeded by applying function `f` to `error` value if this is a failure. + public func recover(f: Error -> T) -> Future { + return Future(operation: { completion in + self.onComplete { result in + switch result { + case .Success: completion(result) + case .Failure(let be): completion(Result(value: f(be.value))) + } + } + }) + } + + // andThen + // Applies the side-effect function to the result of this future. + // and returns a new future with the result of this future. + public func andThen(result: Result -> Void) -> Future { + return Future(operation: { completion in + self.onComplete { r in + result(r) + completion(r) + } + }) + } +} + +// MARK: Funtions + +// flatten +public func flatten(future: Future, Error>) -> Future { + return Future(operation: { completion in + future.onComplete { result in + switch result { + case .Success(let bf): bf.value.onComplete(completion) + case .Failure(let be): completion(Result(error: be.value)) + } + } + }) +} + +// MARK: Printable + +extension Future: Printable { + public var description: String { + return "result: \(result)\n" + + "isCompleted: \(isCompleted)\n" + + "isSuccess: \(isSuccess)\n" + + "isFailure: \(isFailure)\n" + } +} + + +// MARK: DebugPrintable + +extension Future: DebugPrintable { + public var debugDescription: String { + return description + } +} + + +// MARK: Operators + +infix operator <^> { + // Left associativity + associativity left + + // precedence + precedence 150 +} + +/* +infix operator >>- { + // Left associativity + associativity left + + // Using the same `precedence` value in antitypical/Result + precedence 100 +} +*/ + +// Operator for `map` +public func <^> (future: Future, transform: T -> U) -> Future { + return future.map(transform) +} + +// Operator for `flatMap` +public func >>- (future: Future, transform: T -> Future) -> Future { + return future.flatMap(transform) +} \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Future/Future/Info.plist b/DemoApp/Carthage/Checkouts/Future/Future/Info.plist new file mode 100644 index 0000000..384d8fb --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/Future/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.nghialv.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/DemoApp/Carthage/Checkouts/Future/FutureTests/FutureFunctionalTests.swift b/DemoApp/Carthage/Checkouts/Future/FutureTests/FutureFunctionalTests.swift new file mode 100644 index 0000000..e7a616f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/FutureTests/FutureFunctionalTests.swift @@ -0,0 +1,186 @@ +// +// FutureFunctionalTests.swift +// Future +// +// Created by Le VanNghia on 6/1/15. +// Copyright (c) 2015 Le VanNghia. All rights reserved. +// + + +import UIKit +import XCTest +import Result +import Future + +class FutureFunctionalTests: XCTestCase { + override func setUp() { + super.setUp() + } + + override func tearDown() { + super.tearDown() + } +} + +extension FutureFunctionalTests { + func testMap() { + let f = requestString("12345") <^> { count($0) } + checkFutureShouldNotBeCompleted(f) + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, 5, "Future should return 5") + case .Failure(let be): XCTAssertFalse(true, "Future should not be failed") + } + } + + let f2 = f <^> { "\($0)" } + checkFutureShouldNotBeCompleted(f2) + f2.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, "5", "Future should return 5 as a String") + case .Failure(let be): XCTAssertFalse(true, "Future should not be failed") + } + } + } + + func testFlatMap() { + let f = requestString("12345") + .flatMap(requestStringLenght) + + checkFutureShouldNotBeCompleted(f) + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, 5, "Future should return 5") + case .Failure(let be): XCTAssertFalse(true, "Future should not be failed") + } + } + } + + func testFlatMapAndMap() { + let f = requestString("12345") + .map { count($0) } + .flatMap(requestStringFromNumber) + + checkFutureShouldNotBeCompleted(f) + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, "5", "Future should return 5 as a String") + case .Failure(let be): XCTAssertFalse(true, "Future should not be failed") + } + } + } + + func testMapFlatMapOperators() { + let f = requestString("12345") <^> { count($0) } >>- requestStringFromNumber + + checkFutureShouldNotBeCompleted(f) + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, "5", "Future should return 5 as a String") + case .Failure(let be): XCTAssertFalse(true, "Future should not be failed") + } + } + } + + func testFlatMapMapOperators() { + let f = requestString("12345") >>- requestStringLenght <^> { "\($0)" } + + checkFutureShouldNotBeCompleted(f) + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, "5", "Future should return 5 as a String") + case .Failure(let be): XCTAssertFalse(true, "Future should not be failed") + } + } + } + + func testFilter() { + let noSuchElementError = NSError(domain: "noSuchElement", code: 1, userInfo: nil) + + let f = requestString("12345") + .filter(noSuchElementError) { count($0) > 2 } + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, "12345", "Future should return 12345 as a String") + case .Failure(let be): XCTAssertFalse(true, "Future should not be failed") + } + } + } + + func testFilterWhenPredicateIsSatisfied() { + let noSuchElementError = NSError(domain: "noSuchElement", code: 1, userInfo: nil) + + let f = requestString("12345") + .filter(noSuchElementError) { count($0) > 5 } + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertNil(bv.value, "Future should return nil") + case .Failure(let be): XCTAssertEqual(be.value, noSuchElementError, "Future should return noSuchElement error") + } + } + } + + func testAndThen() { + var sideeffect = 0 + + let f = requestString("12345") + .andThen { sideeffect = count($0.value!) } + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, "12345", "Future should return 12345 as a String") + case .Failure(let be): XCTAssertFalse(true, "Future should not return an error") + } + XCTAssertEqual(sideeffect, 5, "SideEffect value should equal to 5") + } + } + + func testAndThenCombineWithFlatMap() { + var sideeffect = 0 + let f = requestString("12345") + .andThen { sideeffect = count($0.value!) } + .flatMap(requestStringLenght) + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, 5, "Future should return 5") + case .Failure(let be): XCTAssertFalse(true, "Future should not return an error") + } + XCTAssertEqual(sideeffect, 5, "SideEffect value should equal to 5") + } + } + + func testRecover() { + let f = requestStringReturnError("error message") + .recover { _ in "OK" } + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, "OK", "Future should return OK") + case .Failure(let be): XCTAssertFalse(true, "Future should not return an error") + } + } + } + + func testZip() { + let f1 = requestString("12345") + let f2 = requestStringFromNumber(1) + + let f = f1.zip(f2) + f.onComplete { result in + switch result { + case .Success(let bv): + XCTAssertEqual(bv.value.0, "12345", "Future should return tupple of 12345, 1") + XCTAssertEqual(bv.value.1, "1", "Future should return tupple of 12345, 1") + case .Failure(let be): XCTAssertFalse(true, "Future should not return an error") + } + } + } +} \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Future/FutureTests/FutureStateTests.swift b/DemoApp/Carthage/Checkouts/Future/FutureTests/FutureStateTests.swift new file mode 100644 index 0000000..63e0bbe --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/FutureTests/FutureStateTests.swift @@ -0,0 +1,98 @@ +// +// FutureStateTests.swift +// FutureStateTests +// +// Created by Le VanNghia on 5/31/15. +// Copyright (c) 2015 Le VanNghia. All rights reserved. +// + +import UIKit +import XCTest +import Result +import Future + +class FutureStateTests: XCTestCase { + override func setUp() { + super.setUp() + } + + override func tearDown() { + super.tearDown() + } +} + +// MAKR: Test future state + +extension FutureStateTests { + func testFutureStateBeforeCompleting() { + let f1 = Future(value: 1) + let f2 = Future(error: NSError(domain: "Failed", code: 1, userInfo: nil)) + let f3 = Future { completion in + delay(2) { + completion(Result(value: 1)) + } + } + let futures = [f1, f2, f3] + for f in futures { + checkFutureShouldNotBeCompleted(f) + XCTAssertNil(f.value, "Future should return nil value") + XCTAssertNil(f.error, "Future should return nil error") + } + } + + func testFutureStateAfterCompletingForSucceededFuture() { + let f = Future(value: 1) + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, 1, "Future should return 1 in success result") + case .Failure: XCTAssertFalse(true, "Future should complete with success result") + } + } + + checkFutureShouldCompletedWithValue(f) + XCTAssertNotNil(f.value, "Future should return a value") + XCTAssertNil(f.error, "Future should return nil error") + } + + func testFutureStateAfterCompletingForFailedFuture() { + let error = NSError(domain: "Failed", code: 1, userInfo: nil) + let f = Future(error: error) + f.onComplete { result in + switch result { + case .Success: XCTAssertFalse(true, "Future should complete with failure result") + case .Failure(let be): XCTAssertEqual(be.value, error, "Future should return 1 in success result") + } + } + + checkFutureShouldCompletedWithError(f) + XCTAssertNil(f.value, "Future should return nil value") + XCTAssertNotNil(f.error, "Future should return an error") + } + + func testFutureStateAfterCompletingForAsyncFuture() { + let f = Future { completion in + delay(3) { + completion(Result(value: 1)) + } + } + let expectation = expectationWithDescription("Future completed") + + f.onComplete { result in + switch result { + case .Success(let bv): XCTAssertEqual(bv.value, 1, "Future should return 1 in success result") + case .Failure: XCTAssertFalse(true, "Future should complete with success result") + } + expectation.fulfill() + } + + checkFutureShouldNotBeCompleted(f) + XCTAssertNil(f.value, "Future should return nil value") + XCTAssertNil(f.error, "Future should return nil error") + + waitForExpectationsWithTimeout(3.5) { _ in + checkFutureShouldCompletedWithValue(f) + XCTAssertEqual(f.value!, 1, "Future should return 1") + XCTAssertNil(f.error, "Future should return nil error") + } + } +} diff --git a/DemoApp/Carthage/Checkouts/Future/FutureTests/Info.plist b/DemoApp/Carthage/Checkouts/Future/FutureTests/Info.plist new file mode 100644 index 0000000..2eb27c5 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/FutureTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.nghialv.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApp/Carthage/Checkouts/Future/FutureTests/TestUtils.swift b/DemoApp/Carthage/Checkouts/Future/FutureTests/TestUtils.swift new file mode 100644 index 0000000..65670f4 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/FutureTests/TestUtils.swift @@ -0,0 +1,76 @@ +// +// TestUtils.swift +// Future +// +// Created by Le VanNghia on 6/1/15. +// Copyright (c) 2015 Le VanNghia. All rights reserved. +// + +import Foundation +import XCTest +import Future +import Result + +func requestString(string: String) -> Future { + return Future { completion in + delay(1) { + completion(Result(value: string)) + } + } +} + + +func requestStringReturnError(string: String) -> Future { + return Future { completion in + delay(1) { + let error = NSError(domain: string, code: 1, userInfo: nil) + completion(Result(error: error)) + } + } +} + + +func requestStringFromNumber(number: Int) -> Future { + return Future { completion in + delay(1) { + completion(Result(value: "\(number)")) + } + } +} + +func requestStringLenght(string: String) -> Future { + return Future { completion in + delay(1) { + completion(Result(value: count(string))) + } + } +} + +func delay(delay:Double, closure:()->()) { + dispatch_after( + dispatch_time( + DISPATCH_TIME_NOW, + Int64(delay * Double(NSEC_PER_SEC)) + ), + dispatch_get_main_queue(), closure) +} + +func checkFutureShouldCompletedWithValue(f: Future) { + XCTAssertTrue(f.isCompleted, "Future should be Completed") + XCTAssertTrue(f.isSuccess, "Future should be Success") + XCTAssertFalse(f.isFailure, "Future should not be Failure") +} + +func checkFutureShouldCompletedWithError(f: Future) { + XCTAssertTrue(f.isCompleted, "Future should be Completed") + XCTAssertFalse(f.isSuccess, "Future should not be Success") + XCTAssertTrue(f.isFailure, "Future should be Failure") +} + +func checkFutureShouldNotBeCompleted(f: Future) { + XCTAssertFalse(f.isCompleted, "Future should not be Completed") + XCTAssertFalse(f.isSuccess, "Future should not be Success") + XCTAssertFalse(f.isFailure, "Future should not be Failure") + //XCTAssertNil(f.value, "Future should return nil value") + //XCTAssertNil(f.error, "Future should return nil error") +} \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Future/LICENSE b/DemoApp/Carthage/Checkouts/Future/LICENSE new file mode 100644 index 0000000..8bc0cd3 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 Le Van Nghia + +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. diff --git a/DemoApp/Carthage/Checkouts/Future/README.md b/DemoApp/Carthage/Checkouts/Future/README.md new file mode 100644 index 0000000..85f679e --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Future/README.md @@ -0,0 +1,108 @@ +Future +===== + +[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat +)](https://developer.apple.com/swift) +[![CocoaPods](https://img.shields.io/cocoapods/v/Future.svg)]() +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)] +(https://github.com/Carthage/Carthage) +[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat +)](http://mit-license.org) +[![Issues](https://img.shields.io/github/issues/nghialv/Future.svg?style=flat +)](https://github.com/nghialv/Future/issues?state=open) + + +Swift µframework providing Future<T, Error>. + +This library is inspired by the [talk of Javier Soto](https://realm.io/news/swift-summit-javier-soto-futures/) at SwiftSubmit2015 and the `Future` implementation in Scala. + +And this is using `antitypical/Result`. + +### Why we need Future? + +##### Traditional async code + +``` swift + func requestRepository(repoId: Int64, completion: (Repository?, NSError?) -> Void) {} + func requestUser(userId: Int64, completion: (User?, NSError?) -> Void) {} + + // get owner info of a given repository + requestRepository(12345) { repo, error in + if let repo = repo { + requestUser(repo.ownerId) { user, error in + if let user = user { + // do something + } else { + // error handling + } + } + } else { + // error handling + } + } + +``` + +##### Code with Future + +``` swift +let future = requestRepository(12345) + .map { $0.ownerId } + .flatMap(requestUser) + +future.onCompleted { result in + switch result { + case .Success(let user): println(user) + case .Failure(let error): println(error) + } +} + +``` + +**Shorthand by using operator** + +``` swift +let future = requestRepository(12345) <^> { $0.ownerId } >>- requestUser + +future.onCompleted { result in + switch result { + case .Success(let user): println(user) + case .Failure(let error): println(error) + } +} +``` + +Usage +----- + +- `map` `<^>` +- `flatMap` `>>-` +- `filter` +- `andThen` +- `recover` +- `zip` +- `flatten` + + +Installation +----- + +- Using Carthage +> - Insert `github "nghialv/Future"` to your Cartfile +> - Run `carthage update` + + +- Using Cocoapods +> - Insert `use_frameworks!` to your Podfile +> - Insert `pod "Future"` to your Podfile +> - Run `pod install` + +- Using Submodule + + +Requirements +----- + +- Swift 1.2 (Xcode 6.3 or later) +- iOS 8.0 or later + diff --git a/DemoApp/Carthage/Checkouts/Himotoki/.gitignore b/DemoApp/Carthage/Checkouts/Himotoki/.gitignore new file mode 100644 index 0000000..71e4fe5 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/.gitignore @@ -0,0 +1,37 @@ +### https://raw.github.com/github/gitignore/ae5f226a51dcbfaecafe97fe82dc82da85d17203/Swift.gitignore + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + + diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.podspec b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.podspec new file mode 100644 index 0000000..6512168 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.podspec @@ -0,0 +1,25 @@ +Pod::Spec.new do |s| + s.name = "Himotoki" + s.version = "0.3" + s.summary = "A type-safe JSON decoding library purely written in Swift" + s.description = <<-DESC +Himotoki (紐解き) is a type-safe JSON decoding library purely written in Swift. This library is highly inspired by popular JSON parsing libraries in Swift: [Argo](https://github.com/thoughtbot/Argo) and [ObjectMapper](https://github.com/Hearst-DD/ObjectMapper). + +_Himotoki_ has the same meaning of 'decoding' in Japanese. + +- Just do JSON decoding (deserialization) well. JSON encoding (serialization) would not be supported going forward. :wink: +- Much simpler API. +- Fail-fast conditional model building. This is useful for some `struct`s with non-optional `let` properties. +- No external dependencies. +DESC + s.homepage = "https://github.com/ikesyo/Himotoki" + s.license = "MIT" + s.author = { "Syo Ikeda" => "suicaicoca@gmail.com" } + s.social_media_url = "https://twitter.com/ikesyo" + + s.ios.deployment_target = "8.0" + s.osx.deployment_target = "10.9" + s.source = { :git => "https://github.com/ikesyo/Himotoki.git", :tag => s.version } + s.source_files = "Himotoki/**/*.swift" + s.requires_arc = true +end diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/project.pbxproj new file mode 100644 index 0000000..268e21a --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/project.pbxproj @@ -0,0 +1,677 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CD181ED91AF4F7C20065963F /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD181ED81AF4F7C20065963F /* Operators.swift */; }; + CD7423DF1AF608E70056144E /* Himotoki.h in Headers */ = {isa = PBXBuildFile; fileRef = CD929A3C1AF4A2C3002F5C53 /* Himotoki.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CD929A3D1AF4A2C3002F5C53 /* Himotoki.h in Headers */ = {isa = PBXBuildFile; fileRef = CD929A3C1AF4A2C3002F5C53 /* Himotoki.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CD929A431AF4A2C3002F5C53 /* Himotoki.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD929A371AF4A2C3002F5C53 /* Himotoki.framework */; }; + CD929A541AF4A488002F5C53 /* Decodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD929A531AF4A488002F5C53 /* Decodable.swift */; }; + CD929A561AF4A4C9002F5C53 /* Extractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD929A551AF4A4C9002F5C53 /* Extractor.swift */; }; + CD929A581AF4A915002F5C53 /* DecodableTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD929A571AF4A915002F5C53 /* DecodableTest.swift */; }; + CD9ADBF91B00F8F600406AA5 /* ArgumentsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD9ADBF81B00F8F600406AA5 /* ArgumentsBuilder.swift */; }; + CD9ADBFA1B00F8F600406AA5 /* ArgumentsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD9ADBF81B00F8F600406AA5 /* ArgumentsBuilder.swift */; }; + CDC4E7871B0ACB42007F8F88 /* decode.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC4E7861B0ACB42007F8F88 /* decode.swift */; }; + CDC4E7881B0ACB42007F8F88 /* decode.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC4E7861B0ACB42007F8F88 /* decode.swift */; }; + CDF03E3E1AF606F70041C3AA /* Himotoki.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDF03E331AF606F60041C3AA /* Himotoki.framework */; }; + CDF03E4C1AF607540041C3AA /* Decodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD929A531AF4A488002F5C53 /* Decodable.swift */; }; + CDF03E4D1AF607580041C3AA /* Extractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD929A551AF4A4C9002F5C53 /* Extractor.swift */; }; + CDF03E4E1AF607650041C3AA /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD181ED81AF4F7C20065963F /* Operators.swift */; }; + CDF03E4F1AF607A20041C3AA /* DecodableTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD929A571AF4A915002F5C53 /* DecodableTest.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + CD929A441AF4A2C3002F5C53 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CD929A2E1AF4A2C3002F5C53 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CD929A361AF4A2C3002F5C53; + remoteInfo = Himotoki; + }; + CDF03E3F1AF606F70041C3AA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CD929A2E1AF4A2C3002F5C53 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CDF03E321AF606F60041C3AA; + remoteInfo = Himotoki; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + CD181ED81AF4F7C20065963F /* Operators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = ""; }; + CD929A371AF4A2C3002F5C53 /* Himotoki.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Himotoki.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CD929A3B1AF4A2C3002F5C53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CD929A3C1AF4A2C3002F5C53 /* Himotoki.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Himotoki.h; sourceTree = ""; }; + CD929A421AF4A2C3002F5C53 /* HimotokiTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HimotokiTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + CD929A481AF4A2C3002F5C53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CD929A531AF4A488002F5C53 /* Decodable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Decodable.swift; sourceTree = ""; }; + CD929A551AF4A4C9002F5C53 /* Extractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extractor.swift; sourceTree = ""; }; + CD929A571AF4A915002F5C53 /* DecodableTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DecodableTest.swift; sourceTree = ""; }; + CD9ADBF81B00F8F600406AA5 /* ArgumentsBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArgumentsBuilder.swift; sourceTree = ""; }; + CDC4E7861B0ACB42007F8F88 /* decode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = decode.swift; sourceTree = ""; }; + CDF03E331AF606F60041C3AA /* Himotoki.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Himotoki.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CDF03E3D1AF606F60041C3AA /* HimotokiTests-Mac.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HimotokiTests-Mac.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CD929A331AF4A2C3002F5C53 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD929A3F1AF4A2C3002F5C53 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CD929A431AF4A2C3002F5C53 /* Himotoki.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDF03E2F1AF606F60041C3AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDF03E3A1AF606F60041C3AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CDF03E3E1AF606F70041C3AA /* Himotoki.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CD929A2D1AF4A2C3002F5C53 = { + isa = PBXGroup; + children = ( + CD929A391AF4A2C3002F5C53 /* Himotoki */, + CD929A461AF4A2C3002F5C53 /* HimotokiTests */, + CD929A381AF4A2C3002F5C53 /* Products */, + ); + sourceTree = ""; + }; + CD929A381AF4A2C3002F5C53 /* Products */ = { + isa = PBXGroup; + children = ( + CD929A371AF4A2C3002F5C53 /* Himotoki.framework */, + CD929A421AF4A2C3002F5C53 /* HimotokiTests-iOS.xctest */, + CDF03E331AF606F60041C3AA /* Himotoki.framework */, + CDF03E3D1AF606F60041C3AA /* HimotokiTests-Mac.xctest */, + ); + name = Products; + sourceTree = ""; + }; + CD929A391AF4A2C3002F5C53 /* Himotoki */ = { + isa = PBXGroup; + children = ( + CDBE196E1AFFB47A005843C9 /* Sources */, + CD929A3A1AF4A2C3002F5C53 /* Supporting Files */, + ); + path = Himotoki; + sourceTree = ""; + }; + CD929A3A1AF4A2C3002F5C53 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CD929A3B1AF4A2C3002F5C53 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CD929A461AF4A2C3002F5C53 /* HimotokiTests */ = { + isa = PBXGroup; + children = ( + CD929A571AF4A915002F5C53 /* DecodableTest.swift */, + CD929A471AF4A2C3002F5C53 /* Supporting Files */, + ); + path = HimotokiTests; + sourceTree = ""; + }; + CD929A471AF4A2C3002F5C53 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CD929A481AF4A2C3002F5C53 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CDBE196E1AFFB47A005843C9 /* Sources */ = { + isa = PBXGroup; + children = ( + CD9ADBF81B00F8F600406AA5 /* ArgumentsBuilder.swift */, + CD929A531AF4A488002F5C53 /* Decodable.swift */, + CDC4E7861B0ACB42007F8F88 /* decode.swift */, + CD929A551AF4A4C9002F5C53 /* Extractor.swift */, + CD929A3C1AF4A2C3002F5C53 /* Himotoki.h */, + CD181ED81AF4F7C20065963F /* Operators.swift */, + ); + name = Sources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + CD929A341AF4A2C3002F5C53 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CD929A3D1AF4A2C3002F5C53 /* Himotoki.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDF03E301AF606F60041C3AA /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CD7423DF1AF608E70056144E /* Himotoki.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + CD929A361AF4A2C3002F5C53 /* Himotoki-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD929A4D1AF4A2C3002F5C53 /* Build configuration list for PBXNativeTarget "Himotoki-iOS" */; + buildPhases = ( + CD929A321AF4A2C3002F5C53 /* Sources */, + CD929A331AF4A2C3002F5C53 /* Frameworks */, + CD929A341AF4A2C3002F5C53 /* Headers */, + CD929A351AF4A2C3002F5C53 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Himotoki-iOS"; + productName = Himotoki; + productReference = CD929A371AF4A2C3002F5C53 /* Himotoki.framework */; + productType = "com.apple.product-type.framework"; + }; + CD929A411AF4A2C3002F5C53 /* HimotokiTests-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD929A501AF4A2C3002F5C53 /* Build configuration list for PBXNativeTarget "HimotokiTests-iOS" */; + buildPhases = ( + CD929A3E1AF4A2C3002F5C53 /* Sources */, + CD929A3F1AF4A2C3002F5C53 /* Frameworks */, + CD929A401AF4A2C3002F5C53 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CD929A451AF4A2C3002F5C53 /* PBXTargetDependency */, + ); + name = "HimotokiTests-iOS"; + productName = HimotokiTests; + productReference = CD929A421AF4A2C3002F5C53 /* HimotokiTests-iOS.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + CDF03E321AF606F60041C3AA /* Himotoki-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = CDF03E4A1AF606F70041C3AA /* Build configuration list for PBXNativeTarget "Himotoki-Mac" */; + buildPhases = ( + CDF03E2E1AF606F60041C3AA /* Sources */, + CDF03E2F1AF606F60041C3AA /* Frameworks */, + CDF03E301AF606F60041C3AA /* Headers */, + CDF03E311AF606F60041C3AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Himotoki-Mac"; + productName = Himotoki; + productReference = CDF03E331AF606F60041C3AA /* Himotoki.framework */; + productType = "com.apple.product-type.framework"; + }; + CDF03E3C1AF606F60041C3AA /* HimotokiTests-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = CDF03E4B1AF606F70041C3AA /* Build configuration list for PBXNativeTarget "HimotokiTests-Mac" */; + buildPhases = ( + CDF03E391AF606F60041C3AA /* Sources */, + CDF03E3A1AF606F60041C3AA /* Frameworks */, + CDF03E3B1AF606F60041C3AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CDF03E401AF606F70041C3AA /* PBXTargetDependency */, + ); + name = "HimotokiTests-Mac"; + productName = HimotokiTests; + productReference = CDF03E3D1AF606F60041C3AA /* HimotokiTests-Mac.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CD929A2E1AF4A2C3002F5C53 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0630; + ORGANIZATIONNAME = "Syo Ikeda"; + TargetAttributes = { + CD929A361AF4A2C3002F5C53 = { + CreatedOnToolsVersion = 6.3; + }; + CD929A411AF4A2C3002F5C53 = { + CreatedOnToolsVersion = 6.3; + }; + CDF03E321AF606F60041C3AA = { + CreatedOnToolsVersion = 6.3; + }; + CDF03E3C1AF606F60041C3AA = { + CreatedOnToolsVersion = 6.3; + }; + }; + }; + buildConfigurationList = CD929A311AF4A2C3002F5C53 /* Build configuration list for PBXProject "Himotoki" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CD929A2D1AF4A2C3002F5C53; + productRefGroup = CD929A381AF4A2C3002F5C53 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CD929A361AF4A2C3002F5C53 /* Himotoki-iOS */, + CD929A411AF4A2C3002F5C53 /* HimotokiTests-iOS */, + CDF03E321AF606F60041C3AA /* Himotoki-Mac */, + CDF03E3C1AF606F60041C3AA /* HimotokiTests-Mac */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CD929A351AF4A2C3002F5C53 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD929A401AF4A2C3002F5C53 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDF03E311AF606F60041C3AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDF03E3B1AF606F60041C3AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CD929A321AF4A2C3002F5C53 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD929A561AF4A4C9002F5C53 /* Extractor.swift in Sources */, + CDC4E7871B0ACB42007F8F88 /* decode.swift in Sources */, + CD929A541AF4A488002F5C53 /* Decodable.swift in Sources */, + CD9ADBF91B00F8F600406AA5 /* ArgumentsBuilder.swift in Sources */, + CD181ED91AF4F7C20065963F /* Operators.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD929A3E1AF4A2C3002F5C53 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD929A581AF4A915002F5C53 /* DecodableTest.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDF03E2E1AF606F60041C3AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDF03E4D1AF607580041C3AA /* Extractor.swift in Sources */, + CDC4E7881B0ACB42007F8F88 /* decode.swift in Sources */, + CDF03E4C1AF607540041C3AA /* Decodable.swift in Sources */, + CD9ADBFA1B00F8F600406AA5 /* ArgumentsBuilder.swift in Sources */, + CDF03E4E1AF607650041C3AA /* Operators.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDF03E391AF606F60041C3AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDF03E4F1AF607A20041C3AA /* DecodableTest.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + CD929A451AF4A2C3002F5C53 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CD929A361AF4A2C3002F5C53 /* Himotoki-iOS */; + targetProxy = CD929A441AF4A2C3002F5C53 /* PBXContainerItemProxy */; + }; + CDF03E401AF606F70041C3AA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CDF03E321AF606F60041C3AA /* Himotoki-Mac */; + targetProxy = CDF03E3F1AF606F70041C3AA /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + CD929A4B1AF4A2C3002F5C53 /* 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; + 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.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + CD929A4C1AF4A2C3002F5C53 /* 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; + CURRENT_PROJECT_VERSION = 1; + 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.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + CD929A4E1AF4A2C3002F5C53 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Himotoki/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(PROJECT_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + CD929A4F1AF4A2C3002F5C53 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Himotoki/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(PROJECT_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + CD929A511AF4A2C3002F5C53 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = HimotokiTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + CD929A521AF4A2C3002F5C53 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = HimotokiTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Release; + }; + CDF03E461AF606F70041C3AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Himotoki/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(PROJECT_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + CDF03E471AF606F70041C3AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Himotoki/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(PROJECT_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; + CDF03E481AF606F70041C3AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = HimotokiTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + CDF03E491AF606F70041C3AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + INFOPLIST_FILE = HimotokiTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CD929A311AF4A2C3002F5C53 /* Build configuration list for PBXProject "Himotoki" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD929A4B1AF4A2C3002F5C53 /* Debug */, + CD929A4C1AF4A2C3002F5C53 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD929A4D1AF4A2C3002F5C53 /* Build configuration list for PBXNativeTarget "Himotoki-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD929A4E1AF4A2C3002F5C53 /* Debug */, + CD929A4F1AF4A2C3002F5C53 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD929A501AF4A2C3002F5C53 /* Build configuration list for PBXNativeTarget "HimotokiTests-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD929A511AF4A2C3002F5C53 /* Debug */, + CD929A521AF4A2C3002F5C53 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CDF03E4A1AF606F70041C3AA /* Build configuration list for PBXNativeTarget "Himotoki-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CDF03E461AF606F70041C3AA /* Debug */, + CDF03E471AF606F70041C3AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CDF03E4B1AF606F70041C3AA /* Build configuration list for PBXNativeTarget "HimotokiTests-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CDF03E481AF606F70041C3AA /* Debug */, + CDF03E491AF606F70041C3AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CD929A2E1AF4A2C3002F5C53 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/xcshareddata/xcschemes/Himotoki-Mac.xcscheme b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/xcshareddata/xcschemes/Himotoki-Mac.xcscheme new file mode 100644 index 0000000..ebda9ec --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/xcshareddata/xcschemes/Himotoki-Mac.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/xcshareddata/xcschemes/Himotoki-iOS.xcscheme b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/xcshareddata/xcschemes/Himotoki-iOS.xcscheme new file mode 100644 index 0000000..e568ae9 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki.xcodeproj/xcshareddata/xcschemes/Himotoki-iOS.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/ArgumentsBuilder.swift b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/ArgumentsBuilder.swift new file mode 100644 index 0000000..29f3ae2 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/ArgumentsBuilder.swift @@ -0,0 +1,163 @@ +// +// ArgumentsBuilder.swift +// Himotoki +// +// Created by Syo Ikeda on 5/11/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +// MARK: Arguments builder + +public func build(a: A?) -> (A)? { + if let a = a { + return (a) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?) -> (A, B)? { + if let a = a, b = b() { + return (a, b) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?) -> (A, B, C)? { + if let a = a, b = b(), c = c() { + return (a, b, c) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?) -> (A, B, C, D)? { + if let a = a, b = b(), c = c(), d = d() { + return (a, b, c, d) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?) -> (A, B, C, D, E)? { + if let a = a, b = b(), c = c(), d = d(), e = e() { + return (a, b, c, d, e) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?) -> (A, B, C, D, E, F)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f() { + return (a, b, c, d, e, f) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?) -> (A, B, C, D, E, F, G)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g() { + return (a, b, c, d, e, f, g) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?) -> (A, B, C, D, E, F, G, H)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h() { + return (a, b, c, d, e, f, g, h) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?) -> (A, B, C, D, E, F, G, H, I)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i() { + return (a, b, c, d, e, f, g, h, i) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?) -> (A, B, C, D, E, F, G, H, I, J)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j() { + return (a, b, c, d, e, f, g, h, i, j) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?) -> (A, B, C, D, E, F, G, H, I, J, K)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k() { + return (a, b, c, d, e, f, g, h, i, j, k) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?) -> (A, B, C, D, E, F, G, H, I, J, K, L)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l() { + return (a, b, c, d, e, f, g, h, i, j, k, l) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?, @autoclosure p: () -> P?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o(), p = p() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?, @autoclosure p: () -> P?, @autoclosure q: () -> Q?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o(), p = p(), q = q() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?, @autoclosure p: () -> P?, @autoclosure q: () -> Q?, @autoclosure r: () -> R?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o(), p = p(), q = q(), r = r() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?, @autoclosure p: () -> P?, @autoclosure q: () -> Q?, @autoclosure r: () -> R?, @autoclosure s: () -> S?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o(), p = p(), q = q(), r = r(), s = s() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?, @autoclosure p: () -> P?, @autoclosure q: () -> Q?, @autoclosure r: () -> R?, @autoclosure s: () -> S?, @autoclosure t: () -> T?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o(), p = p(), q = q(), r = r(), s = s(), t = t() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?, @autoclosure p: () -> P?, @autoclosure q: () -> Q?, @autoclosure r: () -> R?, @autoclosure s: () -> S?, @autoclosure t: () -> T?, @autoclosure u: () -> U?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o(), p = p(), q = q(), r = r(), s = s(), t = t(), u = u() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) + } + return nil +} + +public func build(a: A?, @autoclosure b: () -> B?, @autoclosure c: () -> C?, @autoclosure d: () -> D?, @autoclosure e: () -> E?, @autoclosure f: () -> F?, @autoclosure g: () -> G?, @autoclosure h: () -> H?, @autoclosure i: () -> I?, @autoclosure j: () -> J?, @autoclosure k: () -> K?, @autoclosure l: () -> L?, @autoclosure m: () -> M?, @autoclosure n: () -> N?, @autoclosure o: () -> O?, @autoclosure p: () -> P?, @autoclosure q: () -> Q?, @autoclosure r: () -> R?, @autoclosure s: () -> S?, @autoclosure t: () -> T?, @autoclosure u: () -> U?, @autoclosure v: () -> V?) -> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)? { + if let a = a, b = b(), c = c(), d = d(), e = e(), f = f(), g = g(), h = h(), i = i(), j = j(), k = k(), l = l(), m = m(), n = n(), o = o(), p = p(), q = q(), r = r(), s = s(), t = t(), u = u(), v = v() { + return (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) + } + return nil +} diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Decodable.swift b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Decodable.swift new file mode 100644 index 0000000..8da2989 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Decodable.swift @@ -0,0 +1,54 @@ +// +// Decodable.swift +// Himotoki +// +// Created by Syo Ikeda on 5/2/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +public protocol Decodable { + typealias DecodedType = Self + static func decode(e: Extractor) -> DecodedType? +} + +extension String: Decodable { + public static func decode(e: Extractor) -> String? { + return e.rawValue as? String + } +} + +extension Int: Decodable { + public static func decode(e: Extractor) -> Int? { + return e.rawValue as? Int + } +} + +extension Int64: Decodable { + public static func decode(e: Extractor) -> Int64? { + return NSNumber.decode(e)?.longLongValue + } +} + +extension Double: Decodable { + public static func decode(e: Extractor) -> Double? { + return e.rawValue as? Double + } +} + +extension Float: Decodable { + public static func decode(e: Extractor) -> Float? { + return e.rawValue as? Float + } +} + +extension Bool: Decodable { + public static func decode(e: Extractor) -> Bool? { + return e.rawValue as? Bool + } +} + +extension NSNumber: Decodable { + public static func decode(e: Extractor) -> NSNumber? { + return e.rawValue as? NSNumber + } +} diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Extractor.swift b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Extractor.swift new file mode 100644 index 0000000..0e233c0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Extractor.swift @@ -0,0 +1,74 @@ +// +// Extractor.swift +// Himotoki +// +// Created by Syo Ikeda on 5/2/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +public struct Extractor { + public let rawValue: AnyObject + + internal init(_ rawValue: AnyObject) { + self.rawValue = rawValue + } + + private func rawValue(keyPath: String) -> AnyObject? { + if let dictionary = rawValue as? [String: AnyObject] { + let components = ArraySlice(split(keyPath) { $0 == "." }) + return valueFor(components, dictionary) + } else { + return nil + } + } + + public func value(keyPath: String) -> Optional { + return rawValue(keyPath).flatMap(decode) + } + + public func valueOptional(keyPath: String) -> Optional { + return Optional(value(keyPath)) + } + + public func array(keyPath: String) -> Optional<[T]> { + return rawValue(keyPath).flatMap(decode) + } + + public func arrayOptional(keyPath: String) -> Optional<[T]?> { + return Optional(array(keyPath)) + } + + public func dictionary(keyPath: String) -> Optional<[String: T]> { + return rawValue(keyPath).flatMap(decode) + } + + public func dictionaryOptional(keyPath: String) -> Optional<[String: T]?> { + return Optional(dictionary(keyPath)) + } +} + +// Implement it as a tail recursive function. +// +// `ArraySlice` is used for performance optimization. +// See https://gist.github.com/norio-nomura/d9ec7212f2cfde3fb662. +private func valueFor(keyPathComponents: ArraySlice, dictionary: [String: AnyObject]) -> AnyObject? { + if keyPathComponents.isEmpty { + return nil + } + + if let object: AnyObject = dictionary[keyPathComponents.first!] { + switch object { + case is NSNull: + return nil + + case let dict as [String: AnyObject] where keyPathComponents.count > 1: + let tail = dropFirst(keyPathComponents) + return valueFor(tail, dict) + + default: + return object + } + } + + return nil +} diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Himotoki.h b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Himotoki.h new file mode 100644 index 0000000..f777374 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Himotoki.h @@ -0,0 +1,19 @@ +// +// Himotoki.h +// Himotoki +// +// Created by Syo Ikeda on 5/2/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +@import Foundation; + +//! Project version number for Himotoki. +FOUNDATION_EXPORT double HimotokiVersionNumber; + +//! Project version string for Himotoki. +FOUNDATION_EXPORT const unsigned char HimotokiVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Info.plist b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Info.plist new file mode 100644 index 0000000..44f3603 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.ikesyo.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.3 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2015 Syo Ikeda. All rights reserved. + NSPrincipalClass + + + diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Operators.swift b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Operators.swift new file mode 100644 index 0000000..702604f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/Operators.swift @@ -0,0 +1,38 @@ +// +// Operators.swift +// Himotoki +// +// Created by Syo Ikeda on 5/2/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +infix operator <| { associativity left precedence 150 } +infix operator <|? { associativity left precedence 150 } +infix operator <|| { associativity left precedence 150 } +infix operator <||? { associativity left precedence 150 } +infix operator <|-| { associativity left precedence 150 } +infix operator <|-|? { associativity left precedence 150 } + +public func <| (e: Extractor, keyPath: String) -> Optional { + return e.value(keyPath) +} + +public func <|? (e: Extractor, keyPath: String) -> Optional { + return e.valueOptional(keyPath) +} + +public func <|| (e: Extractor, keyPath: String) -> Optional<[T]> { + return e.array(keyPath) +} + +public func <||? (e: Extractor, keyPath: String) -> Optional<[T]?> { + return e.arrayOptional(keyPath) +} + +public func <|-| (e: Extractor, keyPath: String) -> Optional<[String: T]> { + return e.dictionary(keyPath) +} + +public func <|-|? (e: Extractor, keyPath: String) -> Optional<[String: T]?> { + return e.dictionaryOptional(keyPath) +} diff --git a/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/decode.swift b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/decode.swift new file mode 100644 index 0000000..060918e --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/Himotoki/decode.swift @@ -0,0 +1,37 @@ +// +// decode.swift +// Himotoki +// +// Created by Syo Ikeda on 5/19/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +public func decode(object: AnyObject) -> T? { + let extractor = Extractor(object) + return T.decode(extractor) +} + +public func decode(object: AnyObject) -> [T]? { + if let array = object as? [AnyObject] { + return array.reduce([]) { (var accum, value) in + if let decoded: T = decode(value) { + accum?.append(decoded) + } + return accum + } + } else { + return nil + } +} + +public func decode(object: AnyObject) -> [String: T]? { + if let dictionary = object as? [String: AnyObject] { + return reduce(dictionary, [:]) { (var accum, element) in + let (key, value: AnyObject) = element + accum?[key] = decode(value) + return accum + } + } else { + return nil + } +} diff --git a/DemoApp/Carthage/Checkouts/Himotoki/HimotokiTests/DecodableTest.swift b/DemoApp/Carthage/Checkouts/Himotoki/HimotokiTests/DecodableTest.swift new file mode 100644 index 0000000..ce767d1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/HimotokiTests/DecodableTest.swift @@ -0,0 +1,155 @@ +// +// DecodableTest.swift +// Himotoki +// +// Created by Syo Ikeda on 5/2/15. +// Copyright (c) 2015 Syo Ikeda. All rights reserved. +// + +import XCTest +import Himotoki + +class DecodableTest: XCTestCase { + + func testPerson() { + var gruopJSON: [String: AnyObject] = [ "name": "Himotoki", "floor": 12 ] + var JSON: [String: AnyObject] = [ + "first_name": "ABC", + "last_name": "DEF", + "age": 20, + "int64": NSNumber(longLong: INT64_MAX), + "height": 175.9, + "float": 32.1 as Float, + "bool": true, + "number": NSNumber(long: 123456789), + "nested": [ "value": "The nested value" ], + "array": [ "123", "456" ], + "arrayOption": NSNull(), + "dictionary": [ "A": 1, "B": 2 ], + // "dictionaryOption" key is missing + "group": gruopJSON, + ] + + JSON["groups"] = [ gruopJSON, gruopJSON ] + + // Succeeding case + let person: Person? = decode(JSON) + XCTAssert(person != nil) + XCTAssert(person?.firstName == "ABC") + XCTAssert(person?.lastName == "DEF") + XCTAssert(person?.age == 20) + XCTAssert(person?.int64 == INT64_MAX) + XCTAssert(person?.height == 175.9) + XCTAssert(person?.float == 32.1) + XCTAssert(person?.bool == true) + XCTAssert(person?.number == NSNumber(long: 123456789)) + + XCTAssert(person?.nested == "The nested value") + XCTAssert(person?.array.count == 2) + XCTAssert(person?.array.first == "123") + XCTAssert(person?.arrayOption == nil) + XCTAssert(person?.dictionary.count == 2) + XCTAssert(person?.dictionary["A"] == 1) + XCTAssert(person?.dictionaryOption == nil) + + XCTAssert(person?.group.name == "Himotoki") + XCTAssert(person?.group.floor == 12) + XCTAssert(person?.group.optional == nil) + XCTAssert(person?.groups.count == 2) + + // Failing case + JSON["bool"] = nil + JSON["group"] = nil + let nilPerson: Person? = decode(JSON) + XCTAssert(nilPerson == nil) + } + + func testGroup() { + var JSON: [String: AnyObject] = [ "name": "Himotoki", "floor": 12 ] + + let g: Group? = decode(JSON) + XCTAssert(g != nil) + XCTAssert(g?.name == "Himotoki") + XCTAssert(g?.floor == 12) + XCTAssert(g?.optional == nil) + + JSON["name"] = nil + let f: Group? = decode(JSON) + XCTAssert(f == nil) + } + + func testDecodeArray() { + let JSON: [String: AnyObject] = [ "name": "Himotoki", "floor": 12 ] + let JSONArray = [ JSON, JSON ] + + let values: [Group]? = decode(JSONArray) + XCTAssert(values != nil) + XCTAssert(values?.count == 2) + } + + func testDecodeDictionary() { + let JSON: [String: AnyObject] = [ "name": "Himotoki", "floor": 12 ] + let JSONDict = [ "1": JSON, "2": JSON ] + + let values: [String: Group]? = decode(JSONDict) + XCTAssert(values != nil) + XCTAssert(values?.count == 2) + } + +} + +struct Person: Decodable { + let firstName: String + let lastName: String + let age: Int + let int64: Int64 + let height: Double + let float: Float + let bool: Bool + let number: NSNumber + + let nested: String + let array: [String] + let arrayOption: [String]? + let dictionary: [String: Int] + let dictionaryOption: [String: Int]? + + let group: Group + let groups: [Group] + + static func decode(e: Extractor) -> Person? { + let create = { Person($0) } + return build( + e <| "first_name", + e <| "last_name", + e <| "age", + e <| "int64", + e <| "height", + e <| "float", + e <| "bool", + e <| "number", + e <| "nested.value", + e <|| "array", + e <||? "arrayOption", + e <|-| "dictionary", + e <|-|? "dictionaryOption", + e <| "group", + e <|| "groups" + ).map(create) + } +} + +struct Group: Decodable { + let name: String + let floor: Int + let optional: [String]? + + static func decode(e: Extractor) -> Group? { + let create = { Group($0) } + return build( + e <| "name", + e <| "floor", + e <||? "optional" + ).map(create) + } +} diff --git a/DemoApp/Carthage/Checkouts/Himotoki/HimotokiTests/Info.plist b/DemoApp/Carthage/Checkouts/Himotoki/HimotokiTests/Info.plist new file mode 100644 index 0000000..cc7e26f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/HimotokiTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.ikesyo.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApp/Carthage/Checkouts/Himotoki/LICENSE.md b/DemoApp/Carthage/Checkouts/Himotoki/LICENSE.md new file mode 100644 index 0000000..d89aa6f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Syo Ikeda + +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. diff --git a/DemoApp/Carthage/Checkouts/Himotoki/README.md b/DemoApp/Carthage/Checkouts/Himotoki/README.md new file mode 100644 index 0000000..3b6544d --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/README.md @@ -0,0 +1,87 @@ +# Himotoki + +[![Join the chat at https://gitter.im/ikesyo/Himotoki](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ikesyo/Himotoki?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +[![Circle CI](https://img.shields.io/circleci/project/ikesyo/Himotoki/master.svg?style=flat)](https://circleci.com/gh/ikesyo/Himotoki) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) + +Himotoki (紐解き) is a type-safe JSON decoding library purely written in Swift. This library is highly inspired by popular JSON parsing libraries in Swift: [Argo](https://github.com/thoughtbot/Argo) and [ObjectMapper](https://github.com/Hearst-DD/ObjectMapper). + +_Himotoki_ has the same meaning of 'decoding' in Japanese. + +- Just do JSON decoding (deserialization) well. JSON encoding (serialization) would not be supported going forward. :wink: +- Much simpler API. +- Fail-fast conditional model building. This is useful for some `struct`s with non-optional `let` properties. +- No external dependencies. + +See a simple example from a test code: + +```swift +struct Group: Decodable { + let name: String + let floor: Int + let optional: [String]? + + // MARK: Decodable + + static func decode(e: Extractor) -> Group? { + // Initializer as a function + let create = { Group($0) } + + // Create an arguments list which itself is optional, + // then use it with `Optional.map()` + return build( + e <| "name", + e <| "floor", + e <||? "optional" + ).map(create) + } +} + +func testGroup() { + var JSON: [String: AnyObject] = [ "name": "Himotoki", "floor": 12 ] + + let g: Group? = decode(JSON) + XCTAssert(g != nil) + XCTAssert(g?.name == "Himotoki") + XCTAssert(g?.floor == 12) + XCTAssert(g?.optional == nil) + + JSON["name"] = nil + let f: Group? = decode(JSON) + XCTAssert(f == nil) +} +``` + +## Requirements + +- Swift 1.2 (Xcode 6.3 or later) +- iOS 8.0 or later (by Carthage) / iOS 7 (by coping the source files directly) +- OS X 10.9 or later + +## Installation + +There are 2 options. If your app support iOS 7, you can only use the latter way. + +### [Framework with Carthage](https://github.com/Carthage/Carthage) (preferable) + +- Add `github "ikesyo/Himotoki"` to your Cartfile. +- Run `carthage update`. + +### Copying the source files directly + +- Add this repository as a git submodule: + +```swift +$ git submodule add https://github.com/ikesyo/Himotoki.git PATH_TO_SUBMODULE + +// or + +$ carthage update --use-submodules +``` + +- Then just add references of `Himotoki/*.swift` to your Xcode project. + +## License + +Himotoki is released under the [MIT License](LICENSE.md). diff --git a/DemoApp/Carthage/Checkouts/Himotoki/circle.yml b/DemoApp/Carthage/Checkouts/Himotoki/circle.yml new file mode 100644 index 0000000..1e3c39a --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Himotoki/circle.yml @@ -0,0 +1,15 @@ +machine: + xcode: + version: "6.3.1" + environment: + LC_CTYPE: en_US.UTF-8 + +dependencies: + override: + - sudo chown :wheel /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ *.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim + - sudo gem install cocoapods xcpretty --no-ri --no-rdoc + +test: + override: + - pod spec lint + - set -o pipefail && xcodebuild test -scheme Himotoki-Mac | xcpretty -c -r junit -o $CIRCLE_TEST_REPORTS/test-report-mac.xml diff --git a/DemoApp/Carthage/Checkouts/Result/.gitignore b/DemoApp/Carthage/Checkouts/Result/.gitignore new file mode 100644 index 0000000..95ddb50 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +xcuserdata +*.xcuserdatad +*.xccheckout +*.mode* +*.pbxuser + +Carthage/Build diff --git a/DemoApp/Carthage/Checkouts/Result/.gitmodules b/DemoApp/Carthage/Checkouts/Result/.gitmodules new file mode 100644 index 0000000..a82a49f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Carthage/Checkouts/Box"] + path = Carthage/Checkouts/Box + url = https://github.com/robrix/Box.git diff --git a/DemoApp/Carthage/Checkouts/Result/Cartfile b/DemoApp/Carthage/Checkouts/Result/Cartfile new file mode 100644 index 0000000..c9ef8af --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Cartfile @@ -0,0 +1 @@ +github "robrix/Box" diff --git a/DemoApp/Carthage/Checkouts/Result/Cartfile.resolved b/DemoApp/Carthage/Checkouts/Result/Cartfile.resolved new file mode 100644 index 0000000..a1ad545 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Cartfile.resolved @@ -0,0 +1 @@ +github "robrix/Box" "1.2.2" diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/.gitignore b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/.gitignore new file mode 100644 index 0000000..c945e0c --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +build +xcuserdata +*.mode* +*.pbxuser +*.xcuserdatad +*.xccheckout diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/project.pbxproj new file mode 100644 index 0000000..65a5b50 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/project.pbxproj @@ -0,0 +1,668 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + D470AC3D19E86128003DA6C6 /* Box.h in Headers */ = {isa = PBXBuildFile; fileRef = D470AC3C19E86128003DA6C6 /* Box.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D470AC4319E86128003DA6C6 /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D470AC3719E86128003DA6C6 /* Box.framework */; }; + D470AC4A19E86128003DA6C6 /* BoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC4919E86128003DA6C6 /* BoxTests.swift */; }; + D470AC5619E861E2003DA6C6 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5519E861E2003DA6C6 /* Box.swift */; }; + D470AC5819E86790003DA6C6 /* BoxType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5719E86790003DA6C6 /* BoxType.swift */; }; + D470AC5A19E868D3003DA6C6 /* MutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5919E868D3003DA6C6 /* MutableBox.swift */; }; + D470AC5C19E86A2E003DA6C6 /* MutableBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */; }; + D470AC5E19E86B2C003DA6C6 /* BoxTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */; }; + F8BB81DE1A939B67001AA352 /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8BB81D31A939B66001AA352 /* Box.framework */; }; + F8BB81EC1A939C03001AA352 /* Box.h in Headers */ = {isa = PBXBuildFile; fileRef = D470AC3C19E86128003DA6C6 /* Box.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F8BB81ED1A939C09001AA352 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5519E861E2003DA6C6 /* Box.swift */; }; + F8BB81EE1A939C0D001AA352 /* BoxType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5719E86790003DA6C6 /* BoxType.swift */; }; + F8BB81EF1A939C0D001AA352 /* MutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5919E868D3003DA6C6 /* MutableBox.swift */; }; + F8BB81F01A939C1A001AA352 /* BoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC4919E86128003DA6C6 /* BoxTests.swift */; }; + F8BB81F11A939C1A001AA352 /* BoxTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */; }; + F8BB81F21A939C1A001AA352 /* MutableBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + D470AC4419E86128003DA6C6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D470AC2E19E86128003DA6C6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D470AC3619E86128003DA6C6; + remoteInfo = Box; + }; + F8BB81DF1A939B67001AA352 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D470AC2E19E86128003DA6C6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F8BB81D21A939B66001AA352; + remoteInfo = "Box-iOS"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + D470AC3719E86128003DA6C6 /* Box.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Box.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D470AC3B19E86128003DA6C6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D470AC3C19E86128003DA6C6 /* Box.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Box.h; sourceTree = ""; }; + D470AC4219E86128003DA6C6 /* Box-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Box-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D470AC4819E86128003DA6C6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D470AC4919E86128003DA6C6 /* BoxTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoxTests.swift; sourceTree = ""; }; + D470AC5519E861E2003DA6C6 /* Box.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Box.swift; sourceTree = ""; }; + D470AC5719E86790003DA6C6 /* BoxType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BoxType.swift; sourceTree = ""; }; + D470AC5919E868D3003DA6C6 /* MutableBox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MutableBox.swift; sourceTree = ""; }; + D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MutableBoxTests.swift; sourceTree = ""; }; + D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BoxTypeTests.swift; sourceTree = ""; }; + F8BB81D31A939B66001AA352 /* Box.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Box.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F8BB81DD1A939B67001AA352 /* Box-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Box-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D470AC3319E86128003DA6C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D470AC3F19E86128003DA6C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC4319E86128003DA6C6 /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81CF1A939B66001AA352 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81DA1A939B67001AA352 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81DE1A939B67001AA352 /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D470AC2D19E86128003DA6C6 = { + isa = PBXGroup; + children = ( + D470AC3919E86128003DA6C6 /* Box */, + D470AC4619E86128003DA6C6 /* BoxTests */, + D470AC3819E86128003DA6C6 /* Products */, + ); + sourceTree = ""; + }; + D470AC3819E86128003DA6C6 /* Products */ = { + isa = PBXGroup; + children = ( + D470AC3719E86128003DA6C6 /* Box.framework */, + D470AC4219E86128003DA6C6 /* Box-MacTests.xctest */, + F8BB81D31A939B66001AA352 /* Box.framework */, + F8BB81DD1A939B67001AA352 /* Box-iOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + D470AC3919E86128003DA6C6 /* Box */ = { + isa = PBXGroup; + children = ( + D470AC3C19E86128003DA6C6 /* Box.h */, + D470AC5519E861E2003DA6C6 /* Box.swift */, + D470AC5719E86790003DA6C6 /* BoxType.swift */, + D470AC5919E868D3003DA6C6 /* MutableBox.swift */, + D470AC3A19E86128003DA6C6 /* Supporting Files */, + ); + path = Box; + sourceTree = ""; + }; + D470AC3A19E86128003DA6C6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D470AC3B19E86128003DA6C6 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + D470AC4619E86128003DA6C6 /* BoxTests */ = { + isa = PBXGroup; + children = ( + D470AC4919E86128003DA6C6 /* BoxTests.swift */, + D470AC5D19E86B2C003DA6C6 /* BoxTypeTests.swift */, + D470AC5B19E86A2E003DA6C6 /* MutableBoxTests.swift */, + D470AC4719E86128003DA6C6 /* Supporting Files */, + ); + path = BoxTests; + sourceTree = ""; + }; + D470AC4719E86128003DA6C6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D470AC4819E86128003DA6C6 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D470AC3419E86128003DA6C6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC3D19E86128003DA6C6 /* Box.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81D01A939B66001AA352 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81EC1A939C03001AA352 /* Box.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D470AC3619E86128003DA6C6 /* Box-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = D470AC4D19E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-Mac" */; + buildPhases = ( + D470AC3219E86128003DA6C6 /* Sources */, + D470AC3319E86128003DA6C6 /* Frameworks */, + D470AC3419E86128003DA6C6 /* Headers */, + D470AC3519E86128003DA6C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Box-Mac"; + productName = Box; + productReference = D470AC3719E86128003DA6C6 /* Box.framework */; + productType = "com.apple.product-type.framework"; + }; + D470AC4119E86128003DA6C6 /* Box-MacTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D470AC5019E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-MacTests" */; + buildPhases = ( + D470AC3E19E86128003DA6C6 /* Sources */, + D470AC3F19E86128003DA6C6 /* Frameworks */, + D470AC4019E86128003DA6C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D470AC4519E86128003DA6C6 /* PBXTargetDependency */, + ); + name = "Box-MacTests"; + productName = BoxTests; + productReference = D470AC4219E86128003DA6C6 /* Box-MacTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + F8BB81D21A939B66001AA352 /* Box-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8BB81E61A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOS" */; + buildPhases = ( + F8BB81CE1A939B66001AA352 /* Sources */, + F8BB81CF1A939B66001AA352 /* Frameworks */, + F8BB81D01A939B66001AA352 /* Headers */, + F8BB81D11A939B66001AA352 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Box-iOS"; + productName = Box; + productReference = F8BB81D31A939B66001AA352 /* Box.framework */; + productType = "com.apple.product-type.framework"; + }; + F8BB81DC1A939B67001AA352 /* Box-iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8BB81E91A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOSTests" */; + buildPhases = ( + F8BB81D91A939B67001AA352 /* Sources */, + F8BB81DA1A939B67001AA352 /* Frameworks */, + F8BB81DB1A939B67001AA352 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F8BB81E01A939B67001AA352 /* PBXTargetDependency */, + ); + name = "Box-iOSTests"; + productName = "Box-iOSTests"; + productReference = F8BB81DD1A939B67001AA352 /* Box-iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D470AC2E19E86128003DA6C6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = "Rob Rix"; + TargetAttributes = { + D470AC3619E86128003DA6C6 = { + CreatedOnToolsVersion = 6.1; + }; + D470AC4119E86128003DA6C6 = { + CreatedOnToolsVersion = 6.1; + }; + F8BB81D21A939B66001AA352 = { + CreatedOnToolsVersion = 6.3; + }; + F8BB81DC1A939B67001AA352 = { + CreatedOnToolsVersion = 6.3; + }; + }; + }; + buildConfigurationList = D470AC3119E86128003DA6C6 /* Build configuration list for PBXProject "Box" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = D470AC2D19E86128003DA6C6; + productRefGroup = D470AC3819E86128003DA6C6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D470AC3619E86128003DA6C6 /* Box-Mac */, + D470AC4119E86128003DA6C6 /* Box-MacTests */, + F8BB81D21A939B66001AA352 /* Box-iOS */, + F8BB81DC1A939B67001AA352 /* Box-iOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D470AC3519E86128003DA6C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D470AC4019E86128003DA6C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81D11A939B66001AA352 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81DB1A939B67001AA352 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D470AC3219E86128003DA6C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC5619E861E2003DA6C6 /* Box.swift in Sources */, + D470AC5819E86790003DA6C6 /* BoxType.swift in Sources */, + D470AC5A19E868D3003DA6C6 /* MutableBox.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D470AC3E19E86128003DA6C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D470AC5C19E86A2E003DA6C6 /* MutableBoxTests.swift in Sources */, + D470AC4A19E86128003DA6C6 /* BoxTests.swift in Sources */, + D470AC5E19E86B2C003DA6C6 /* BoxTypeTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81CE1A939B66001AA352 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81ED1A939C09001AA352 /* Box.swift in Sources */, + F8BB81EE1A939C0D001AA352 /* BoxType.swift in Sources */, + F8BB81EF1A939C0D001AA352 /* MutableBox.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BB81D91A939B67001AA352 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8BB81F01A939C1A001AA352 /* BoxTests.swift in Sources */, + F8BB81F11A939C1A001AA352 /* BoxTypeTests.swift in Sources */, + F8BB81F21A939C1A001AA352 /* MutableBoxTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + D470AC4519E86128003DA6C6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D470AC3619E86128003DA6C6 /* Box-Mac */; + targetProxy = D470AC4419E86128003DA6C6 /* PBXContainerItemProxy */; + }; + F8BB81E01A939B67001AA352 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F8BB81D21A939B66001AA352 /* Box-iOS */; + targetProxy = F8BB81DF1A939B67001AA352 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + D470AC4B19E86128003DA6C6 /* 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; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D470AC4C19E86128003DA6C6 /* 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; + COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + D470AC4E19E86128003DA6C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Box/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VALID_ARCHS = x86_64; + }; + name = Debug; + }; + D470AC4F19E86128003DA6C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Box/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SKIP_INSTALL = YES; + VALID_ARCHS = x86_64; + }; + name = Release; + }; + D470AC5119E86128003DA6C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D470AC5219E86128003DA6C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + F8BB81E71A939B67001AA352 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "$(SRCROOT)/Box/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F8BB81E81A939B67001AA352 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Box/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Box; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F8BB81EA1A939B67001AA352 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + F8BB81EB1A939B67001AA352 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = BoxTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D470AC3119E86128003DA6C6 /* Build configuration list for PBXProject "Box" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D470AC4B19E86128003DA6C6 /* Debug */, + D470AC4C19E86128003DA6C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D470AC4D19E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D470AC4E19E86128003DA6C6 /* Debug */, + D470AC4F19E86128003DA6C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D470AC5019E86128003DA6C6 /* Build configuration list for PBXNativeTarget "Box-MacTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D470AC5119E86128003DA6C6 /* Debug */, + D470AC5219E86128003DA6C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8BB81E61A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8BB81E71A939B67001AA352 /* Debug */, + F8BB81E81A939B67001AA352 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8BB81E91A939B67001AA352 /* Build configuration list for PBXNativeTarget "Box-iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8BB81EA1A939B67001AA352 /* Debug */, + F8BB81EB1A939B67001AA352 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D470AC2E19E86128003DA6C6 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-Mac.xcscheme b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-Mac.xcscheme new file mode 100644 index 0000000..1071191 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-Mac.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-iOS.xcscheme b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-iOS.xcscheme new file mode 100644 index 0000000..bce5fc5 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box.xcodeproj/xcshareddata/xcschemes/Box-iOS.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.h b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.h new file mode 100644 index 0000000..f02cc1c --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.h @@ -0,0 +1,7 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Project version number for Box. +extern double BoxVersionNumber; + +/// Project version string for Box. +extern const unsigned char BoxVersionString[]; diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.swift b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.swift new file mode 100644 index 0000000..491e68e --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Box.swift @@ -0,0 +1,33 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Wraps a type `T` in a reference type. +/// +/// Typically this is used to work around limitations of value types (for example, the lack of codegen for recursive value types and type-parameterized enums with >1 case). It is also useful for sharing a single (presumably large) value without copying it. +public final class Box: BoxType, Printable { + /// Initializes a `Box` with the given value. + public init(_ value: T) { + self.value = value + } + + + /// Constructs a `Box` with the given `value`. + public class func unit(value: T) -> Box { + return Box(value) + } + + + /// The (immutable) value wrapped by the receiver. + public let value: T + + /// Constructs a new Box by transforming `value` by `f`. + public func map(@noescape f: T -> U) -> Box { + return Box(f(value)) + } + + + // MARK: Printable + + public var description: String { + return toString(value) + } +} diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/BoxType.swift b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/BoxType.swift new file mode 100644 index 0000000..78a08d0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/BoxType.swift @@ -0,0 +1,46 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +// MARK: BoxType + +/// The type conformed to by all boxes. +public protocol BoxType { + /// The type of the wrapped value. + typealias Value + + /// Initializes an intance of the type with a value. + init(_ value: Value) + + /// The wrapped value. + var value: Value { get } +} + +/// The type conformed to by mutable boxes. +public protocol MutableBoxType: BoxType { + /// The (mutable) wrapped value. + var value: Value { get set } +} + + +// MARK: Equality + +/// Equality of `BoxType`s of `Equatable` types. +/// +/// We cannot declare that e.g. `Box` conforms to `Equatable`, so this is a relatively ad hoc definition. +public func == (lhs: B, rhs: B) -> Bool { + return lhs.value == rhs.value +} + +/// Inequality of `BoxType`s of `Equatable` types. +/// +/// We cannot declare that e.g. `Box` conforms to `Equatable`, so this is a relatively ad hoc definition. +public func != (lhs: B, rhs: B) -> Bool { + return lhs.value != rhs.value +} + + +// MARK: Map + +/// Maps the value of a box into a new box. +public func map(v: B, @noescape f: B.Value -> C.Value) -> C { + return C(f(v.value)) +} diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Info.plist b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Info.plist new file mode 100644 index 0000000..b35c271 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.2.1 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2014 Rob Rix. All rights reserved. + NSPrincipalClass + + + diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/MutableBox.swift b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/MutableBox.swift new file mode 100644 index 0000000..07f266e --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/Box/MutableBox.swift @@ -0,0 +1,27 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +/// Wraps a type `T` in a mutable reference type. +/// +/// While this, like `Box` could be used to work around limitations of value types, it is much more useful for sharing a single mutable value such that mutations are shared. +/// +/// As with all mutable state, this should be used carefully, for example as an optimization, rather than a default design choice. Most of the time, `Box` will suffice where any `BoxType` is needed. +public final class MutableBox: MutableBoxType, Printable { + /// Initializes a `MutableBox` with the given value. + public init(_ value: T) { + self.value = value + } + + /// The (mutable) value wrapped by the receiver. + public var value: T + + /// Constructs a new MutableBox by transforming `value` by `f`. + public func map(@noescape f: T -> U) -> MutableBox { + return MutableBox(f(value)) + } + + // MARK: Printable + + public var description: String { + return toString(value) + } +} diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTests.swift b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTests.swift new file mode 100644 index 0000000..796190c --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTests.swift @@ -0,0 +1,11 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +import Box +import XCTest + +class BoxTests: XCTestCase { + func testBox() { + let box = Box(1) + XCTAssertEqual(box.value, 1) + } +} diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTypeTests.swift b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTypeTests.swift new file mode 100644 index 0000000..36f7594 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/BoxTypeTests.swift @@ -0,0 +1,24 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +import Box +import XCTest + +class BoxTypeTests: XCTestCase { + func testEquality() { + let (a, b, c) = (Box(1), Box(1), Box(2)) + XCTAssertTrue(a == b) + XCTAssertFalse(b == c) + } + + func testInequality() { + let (a, b, c) = (Box(1), Box(1), Box(2)) + XCTAssertFalse(a != b) + XCTAssertTrue(b != c) + } + + func testMap() { + let a = Box(1) + let b: Box = map(a, toString) + XCTAssertEqual(b.value, "1") + } +} diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/Info.plist b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/Info.plist new file mode 100644 index 0000000..358bdf0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/MutableBoxTests.swift b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/MutableBoxTests.swift new file mode 100644 index 0000000..c3c1150 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/BoxTests/MutableBoxTests.swift @@ -0,0 +1,17 @@ +// Copyright (c) 2014 Rob Rix. All rights reserved. + +import Box +import XCTest + +class MutableBoxTests: XCTestCase { + func testBox() { + let box = MutableBox(1) + XCTAssertEqual(box.value, 1) + } + + func testMutation() { + let box = MutableBox(1) + box.value = 2 + XCTAssertEqual(box.value, 2) + } +} diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/LICENSE b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/LICENSE new file mode 100644 index 0000000..3026ee1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +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. \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/README.md b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/README.md new file mode 100644 index 0000000..b9948a0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Carthage/Checkouts/Box/README.md @@ -0,0 +1,58 @@ +# Box + +This is a Swift microframework which implements `Box` & `MutableBox`, with implementations of `==`/`!=` where `T`: `Equatable`. + +`Box` is typically used to work around limitations of value types: + +- recursive `struct`s/`enum`s +- type-parameterized `enum`s where more than one `case` has a value + +## Use + +Wrapping & unwrapping a `Box`: + +```swift +// Wrap: +let box = Box(1) + +// Unwrap: +let value = box.value +``` + +Changing the value of a `MutableBox`: + +```swift +// Mutation: +let mutableBox = MutableBox(1) +mutableBox.value = 2 +``` + +Building a recursive value type: + +```swift +struct BinaryTree { + let value: Int + let left: Box? + let right: Box? +} +``` + +Building a parameterized `enum`: + +```swift +enum Result { + case Success(Box) + case Failure(NSError) +} +``` + +See the sources for more details. + +## Integration + +1. Add this repo as a submodule in e.g. `External/Box`: + + git submodule add https://github.com/robrix/Box.git External/Box +2. Drag `Box.xcodeproj` into your `.xcworkspace`/`.xcodeproj`. +3. Add `Box.framework` to your target’s `Link Binary With Libraries` build phase. +4. You may also want to add a `Copy Files` phase which copies `Box.framework` (and any other framework dependencies you need) into your bundle’s `Frameworks` directory. If your target is a framework, you may instead want the client app to include `Box.framework`. diff --git a/DemoApp/Carthage/Checkouts/Result/LICENSE b/DemoApp/Carthage/Checkouts/Result/LICENSE new file mode 100644 index 0000000..3026ee1 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +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. \ No newline at end of file diff --git a/DemoApp/Carthage/Checkouts/Result/README.md b/DemoApp/Carthage/Checkouts/Result/README.md new file mode 100644 index 0000000..cf4402d --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/README.md @@ -0,0 +1,21 @@ +# Result + +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![CocoaPods](https://img.shields.io/cocoapods/v/Result.svg)](https://cocoapods.org/) + +This is a Swift µframework providing `Result`. + +`Result` values are either successful (wrapping `Value`) or failed (wrapping `Error`). This is similar to Swift’s native `Optional` type, with the addition of an error value to pass some error code, message, or object along to be logged or displayed to the user. + + +## Use + +[API documentation](http://cocoadocs.org/docsets/Result/) is in the source. + + +## Integration + +1. Add this repository as a submodule and check out its dependencies, and/or [add it to your Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) if you’re using [carthage](https://github.com/Carthage/Carthage/) to manage your dependencies. +2. Drag `Result.xcodeproj` and `Box.xcodeproj` into your project or workspace. NB: `Result.xcworkspace` is for standalone development of Result, while `Result.xcodeproj` is for targets using Result as a dependency. +3. Link your target against `Result.framework` and `Box.framework`. +4. Application targets should ensure that the framework gets copied into their application bundle. (Framework targets should instead require the application linking them to include Result and Box.) diff --git a/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/project.pbxproj b/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ec6d774 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/project.pbxproj @@ -0,0 +1,656 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + BE740B561AEB28AB004B478F /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE740B551AEB28AB004B478F /* Box.framework */; }; + BE740B571AEB29F7004B478F /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE740B551AEB28AB004B478F /* Box.framework */; }; + D454805D1A9572F5009D7229 /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D45480681A9572F5009D7229 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D45480571A9572F5009D7229 /* Result.framework */; }; + D454806F1A9572F5009D7229 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; + D45480881A957362009D7229 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D454807D1A957361009D7229 /* Result.framework */; }; + D45480971A957465009D7229 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; + D45480981A957465009D7229 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; + D45480991A9574B8009D7229 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; + D454809A1A9574BB009D7229 /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + D45480691A9572F5009D7229 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D454804E1A9572F5009D7229 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D45480561A9572F5009D7229; + remoteInfo = Result; + }; + D45480891A957362009D7229 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D454804E1A9572F5009D7229 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D454807C1A957361009D7229; + remoteInfo = "Result-iOS"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + BE740B551AEB28AB004B478F /* Box.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Box.framework; path = "../Carthage/Checkouts/Box/build/Debug-iphoneos/Box.framework"; sourceTree = ""; }; + D45480571A9572F5009D7229 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D454805B1A9572F5009D7229 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D454805C1A9572F5009D7229 /* Result.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Result.h; sourceTree = ""; }; + D45480671A9572F5009D7229 /* Result-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D454806D1A9572F5009D7229 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D454806E1A9572F5009D7229 /* ResultTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultTests.swift; sourceTree = ""; }; + D454807D1A957361009D7229 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D45480871A957362009D7229 /* Result-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D45480961A957465009D7229 /* Result.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D45480531A9572F5009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BE740B571AEB29F7004B478F /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480641A9572F5009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480681A9572F5009D7229 /* Result.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480791A957361009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BE740B561AEB28AB004B478F /* Box.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480841A957362009D7229 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480881A957362009D7229 /* Result.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D454804D1A9572F5009D7229 = { + isa = PBXGroup; + children = ( + D45480591A9572F5009D7229 /* Result */, + D454806B1A9572F5009D7229 /* ResultTests */, + D45480581A9572F5009D7229 /* Products */, + ); + sourceTree = ""; + usesTabs = 1; + }; + D45480581A9572F5009D7229 /* Products */ = { + isa = PBXGroup; + children = ( + D45480571A9572F5009D7229 /* Result.framework */, + D45480671A9572F5009D7229 /* Result-MacTests.xctest */, + D454807D1A957361009D7229 /* Result.framework */, + D45480871A957362009D7229 /* Result-iOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + D45480591A9572F5009D7229 /* Result */ = { + isa = PBXGroup; + children = ( + D454805C1A9572F5009D7229 /* Result.h */, + D45480961A957465009D7229 /* Result.swift */, + D454805A1A9572F5009D7229 /* Supporting Files */, + ); + path = Result; + sourceTree = ""; + }; + D454805A1A9572F5009D7229 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + BE740B551AEB28AB004B478F /* Box.framework */, + D454805B1A9572F5009D7229 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + D454806B1A9572F5009D7229 /* ResultTests */ = { + isa = PBXGroup; + children = ( + D454806E1A9572F5009D7229 /* ResultTests.swift */, + D454806C1A9572F5009D7229 /* Supporting Files */, + ); + path = ResultTests; + sourceTree = ""; + }; + D454806C1A9572F5009D7229 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D454806D1A9572F5009D7229 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D45480541A9572F5009D7229 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D454805D1A9572F5009D7229 /* Result.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D454807A1A957361009D7229 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D454809A1A9574BB009D7229 /* Result.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D45480561A9572F5009D7229 /* Result-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480721A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-Mac" */; + buildPhases = ( + D45480521A9572F5009D7229 /* Sources */, + D45480531A9572F5009D7229 /* Frameworks */, + D45480541A9572F5009D7229 /* Headers */, + D45480551A9572F5009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Result-Mac"; + productName = Result; + productReference = D45480571A9572F5009D7229 /* Result.framework */; + productType = "com.apple.product-type.framework"; + }; + D45480661A9572F5009D7229 /* Result-MacTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480751A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-MacTests" */; + buildPhases = ( + D45480631A9572F5009D7229 /* Sources */, + D45480641A9572F5009D7229 /* Frameworks */, + D45480651A9572F5009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D454806A1A9572F5009D7229 /* PBXTargetDependency */, + ); + name = "Result-MacTests"; + productName = ResultTests; + productReference = D45480671A9572F5009D7229 /* Result-MacTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + D454807C1A957361009D7229 /* Result-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480941A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOS" */; + buildPhases = ( + D45480781A957361009D7229 /* Sources */, + D45480791A957361009D7229 /* Frameworks */, + D454807A1A957361009D7229 /* Headers */, + D454807B1A957361009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Result-iOS"; + productName = "Result-iOS"; + productReference = D454807D1A957361009D7229 /* Result.framework */; + productType = "com.apple.product-type.framework"; + }; + D45480861A957362009D7229 /* Result-iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D45480951A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOSTests" */; + buildPhases = ( + D45480831A957362009D7229 /* Sources */, + D45480841A957362009D7229 /* Frameworks */, + D45480851A957362009D7229 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D454808A1A957362009D7229 /* PBXTargetDependency */, + ); + name = "Result-iOSTests"; + productName = "Result-iOSTests"; + productReference = D45480871A957362009D7229 /* Result-iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D454804E1A9572F5009D7229 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0630; + ORGANIZATIONNAME = "Rob Rix"; + TargetAttributes = { + D45480561A9572F5009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + D45480661A9572F5009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + D454807C1A957361009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + D45480861A957362009D7229 = { + CreatedOnToolsVersion = 6.3; + }; + }; + }; + buildConfigurationList = D45480511A9572F5009D7229 /* Build configuration list for PBXProject "Result" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = D454804D1A9572F5009D7229; + productRefGroup = D45480581A9572F5009D7229 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D45480561A9572F5009D7229 /* Result-Mac */, + D45480661A9572F5009D7229 /* Result-MacTests */, + D454807C1A957361009D7229 /* Result-iOS */, + D45480861A957362009D7229 /* Result-iOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D45480551A9572F5009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480651A9572F5009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D454807B1A957361009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480851A957362009D7229 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D45480521A9572F5009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480971A957465009D7229 /* Result.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480631A9572F5009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D454806F1A9572F5009D7229 /* ResultTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480781A957361009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480981A957465009D7229 /* Result.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D45480831A957362009D7229 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D45480991A9574B8009D7229 /* ResultTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + D454806A1A9572F5009D7229 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D45480561A9572F5009D7229 /* Result-Mac */; + targetProxy = D45480691A9572F5009D7229 /* PBXContainerItemProxy */; + }; + D454808A1A957362009D7229 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D454807C1A957361009D7229 /* Result-iOS */; + targetProxy = D45480891A957362009D7229 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + D45480701A9572F5009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; + 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; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D45480711A9572F5009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; + 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; + COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + 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 = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + D45480731A9572F5009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VALID_ARCHS = x86_64; + }; + name = Debug; + }; + D45480741A9572F5009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SKIP_INSTALL = YES; + VALID_ARCHS = x86_64; + }; + name = Release; + }; + D45480761A9572F5009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D45480771A9572F5009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + D45480901A957362009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D45480911A957362009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Result/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = Result; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D45480921A957362009D7229 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + D45480931A957362009D7229 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = ResultTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D45480511A9572F5009D7229 /* Build configuration list for PBXProject "Result" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480701A9572F5009D7229 /* Debug */, + D45480711A9572F5009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480721A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480731A9572F5009D7229 /* Debug */, + D45480741A9572F5009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480751A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-MacTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480761A9572F5009D7229 /* Debug */, + D45480771A9572F5009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480941A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480901A957362009D7229 /* Debug */, + D45480911A957362009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D45480951A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D45480921A957362009D7229 /* Debug */, + D45480931A957362009D7229 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D454804E1A9572F5009D7229 /* Project object */; +} diff --git a/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-Mac.xcscheme b/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-Mac.xcscheme new file mode 100644 index 0000000..b5e5ab2 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-Mac.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-iOS.xcscheme b/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-iOS.xcscheme new file mode 100644 index 0000000..8ff1a0f --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Result.xcodeproj/xcshareddata/xcschemes/Result-iOS.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApp/Carthage/Checkouts/Result/Result/Info.plist b/DemoApp/Carthage/Checkouts/Result/Result/Info.plist new file mode 100644 index 0000000..0c9a82d --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Result/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.1 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2015 Rob Rix. All rights reserved. + NSPrincipalClass + + + diff --git a/DemoApp/Carthage/Checkouts/Result/Result/Result.h b/DemoApp/Carthage/Checkouts/Result/Result/Result.h new file mode 100644 index 0000000..4742701 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Result/Result.h @@ -0,0 +1,8 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// Project version number for Result. +extern double ResultVersionNumber; + +/// Project version string for Result. +extern const unsigned char ResultVersionString[]; + diff --git a/DemoApp/Carthage/Checkouts/Result/Result/Result.swift b/DemoApp/Carthage/Checkouts/Result/Result/Result.swift new file mode 100644 index 0000000..1aeb1d8 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/Result/Result.swift @@ -0,0 +1,201 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// An enum representing either a failure with an explanatory error, or a success with a result value. +public enum Result: Printable, DebugPrintable { + case Success(Box) + case Failure(Box) + + // MARK: Constructors + + /// Constructs a success wrapping a `value`. + public init(value: T) { + self = .Success(Box(value)) + } + + /// Constructs a failure wrapping an `error`. + public init(error: Error) { + self = .Failure(Box(error)) + } + + /// Constructs a result from an Optional, failing with `Error` if `nil` + public init(_ value: T?, @autoclosure failWith: () -> Error) { + self = value.map { .success($0) } ?? .failure(failWith()) + } + + /// Constructs a success wrapping a `value`. + public static func success(value: T) -> Result { + return Result(value: value) + } + + /// Constructs a failure wrapping an `error`. + public static func failure(error: Error) -> Result { + return Result(error: error) + } + + + // MARK: Deconstruction + + /// Returns the value from `Success` Results, `nil` otherwise. + public var value: T? { + return analysis(ifSuccess: { $0 }, ifFailure: { _ in nil }) + } + + /// Returns the error from `Failure` Results, `nil` otherwise. + public var error: Error? { + return analysis(ifSuccess: { _ in nil }, ifFailure: { $0 }) + } + + /// Case analysis for Result. + /// + /// Returns the value produced by applying `ifFailure` to `Failure` Results, or `ifSuccess` to `Success` Results. + public func analysis(@noescape #ifSuccess: T -> Result, @noescape ifFailure: Error -> Result) -> Result { + switch self { + case let .Success(value): + return ifSuccess(value.value) + case let .Failure(value): + return ifFailure(value.value) + } + } + + + // MARK: Higher-order functions + + /// Returns a new Result by mapping `Success`es’ values using `transform`, or re-wrapping `Failure`s’ errors. + public func map(@noescape transform: T -> U) -> Result { + return flatMap { .success(transform($0)) } + } + + /// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. + public func flatMap(@noescape transform: T -> Result) -> Result { + return analysis( + ifSuccess: transform, + ifFailure: Result.failure) + } + + /// Returns `self.value` if this result is a .Success, or the given value otherwise. Equivalent with `??` + public func recover(@autoclosure value: () -> T) -> T { + return self.value ?? value() + } + + /// Returns this result if it is a .Success, or the given result otherwise. Equivalent with `??` + public func recoverWith(@autoclosure result: () -> Result) -> Result { + return analysis( + ifSuccess: { _ in self }, + ifFailure: { _ in result() }) + } + + + // MARK: Errors + + /// The domain for errors constructed by Result. + public static var errorDomain: String { return "com.antitypical.Result" } + + /// The userInfo key for source functions in errors constructed by Result. + public static var functionKey: String { return "\(errorDomain).function" } + + /// The userInfo key for source file paths in errors constructed by Result. + public static var fileKey: String { return "\(errorDomain).file" } + + /// The userInfo key for source file line numbers in errors constructed by Result. + public static var lineKey: String { return "\(errorDomain).line" } + + /// Constructs an error. + public static func error(function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__) -> NSError { + return NSError(domain: "com.antitypical.Result", code: 0, userInfo: [ + functionKey: function, + fileKey: file, + lineKey: line, + ]) + } + + + // MARK: Printable + + public var description: String { + return analysis( + ifSuccess: { ".Success(\($0))" }, + ifFailure: { ".Failure(\($0))" }) + } + + + // MARK: DebugPrintable + + public var debugDescription: String { + return description + } +} + + +/// Returns `true` if `left` and `right` are both `Success`es and their values are equal, or if `left` and `right` are both `Failure`s and their errors are equal. +public func == (left: Result, right: Result) -> Bool { + if let left = left.value, right = right.value { + return left == right + } else if let left = left.error, right = right.error { + return left == right + } + return false +} + +/// Returns `true` if `left` and `right` represent different cases, or if they represent the same case but different values. +public func != (left: Result, right: Result) -> Bool { + return !(left == right) +} + + +/// Returns the value of `left` if it is a `Success`, or `right` otherwise. Short-circuits. +public func ?? (left: Result, @autoclosure right: () -> T) -> T { + return left.recover(right()) +} + +/// Returns `left` if it is a `Success`es, or `right` otherwise. Short-circuits. +public func ?? (left: Result, @autoclosure right: () -> Result) -> Result { + return left.recoverWith(right()) +} + + +// MARK: - Cocoa API conveniences + +/// Constructs a Result with the result of calling `try` with an error pointer. +/// +/// This is convenient for wrapping Cocoa API which returns an object or `nil` + an error, by reference. e.g.: +/// +/// Result.try { NSData(contentsOfURL: URL, options: .DataReadingMapped, error: $0) } +public func try(function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__, try: NSErrorPointer -> T?) -> Result { + var error: NSError? + return try(&error).map(Result.success) ?? Result.failure(error ?? Result.error(function: function, file: file, line: line)) +} + +/// Constructs a Result with the result of calling `try` with an error pointer. +/// +/// This is convenient for wrapping Cocoa API which returns a `Bool` + an error, by reference. e.g.: +/// +/// Result.try { NSFileManager.defaultManager().removeItemAtURL(URL, error: $0) } +public func try(function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__, try: NSErrorPointer -> Bool) -> Result<(), NSError> { + var error: NSError? + return try(&error) ? + .success(()) + : .failure(error ?? Result<(), NSError>.error(function: function, file: file, line: line)) +} + + +// MARK: - Operators + +infix operator >>- { + // Left-associativity so that chaining works like you’d expect, and for consistency with Haskell, Runes, swiftz, etc. + associativity left + + // Higher precedence than function application, but lower than function composition. + precedence 150 +} + + +/// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. +/// +/// This is a synonym for `flatMap`. +public func >>- (result: Result, @noescape transform: T -> Result) -> Result { + return result.flatMap(transform) +} + + +import Box +import Foundation diff --git a/DemoApp/Carthage/Checkouts/Result/ResultTests/Info.plist b/DemoApp/Carthage/Checkouts/Result/ResultTests/Info.plist new file mode 100644 index 0000000..358bdf0 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/ResultTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.antitypical.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApp/Carthage/Checkouts/Result/ResultTests/ResultTests.swift b/DemoApp/Carthage/Checkouts/Result/ResultTests/ResultTests.swift new file mode 100644 index 0000000..d0cd7c3 --- /dev/null +++ b/DemoApp/Carthage/Checkouts/Result/ResultTests/ResultTests.swift @@ -0,0 +1,101 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +final class ResultTests: XCTestCase { + func testMapTransformsSuccesses() { + XCTAssertEqual(success.map(count) ?? 0, 7) + } + + func testMapRewrapsFailures() { + XCTAssertEqual(failure.map(count) ?? 0, 0) + } + + func testInitOptionalSuccess() { + XCTAssert(Result("success" as String?, failWith: error) == success) + } + + func testInitOptionalFailure() { + XCTAssert(Result(nil, failWith: error) == failure) + } + + + // MARK: Errors + + func testErrorsIncludeTheSourceFile() { + let file = __FILE__ + XCTAssertEqual(Result<(), NSError>.error().file ?? "", file) + } + + func testErrorsIncludeTheSourceLine() { + let (line, error) = (__LINE__, Result<(), NSError>.error()) + XCTAssertEqual(error.line ?? -1, line) + } + + func testErrorsIncludeTheCallingFunction() { + let function = __FUNCTION__ + XCTAssertEqual(Result<(), NSError>.error().function ?? "", function) + } + + + // MARK: Cocoa API idioms + + func testTryProducesFailuresForBooleanAPIWithErrorReturnedByReference() { + let result = try { attempt(true, succeed: false, error: $0) } + XCTAssertFalse(result ?? false) + XCTAssertNotNil(result.error) + } + + func testTryProducesFailuresForOptionalWithErrorReturnedByReference() { + let result = try { attempt(1, succeed: false, error: $0) } + XCTAssertEqual(result ?? 0, 0) + XCTAssertNotNil(result.error) + } + + func testTryProducesSuccessesForBooleanAPI() { + let result = try { attempt(true, succeed: true, error: $0) } + XCTAssertTrue(result ?? false) + XCTAssertNil(result.error) + } + + func testTryProducesSuccessesForOptionalAPI() { + let result = try { attempt(1, succeed: true, error: $0) } + XCTAssertEqual(result ?? 0, 1) + XCTAssertNil(result.error) + } +} + + +// MARK: - Fixtures + +let success = Result.success("success") +let error = NSError(domain: "com.antitypical.Result", code: 0xdeadbeef, userInfo: nil) +let failure = Result.failure(error) + + +// MARK: - Helpers + +func attempt(value: T, #succeed: Bool, #error: NSErrorPointer) -> T? { + if succeed { + return value + } else { + error.memory = Result<(), NSError>.error() + return nil + } +} + +extension NSError { + var function: String? { + return userInfo?[Result<(), NSError>.functionKey as NSString] as? String + } + + var file: String? { + return userInfo?[Result<(), NSError>.fileKey as NSString] as? String + } + + var line: Int? { + return userInfo?[Result<(), NSError>.lineKey as NSString] as? Int + } +} + + +import Result +import XCTest diff --git a/DemoApp/DemoApp.xcodeproj/project.pbxproj b/DemoApp/DemoApp.xcodeproj/project.pbxproj index d72f684..7e87a82 100644 --- a/DemoApp/DemoApp.xcodeproj/project.pbxproj +++ b/DemoApp/DemoApp.xcodeproj/project.pbxproj @@ -13,6 +13,13 @@ 8C521B6C1B20878F0039B9CB /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8C521B6B1B20878F0039B9CB /* Images.xcassets */; }; 8C521B6F1B20878F0039B9CB /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8C521B6D1B20878F0039B9CB /* LaunchScreen.xib */; }; 8C521B7B1B20878F0039B9CB /* DemoAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C521B7A1B20878F0039B9CB /* DemoAppTests.swift */; }; + 8CD344EF1B208BDB005E52C7 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD344EA1B208BDB005E52C7 /* Alamofire.framework */; }; + 8CD344F01B208BDB005E52C7 /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD344EB1B208BDB005E52C7 /* Box.framework */; }; + 8CD344F11B208BDB005E52C7 /* Future.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD344EC1B208BDB005E52C7 /* Future.framework */; }; + 8CD344F21B208BDB005E52C7 /* Himotoki.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD344ED1B208BDB005E52C7 /* Himotoki.framework */; }; + 8CD344F31B208BDB005E52C7 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD344EE1B208BDB005E52C7 /* Result.framework */; }; + 8CD344F61B208C86005E52C7 /* Api.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CD344F51B208C86005E52C7 /* Api.swift */; }; + 8CD344F81B208CEC005E52C7 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CD344F71B208CEC005E52C7 /* Model.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -36,6 +43,13 @@ 8C521B741B20878F0039B9CB /* DemoAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8C521B791B20878F0039B9CB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8C521B7A1B20878F0039B9CB /* DemoAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoAppTests.swift; sourceTree = ""; }; + 8CD344EA1B208BDB005E52C7 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = ""; }; + 8CD344EB1B208BDB005E52C7 /* Box.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Box.framework; path = Carthage/Build/iOS/Box.framework; sourceTree = ""; }; + 8CD344EC1B208BDB005E52C7 /* Future.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Future.framework; path = Carthage/Build/iOS/Future.framework; sourceTree = ""; }; + 8CD344ED1B208BDB005E52C7 /* Himotoki.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Himotoki.framework; path = Carthage/Build/iOS/Himotoki.framework; sourceTree = ""; }; + 8CD344EE1B208BDB005E52C7 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/iOS/Result.framework; sourceTree = ""; }; + 8CD344F51B208C86005E52C7 /* Api.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Api.swift; sourceTree = ""; }; + 8CD344F71B208CEC005E52C7 /* Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -43,6 +57,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8CD344EF1B208BDB005E52C7 /* Alamofire.framework in Frameworks */, + 8CD344F01B208BDB005E52C7 /* Box.framework in Frameworks */, + 8CD344F11B208BDB005E52C7 /* Future.framework in Frameworks */, + 8CD344F21B208BDB005E52C7 /* Himotoki.framework in Frameworks */, + 8CD344F31B208BDB005E52C7 /* Result.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -60,6 +79,11 @@ isa = PBXGroup; children = ( 8C521B611B20878F0039B9CB /* DemoApp */, + 8CD344EA1B208BDB005E52C7 /* Alamofire.framework */, + 8CD344EB1B208BDB005E52C7 /* Box.framework */, + 8CD344EC1B208BDB005E52C7 /* Future.framework */, + 8CD344ED1B208BDB005E52C7 /* Himotoki.framework */, + 8CD344EE1B208BDB005E52C7 /* Result.framework */, 8C521B771B20878F0039B9CB /* DemoAppTests */, 8C521B601B20878F0039B9CB /* Products */, ); @@ -79,6 +103,8 @@ children = ( 8C521B641B20878F0039B9CB /* AppDelegate.swift */, 8C521B661B20878F0039B9CB /* ViewController.swift */, + 8CD344F51B208C86005E52C7 /* Api.swift */, + 8CD344F71B208CEC005E52C7 /* Model.swift */, 8C521B681B20878F0039B9CB /* Main.storyboard */, 8C521B6B1B20878F0039B9CB /* Images.xcassets */, 8C521B6D1B20878F0039B9CB /* LaunchScreen.xib */, @@ -122,6 +148,7 @@ 8C521B5B1B20878F0039B9CB /* Sources */, 8C521B5C1B20878F0039B9CB /* Frameworks */, 8C521B5D1B20878F0039B9CB /* Resources */, + 8CD344F41B208BEC005E52C7 /* ShellScript */, ); buildRules = ( ); @@ -207,13 +234,36 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 8CD344F41B208BEC005E52C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/iOS/Box.framework", + "$(SRCROOT)/Carthage/Build/iOS/Result.framework", + "$(SRCROOT)/Carthage/Build/iOS/Future.framework", + "$(SRCROOT)/Carthage/Build/iOS/Himotoki.framework", + "$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 8C521B5B1B20878F0039B9CB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8CD344F61B208C86005E52C7 /* Api.swift in Sources */, 8C521B671B20878F0039B9CB /* ViewController.swift in Sources */, 8C521B651B20878F0039B9CB /* AppDelegate.swift in Sources */, + 8CD344F81B208CEC005E52C7 /* Model.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -340,6 +390,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); INFOPLIST_FILE = DemoApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -350,6 +404,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); INFOPLIST_FILE = DemoApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -409,6 +467,7 @@ 8C521B801B20878F0039B9CB /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 8C521B811B20878F0039B9CB /* Build configuration list for PBXNativeTarget "DemoAppTests" */ = { isa = XCConfigurationList; @@ -417,6 +476,7 @@ 8C521B831B20878F0039B9CB /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/DemoApp/DemoApp/Api.swift b/DemoApp/DemoApp/Api.swift new file mode 100644 index 0000000..6f3b497 --- /dev/null +++ b/DemoApp/DemoApp/Api.swift @@ -0,0 +1,52 @@ +// +// Api.swift +// DemoApp +// +// Created by Le VanNghia on 6/4/15. +// Copyright (c) 2015 Le Van Nghia. All rights reserved. +// + +import Foundation +import Alamofire +import Result +import Future +import Himotoki + +func requestUser(username: String) -> Future { + return Future { completion in + let urlString = "https://api.github.com/users/\(username)" + + Alamofire.request(.GET, urlString) + .responseJSON { _, _, json, error in + let result: Result + if let error = error { + result = Result(error: error) + } else { + let u: User? = decode(json!) + result = Result(value: u!) + } + + completion(result) + } + } +} + +func searchRepositories(keyword: String) -> Future<[Repository], NSError> { + return Future { completion in + let urlString = "https://api.github.com/search/repositories?q=\(keyword)+language:swift&sort=stars&order=desc" + + Alamofire.request(.GET, urlString) + .responseJSON { _, _, json, error in + let itemsJson: AnyObject? = (json as! [String: AnyObject])["items"] + let repos: [Repository]? = decode(itemsJson!) + let result: Result<[Repository], NSError> + + if let error = error { + result = Result(error: error) + } else { + result = Result(value: repos ?? []) + } + completion(result) + } + } +} \ No newline at end of file diff --git a/DemoApp/DemoApp/AppDelegate.swift b/DemoApp/DemoApp/AppDelegate.swift index d309e1d..e437287 100644 --- a/DemoApp/DemoApp/AppDelegate.swift +++ b/DemoApp/DemoApp/AppDelegate.swift @@ -10,37 +10,10 @@ 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 } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - } diff --git a/DemoApp/DemoApp/Model.swift b/DemoApp/DemoApp/Model.swift new file mode 100644 index 0000000..962555a --- /dev/null +++ b/DemoApp/DemoApp/Model.swift @@ -0,0 +1,57 @@ +// +// Model.swift +// DemoApp +// +// Created by Le VanNghia on 6/4/15. +// Copyright (c) 2015 Le Van Nghia. All rights reserved. +// + +import Foundation +import Himotoki + +struct Repository: Decodable, Printable { + let id : Int64 + let name : String + let url : String + let ownerName : String + + static func decode(e: Extractor) -> Repository? { + let create = { Repository($0) } + + return build( + e <| "id", + e <| "name", + e <| "url", + e <| "owner.login" + ).map(create) + } + + var description: String { + return "id : \(id)\n" + + "name: \(name)\n" + + "url: \(url)\n" + + "ownerName: \(ownerName)" + } +} + +struct User: Decodable, Printable { + let id : Int64 + let login : String + let url : String + + static func decode(e: Extractor) -> User? { + let create = { User($0) } + + return build( + e <| "id", + e <| "login", + e <| "url" + ).map(create) + } + + var description: String { + return "id: \(id)\n" + + "login: \(login)\n" + + "url: \(url)\n" + } +} \ No newline at end of file diff --git a/DemoApp/DemoApp/ViewController.swift b/DemoApp/DemoApp/ViewController.swift index 8025c5d..ab32027 100644 --- a/DemoApp/DemoApp/ViewController.swift +++ b/DemoApp/DemoApp/ViewController.swift @@ -7,19 +7,16 @@ // import UIKit +import Result +import Future class ViewController: UIViewController { - override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. + + let f = searchRepositories("Hakuba") <^> { $0[0].ownerName } >>- requestUser + f.onSuccess { result in + println(result) + } } - - } -