Skip to content

Commit

Permalink
Merge pull request #100 from corinnekrych/AGIOS-522.Swift2.3
Browse files Browse the repository at this point in the history
Agios 522.swift2.3
  • Loading branch information
corinnekrych committed Oct 14, 2016
2 parents 0ead252 + 0dee37a commit d42bec0
Show file tree
Hide file tree
Showing 42 changed files with 375 additions and 150 deletions.
12 changes: 11 additions & 1 deletion Authentication/Authentication.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = AeroGear;
TargetAttributes = {
4895F9FB1D80621600D42D49 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -247,8 +248,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -293,8 +296,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -313,6 +318,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand All @@ -322,23 +328,27 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 1BE596D2733ED629E287A03D /* Pods-Authentication.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Authentication/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = org.aerogear.Authentication;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
4895FA101D80621600D42D49 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C5E8D05404DFBF71B49E7C0B /* Pods-Authentication.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Authentication/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = org.aerogear.Authentication;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand Down
13 changes: 12 additions & 1 deletion Authentication/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ platform :ios, '8.0'
use_frameworks!

target 'Authentication' do
pod 'AeroGearHttp', :git => 'https://github.com/aerogear/aerogear-ios-http.git'
pod 'AeroGearHttp', '0.8.0'
end

# Workaround to fix swift version to 2.3 for Pods.
# it could be removed once CocoaPods 1.1.0 is released.
# https://github.com/CocoaPods/CocoaPods/issues/5521
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
6 changes: 3 additions & 3 deletions Authentication/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Authentication
=======
Level: Beginner
Technologies: Swift, iOS
Technologies: Swift 2.3, iOS
Summary: A basic example of performing http basic/digest authentication using aerogear-ios-http

What is it?
Expand All @@ -11,8 +11,8 @@ This project is a very simple app, to show how to perform an HTTP Basic/Digest a

System requirements
-------------------
- iOS8, iOS9
- Xcode7.3
- iOS8, iOS9, iOS10
- Xcode 8+

Configure
---------
Expand Down
2 changes: 1 addition & 1 deletion ChuckNorrisJokes/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ platform :ios, '8.0'
use_frameworks!

target 'ChuckNorrisJokes' do
pod 'AeroGearHttp', :git => 'https://github.com/aerogear/aerogear-ios-http.git'
pod 'AeroGearHttp', '0.8.0'
end

# Workaround to fix swift version to 2.3 for Pods.
Expand Down
4 changes: 2 additions & 2 deletions ChuckNorrisJokes/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ChuckNorrisJokes
================
Level: Beginner
Technologies: Swift, iOS
Technologies: Swift 2.3, iOS
Summary: A basic example of aerogear-ios-http

What is it?
Expand All @@ -12,7 +12,7 @@ This project is a very simple app, to show how to do a http call against a simpl
System requirements
-------------------
- iOS8, iOS9, iOS10
- Xcode7.3.1, Xcode8
- Xcode 8+

Build and Deploy ChuckNorrisJokes
---------------------------------
Expand Down
Binary file modified Howdy/AeroGearPush.framework/AeroGearPush
Binary file not shown.
67 changes: 37 additions & 30 deletions Howdy/AeroGearPush.framework/Headers/AeroGearPush-Swift.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 2.0 (swiftlang-700.0.52.2 clang-700.0.65)
// Generated by Apple Swift version 2.3 (swiftlang-800.10.12 clang-800.0.38)
#pragma clang diagnostic push

#if defined(__has_include) && __has_include(<swift/objc-prologue.h>)
Expand All @@ -11,15 +11,25 @@
#include <stddef.h>
#include <stdbool.h>

#if defined(__has_include) && __has_include(<uchar.h>)
# include <uchar.h>
#elif !defined(__cplusplus) || __cplusplus < 201103L
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if defined(__has_include) && __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus) || __cplusplus < 201103L
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
#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)
Expand Down Expand Up @@ -48,7 +58,7 @@ typedef struct _NSZone NSZone;
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
# 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
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
Expand All @@ -75,19 +85,15 @@ typedef struct _NSZone NSZone;
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type
# if defined(__has_feature) && __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name)
# endif
#endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
#if defined(__has_feature) && __has_feature(modules)
@import ObjectiveC;
@import Foundation.NSURLSession;
@import Foundation;
#endif

#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
Expand All @@ -100,28 +106,28 @@ SWIFT_PROTOCOL("_TtP12AeroGearPush25AGClientDeviceInformation_")
@protocol AGClientDeviceInformation

/// The Device Token which identifies the device within APNs.
@property (nonatomic) NSData * __nullable deviceToken;
@property (nonatomic, strong) NSData * _Nullable deviceToken;

/// The ID of the mobile Variant, for which this client will be registered.
@property (nonatomic, copy) NSString * __nullable variantID;
@property (nonatomic, copy) NSString * _Nullable variantID;

/// The mobile Variant's secret.
@property (nonatomic, copy) NSString * __nullable variantSecret;
@property (nonatomic, copy) NSString * _Nullable variantSecret;

/// Application specific alias to identify users with the system. E.g. email address or username
@property (nonatomic, copy) NSString * __nullable alias;
@property (nonatomic, copy) NSString * _Nullable alias;

/// Some categories, used for tagging the device (metadata)
@property (nonatomic, copy) NSArray<NSString *> * __nullable categories;
@property (nonatomic, copy) NSArray<NSString *> * _Nullable categories;

/// The name of the underlying OS (e.g. iOS)
@property (nonatomic, copy) NSString * __nullable operatingSystem;
@property (nonatomic, copy) NSString * _Nullable operatingSystem;

/// The version of the used OS (e.g. 6.1.3)
@property (nonatomic, copy) NSString * __nullable osVersion;
@property (nonatomic, copy) NSString * _Nullable osVersion;

/// The device type (e.g. iPhone or iPod)
@property (nonatomic, copy) NSString * __nullable deviceType;
@property (nonatomic, copy) NSString * _Nullable deviceType;
@end

@class NSURL;
Expand All @@ -134,25 +140,26 @@ SWIFT_PROTOCOL("_TtP12AeroGearPush25AGClientDeviceInformation_")

/// Utility to register an iOS device with the AeroGear UnifiedPush Server.
SWIFT_CLASS("_TtC12AeroGearPush20AGDeviceRegistration")
@interface AGDeviceRegistration : NSObject <NSURLSessionTaskDelegate, NSURLSessionDelegate>
@interface AGDeviceRegistration : NSObject <NSURLSessionTaskDelegate>

/// An initializer method to instantiate an AGDeviceRegistration object.
///
/// :param: serverURL the URL of the AeroGear Push server.
///
/// :returns: the AGDeviceRegistration object.
- (nonnull instancetype)initWithServerURL:(NSURL * __nonnull)serverURL OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)initWithServerURL:(NSURL * _Nonnull)serverURL OBJC_DESIGNATED_INITIALIZER;

/// An initializer method to instantiate an AGDeviceRegistration object with default app plist config file.
///
/// :param: config file name where to fetch AeroGear UnifiedPush server configuration.
/// :returns: the AGDeviceRegistration object.
- (nonnull instancetype)initWithConfig:(NSString * __nonnull)config;
- (nonnull instancetype)initWithConfig:(NSString * _Nonnull)config;

/// An initializer method to instantiate an AGDeviceRegistration object.
///
/// :returns: the AGDeviceRegistration object.
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (void)overridePushProperties:(NSDictionary<NSString *, NSString *> * _Nonnull)pushProperties;

/// Registers your mobile device to the AeroGear UnifiedPush server so it can start receiving messages. Registration information can be provided within clientInfo block or by providing a plist file containing the require registration information as below: <plist version="1.0"> <dict> <key>serverURL</key> <string>pushServerURL e.g http(s)//host:port/context</string> <key>variantID</key> <string>variantID e.g. 1234456-234320</string> <key>variantSecret</key> <string>variantSecret e.g. 1234456-234320</string> ... </dict> </plist>
///
Expand All @@ -166,7 +173,7 @@ SWIFT_CLASS("_TtC12AeroGearPush20AGDeviceRegistration")
/// This block has no return value and takes one argument: The <code>NSError
/// </code> object describing
/// the error that occurred during the registration process.
- (void)registerWithClientInfo:(void (^ __null_unspecified)(id <AGClientDeviceInformation> __nonnull))clientInfo success:(void (^ __null_unspecified)(void))success failure:(void (^ __null_unspecified)(NSError * __nonnull))failure;
- (void)registerWithClientInfo:(void (^ _Null_unspecified)(id <AGClientDeviceInformation> _Nonnull config))clientInfo success:(void (^ _Null_unspecified)(void))success failure:(void (^ _Null_unspecified)(NSError * _Nonnull))failure;

/// We need to cater for possible redirection NOTE: As per Apple doc, the passed req is 'the proposed redirected request'. But we cannot return it as it is. The reason is, user-agents (and in our case NSURLconnection) 'erroneous' after a 302-redirection modify the request's http method and sets it to GET if the client initially performed a POST (as we do here).
///
Expand All @@ -177,7 +184,7 @@ SWIFT_CLASS("_TtC12AeroGearPush20AGDeviceRegistration")
/// with the URL parameter updated to point to the new 'Location' header.
///
/// </code>
- (void)URLSession:(NSURLSession * __nonnull)session task:(NSURLSessionTask * __nonnull)task willPerformHTTPRedirection:(NSHTTPURLResponse * __nonnull)redirectResponse newRequest:(NSURLRequest * __nonnull)redirectReq completionHandler:(void (^ __nonnull)(NSURLRequest * __nullable))completionHandler;
- (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task willPerformHTTPRedirection:(NSHTTPURLResponse * _Nonnull)redirectResponse newRequest:(NSURLRequest * _Nonnull)redirectReq completionHandler:(void (^ _Nonnull)(NSURLRequest * _Nullable))completionHandler;
@end

#pragma clang diagnostic pop
Binary file modified Howdy/AeroGearPush.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit d42bec0

Please sign in to comment.