Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Swift5 #64

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ docset-installed.txt
# Exclude cocoapods folder
Pods/
*.xcworkspace
Podfile.lock
Pods/

# Exclude the build directory
build/*
Expand Down
6 changes: 3 additions & 3 deletions FeedHenry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Pod::Spec.new do |s|
s.social_media_url = 'https://twitter.com/feedhenry'
s.license = 'FeedHenry'
s.author = 'Red Hat, Inc.'
s.source = { :git => 'https://github.com/feedhenry/fh-ios-swift-sdk.git', :tag => s.version }
s.source = { :git => 'https://github.com/feedhenry/fh-ios-swift-sdk.git', :branch => 'Swift5' }
s.platform = :ios, 9.0
s.source_files = 'FeedHenry/**/*.{swift}', 'FeedHenry/**/*.{h,m}', 'FeedHenry/*.{h,m}'
s.module_map = 'FeedHenry/FeedHenry.modulemap'
s.requires_arc = true
s.dependency 'AeroGearHttp', '2.0.0'
s.dependency 'AeroGearPush-Swift', '3.0.0'
s.dependency 'ReachabilitySwift', '4.1.0'
s.dependency 'AeroGearPush-Sw', '3.0.9'
s.dependency 'ReachabilitySwift', '4.3.1'
end
27 changes: 14 additions & 13 deletions FeedHenry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,12 @@
TargetAttributes = {
4878D5D91B579965004518C4 = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
4878D5E31B579965004518C4 = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
};
};
Expand All @@ -400,6 +400,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 4878D5D01B579965004518C4;
Expand Down Expand Up @@ -456,9 +457,9 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-FeedHenry-FeedHenryTests/Pods-FeedHenry-FeedHenryTests-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-FeedHenry-FeedHenryTests/Pods-FeedHenry-FeedHenryTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AeroGearHttp/AeroGearHttp.framework",
"${BUILT_PRODUCTS_DIR}/AeroGearPush-Swift/AeroGearPush.framework",
"${BUILT_PRODUCTS_DIR}/AeroGearPush-Sw/AeroGearPush.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework",
"${BUILT_PRODUCTS_DIR}/OHHTTPStubs/OHHTTPStubs.framework",
Expand All @@ -473,7 +474,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FeedHenry-FeedHenryTests/Pods-FeedHenry-FeedHenryTests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FeedHenry-FeedHenryTests/Pods-FeedHenry-FeedHenryTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
48F1A9EB1C98B3FC004E7B50 /* ShellScript */ = {
Expand Down Expand Up @@ -695,9 +696,9 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Sw.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -721,8 +722,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Sw.h";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -737,9 +738,9 @@
PRODUCT_BUNDLE_IDENTIFIER = com.feedhenry.FeedHenryTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FeedHenryTests/FeedHenryTests-Bridging-Header.h";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Sw.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -754,8 +755,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.feedhenry.FeedHenryTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FeedHenryTests/FeedHenryTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Sw.h";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion FeedHenry/Config/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ open class Config {
let propertiesFile: String
var bundle: Bundle
/// Singleton instance.
open static var instance = Config()
public static var instance = Config()

/**
Constructor.
Expand Down
6 changes: 3 additions & 3 deletions FeedHenry/FH.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ open class FH: NSObject {
- Returns: true if the device is online.
*/
@objc
open static var isOnline: Bool {
public static var isOnline: Bool {
guard let reachability = self.reachability else {return false}
return reachability.connection != .none
}
Expand All @@ -64,7 +64,7 @@ open class FH: NSObject {

- Returns: the NSError from FH.init method.
*/
open static var getInitError: NSError? {
public static var getInitError: NSError? {
return initError
}

Expand Down Expand Up @@ -342,7 +342,7 @@ open class FH: NSObject {
- parameter applicationState: to make sure the app was in background.
- parameter userInfo: contains the message id used to collect metrics.
*/
open class func sendMetricsWhenAppAwoken(applicationState: UIApplicationState, userInfo: [AnyHashable: Any]) {
open class func sendMetricsWhenAppAwoken(applicationState: UIApplication.State, userInfo: [AnyHashable: Any]) {
PushAnalytics.sendMetricsWhenAppAwoken(applicationState: applicationState, userInfo: userInfo)
}

Expand Down
9 changes: 6 additions & 3 deletions FeedHenry/FeedHenry-Sw.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 4.2.1 effective-4.1.50 (swiftlang-1000.11.42 clang-1000.11.45.1)
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"

Expand All @@ -20,7 +20,7 @@
#endif

#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
Expand Down Expand Up @@ -163,6 +163,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
@import ObjectiveC;
@import UIKit;
Expand Down Expand Up @@ -226,7 +229,7 @@ SWIFT_CLASS("_TtC9FeedHenry19OAuthViewController")
/// Override to deal with error.
- (void)webView:(UIWebView * _Nonnull)webView didFailLoadWithError:(NSError * _Nonnull)error;
/// Override to retrieve auth token and store it.
- (BOOL)webView:(UIWebView * _Nonnull)webView shouldStartLoadWithRequest:(NSURLRequest * _Nonnull)request navigationType:(UIWebViewNavigationType)navigationType SWIFT_WARN_UNUSED_RESULT;
- (BOOL)webView:(UIWebView * _Nonnull)webView shouldStartLoadWithRequest:(NSURLRequest * _Nonnull)request navigationType:(enum UIWebViewNavigationType)navigationType SWIFT_WARN_UNUSED_RESULT;
/// Override for logging purpose.
- (void)webViewDidStartLoad:(UIWebView * _Nonnull)webView;
/// Override to close the view on success.
Expand Down
2 changes: 1 addition & 1 deletion FeedHenry/OAuth/OAuthViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ open class OAuthViewController: UIViewController, UIWebViewDelegate {
}

/// Override to retrieve auth token and store it.
open func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
open func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebView.NavigationType) -> Bool {
print("Start to load url: \(String(describing: request.url))")
authInfo = [:]
do {
Expand Down
2 changes: 1 addition & 1 deletion FeedHenry/Sync/FHSyncClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <CommonCrypto/CommonDigest.h>

#import <FeedHenry/FeedHenry-Sw.h>
#import "../FeedHenry-Sw.h"
#import "FHSyncClient.h"
#import "FHSyncUtils.h"
#import "FHSyncPendingDataRecord.h"
Expand Down
2 changes: 1 addition & 1 deletion FeedHenry/Sync/FHSyncDataset.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#import "FHSyncDataRecord.h"
#import "FHDefines.h"
#import "FHSyncNotificationMessage.h"
#import <FeedHenry/FeedHenry-Sw.h>
#import "../FeedHenry-Sw.h"

static NSString *const kStorageFilePath = @"sync.json";

Expand Down
10 changes: 5 additions & 5 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use_frameworks!

target 'FeedHenry' do
pod 'AeroGearHttp', '2.0.0'
pod 'AeroGearPush-Swift', '3.0.0'
pod 'ReachabilitySwift', '4.1.0'
pod 'AeroGearPush-Sw', '3.0.9'
pod 'ReachabilitySwift', '4.3.1'

target 'FeedHenryTests' do
pod 'OHHTTPStubs', '5.2.2'
pod 'OHHTTPStubs/Swift', '5.2.2'
pod 'OCMock', '3.3.1'
pod 'OHHTTPStubs', '7.0.0'
pod 'OHHTTPStubs/Swift', '7.0.0'
pod 'OCMock', '3.4.3'
end
end
47 changes: 0 additions & 47 deletions Podfile.lock

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

The iOS Software Development Kit to connect to the [FeedHenry platform.](http://www.feedhenry.com)

> NOTE: This is an experimental branch to enable Swift 4.2 builds to work with the new build system. The Swift4.2 branch is not a supported configuration.

**The Swift version of FeedHenry SDK is a Work In Progress. If you want to use full feature SDK go to [fh-ios-sdk](https://github.com/feedhenry/fh-ios-sdk/).**

## Release Process
Expand Down