Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod update and migrate to swift 5 #5

Open
wants to merge 3 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
23 changes: 12 additions & 11 deletions CodeBase.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,18 @@
861D1FE31F6F45AB006DEFA0 = {
CreatedOnToolsVersion = 8.3.3;
DevelopmentTeam = UTAKMP8X5D;
LastSwiftMigration = 0900;
LastSwiftMigration = 1200;
ProvisioningStyle = Automatic;
};
861D1FF71F6F45AB006DEFA0 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1200;
ProvisioningStyle = Automatic;
TestTargetID = 861D1FE31F6F45AB006DEFA0;
};
861D20021F6F45AB006DEFA0 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1200;
ProvisioningStyle = Automatic;
TestTargetID = 861D1FE31F6F45AB006DEFA0;
};
Expand All @@ -422,6 +422,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -528,7 +529,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-CodeBase/Pods-CodeBase-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-CodeBase/Pods-CodeBase-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework",
"${BUILT_PRODUCTS_DIR}/Moya/Moya.framework",
Expand Down Expand Up @@ -559,7 +560,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodeBase/Pods-CodeBase-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CodeBase/Pods-CodeBase-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -751,7 +752,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.github.CodeBase;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -767,7 +768,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.github.CodeBase;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -782,7 +783,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.github.CodeBaseTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodeBase.app/CodeBase";
};
name = Debug;
Expand All @@ -798,7 +799,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.github.CodeBaseTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodeBase.app/CodeBase";
};
name = Release;
Expand All @@ -813,7 +814,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.github.CodeBaseUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = CodeBase;
};
name = Debug;
Expand All @@ -828,7 +829,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.github.CodeBaseUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = CodeBase;
};
name = Release;
Expand Down
12 changes: 6 additions & 6 deletions CodeBase/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

setupAppearance()
// Log config
Expand All @@ -35,14 +35,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
UINavigationBar.appearance().barTintColor = UIColor.navbar
UINavigationBar.appearance().tintColor = UIColor.white
UINavigationBar.appearance().titleTextAttributes = [
NSAttributedStringKey.foregroundColor : UIColor.white,
NSAttributedStringKey.font: UIFont.medium(size: 16)
NSAttributedString.Key.foregroundColor : UIColor.white,
NSAttributedString.Key.font: UIFont.medium(size: 16)
]

UIBarButtonItem.appearance().setTitleTextAttributes([
NSAttributedStringKey.foregroundColor : UIColor.white,
NSAttributedStringKey.font: UIFont.medium(size: 14)
], for: UIControlState())
NSAttributedString.Key.foregroundColor : UIColor.white,
NSAttributedString.Key.font: UIFont.medium(size: 14)
], for: UIControl.State())

}

Expand Down
4 changes: 2 additions & 2 deletions CodeBase/DefaultsKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
import SwiftyUserDefaults

extension DefaultsKeys {
static let authToken = DefaultsKey<String?>("authToken")
static let username = DefaultsKey<String>("username")
static let authToken = DefaultsKey<String?>.init("authToken")
static let username = DefaultsKey<String>.init("username", defaultValue: "")
}
4 changes: 2 additions & 2 deletions CodeBase/GithubAPIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ let moyaProvider = MoyaProvider<GithubAPIService>()

enum GithubAPIService {
case auth(username: String, password: String)
case getUsers()
case getUsers
case getUser(username: String)
case search(keyword: String, sortBy: String?, orderBy: String?)
case getRepositories()
case getRepositories
}


Expand Down
2 changes: 1 addition & 1 deletion CodeBase/RepoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RepoView: UIViewController {

// setup tableview
tableView.estimatedRowHeight = RepoListViewCell.rowHeight
tableView.rowHeight = UITableViewAutomaticDimension
tableView.rowHeight = UITableView.automaticDimension
tableView.backgroundColor = .clear
tableView.dataSource = self
tableView.delegate = self
Expand Down
2 changes: 1 addition & 1 deletion CodeBase/RepositoryService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ReposityService {

static func getData(callback:@escaping (Bool, [Repo]?, String?) -> Void) {
moyaProvider.rx
.request(GithubAPIService.getRepositories())
.request(GithubAPIService.getRepositories)
.subscribe { event in

switch event {
Expand Down
2 changes: 1 addition & 1 deletion CodeBase/UIColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension UIColor {
var int = UInt32()
Scanner(string: hex).scanHexInt32(&int)
let a, r, g, b: UInt32
switch hex.characters.count {
switch hex.count {
case 3: // RGB (12-bit)
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
case 6: // RGB (24-bit)
Expand Down
2 changes: 1 addition & 1 deletion CodeBase/UserService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UserService {

static func getUsers(callback:@escaping (Bool, [User]?, String?) -> Void) {
moyaProvider.rx
.request(GithubAPIService.getUsers())
.request(GithubAPIService.getUsers)
.subscribe { event in

switch event {
Expand Down
42 changes: 21 additions & 21 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- Alamofire (4.7.3)
- IQKeyboardManagerSwift (6.2.0)
- Alamofire (4.9.1)
- IQKeyboardManagerSwift (6.5.6)
- Moya/Core (11.0.2):
- Alamofire (~> 4.1)
- Result (~> 3.0)
Expand All @@ -10,16 +10,16 @@ PODS:
- ObjcExceptionBridging (1.0.1):
- ObjcExceptionBridging/ObjcExceptionBridging (= 1.0.1)
- ObjcExceptionBridging/ObjcExceptionBridging (1.0.1)
- ObjectMapper (3.3.0)
- ObjectMapper (3.5.3)
- Result (3.2.4)
- RxCocoa (4.3.1):
- RxSwift (~> 4.0)
- RxSwift (4.3.1)
- SDWebImage (4.4.2):
- SDWebImage/Core (= 4.4.2)
- SDWebImage/Core (4.4.2)
- SwiftyJSON (4.2.0)
- SwiftyUserDefaults (3.0.1)
- RxCocoa (4.5.0):
- RxSwift (>= 4.4.2, ~> 4.4)
- RxSwift (4.5.0)
- SDWebImage (5.12.0):
- SDWebImage/Core (= 5.12.0)
- SDWebImage/Core (5.12.0)
- SwiftyJSON (5.0.1)
- SwiftyUserDefaults (5.3.0)
- XCGLogger (6.1.0):
- XCGLogger/Core (= 6.1.0)
- XCGLogger/Core (6.1.0):
Expand All @@ -37,7 +37,7 @@ DEPENDENCIES:
- XCGLogger (~> 6.1.0)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
trunk:
- Alamofire
- IQKeyboardManagerSwift
- Moya
Expand All @@ -52,19 +52,19 @@ SPEC REPOS:
- XCGLogger

SPEC CHECKSUMS:
Alamofire: c7287b6e5d7da964a70935e5db17046b7fde6568
IQKeyboardManagerSwift: b07ccf9d8cafe993dcd6cb794eb4ba34611a0c4e
Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18
IQKeyboardManagerSwift: c7df9d2deb356c04522f5c4b7b6e4ce4d8ed94fe
Moya: a725035953bc1c0eb1be505ab903984501d82440
ObjcExceptionBridging: c30e00eb3700467e695faeea30e26e18bd445001
ObjectMapper: b612bf8c8e99c4dc0bb6013a51f7c27966ed5da9
ObjectMapper: 97111c97e054a6ee25917662106689f0b4127b37
Result: d2d07204ce72856f1fd9130bbe42c35a7b0fea10
RxCocoa: 78763c7b07d02455598d9fc3c1ad091a28b73635
RxSwift: fe0fd770a43acdb7d0a53da411c9b892e69bb6e4
SDWebImage: 624d6e296c69b244bcede364c72ae0430ac14681
SwiftyJSON: c4bcba26dd9ec7a027fc8eade48e2c911f229e96
SwiftyUserDefaults: 3d273b1739b68ada3145dc754a70ec775bc5c8be
RxCocoa: cbf70265dc65a981d4ac982e513c10cf23df24a0
RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575
SDWebImage: 4ea20cca2986adc5aacde07aa686742fd4c67a37
SwiftyJSON: 2f33a42c6fbc52764d96f13368585094bfd8aa5e
SwiftyUserDefaults: 63f80248cf5bfb3458825d9a78f2eb7e1293a040
XCGLogger: 7f7f43f15dfe3a305fa1342b7dc29af656289abd

PODFILE CHECKSUM: d27ff6773787fba450a481164324599942fff50b

COCOAPODS: 1.5.3
COCOAPODS: 1.10.1