Skip to content

Commit e40c5fb

Browse files
authored
Updated project to Alamofire 5 and Swift 5 only (#48)
* Updated Alamofire submodule to AF5b4 through Cartfile and podspec * Updated project to compile against Swift 5 only
1 parent a7cba3a commit e40c5fb

File tree

8 files changed

+27
-35
lines changed

8 files changed

+27
-35
lines changed

.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

AlamofireNetworkActivityIndicator.podspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Pod::Spec.new do |s|
1111
s.source = { :git => 'https://github.com/Alamofire/AlamofireNetworkActivityIndicator.git', :tag => s.version }
1212
s.source_files = 'Source/*.swift'
1313

14-
s.ios.deployment_target = '8.0'
14+
s.ios.deployment_target = '10.0'
1515

16-
s.dependency 'Alamofire', '~> 4.8'
16+
s.swift_version = '5.0'
17+
18+
s.dependency 'Alamofire', '~> 5.0.0-beta.4'
1719
end

AlamofireNetworkActivityIndicator.xcodeproj/project.pbxproj

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@
299299
developmentRegion = English;
300300
hasScannedForEncodings = 0;
301301
knownRegions = (
302+
English,
302303
en,
303304
);
304305
mainGroup = 4CB9282F1C66E1A600CE5F08;
@@ -501,19 +502,19 @@
501502
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
502503
GCC_WARN_UNUSED_FUNCTION = YES;
503504
GCC_WARN_UNUSED_VARIABLE = YES;
504-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
505-
MACOSX_DEPLOYMENT_TARGET = 10.10;
505+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
506+
MACOSX_DEPLOYMENT_TARGET = 10.12;
506507
MTL_ENABLE_DEBUG_INFO = YES;
507508
ONLY_ACTIVE_ARCH = YES;
508509
SDKROOT = iphoneos;
509510
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
510511
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
511-
SWIFT_VERSION = 4.0;
512+
SWIFT_VERSION = 5.0;
512513
TARGETED_DEVICE_FAMILY = "1,2";
513-
TVOS_DEPLOYMENT_TARGET = 9.0;
514+
TVOS_DEPLOYMENT_TARGET = 10.0;
514515
VERSIONING_SYSTEM = "apple-generic";
515516
VERSION_INFO_PREFIX = "";
516-
WATCHOS_DEPLOYMENT_TARGET = 2.0;
517+
WATCHOS_DEPLOYMENT_TARGET = 3.0;
517518
};
518519
name = Debug;
519520
};
@@ -560,19 +561,19 @@
560561
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
561562
GCC_WARN_UNUSED_FUNCTION = YES;
562563
GCC_WARN_UNUSED_VARIABLE = YES;
563-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
564-
MACOSX_DEPLOYMENT_TARGET = 10.10;
564+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
565+
MACOSX_DEPLOYMENT_TARGET = 10.12;
565566
MTL_ENABLE_DEBUG_INFO = NO;
566567
SDKROOT = iphoneos;
567568
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
568569
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
569-
SWIFT_VERSION = 4.0;
570+
SWIFT_VERSION = 5.0;
570571
TARGETED_DEVICE_FAMILY = "1,2";
571-
TVOS_DEPLOYMENT_TARGET = 9.0;
572+
TVOS_DEPLOYMENT_TARGET = 10.0;
572573
VALIDATE_PRODUCT = YES;
573574
VERSIONING_SYSTEM = "apple-generic";
574575
VERSION_INFO_PREFIX = "";
575-
WATCHOS_DEPLOYMENT_TARGET = 2.0;
576+
WATCHOS_DEPLOYMENT_TARGET = 3.0;
576577
};
577578
name = Release;
578579
};

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "Alamofire/Alamofire" ~> 4.8
1+
github "Alamofire/Alamofire" ~> 5.0.0-beta.4

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "Alamofire/Alamofire" "4.8.2"
1+
github "Alamofire/Alamofire" "5.0.0-beta.4"

Carthage/Checkouts/Alamofire

Submodule Alamofire updated 336 files

Source/NetworkActivityIndicatorManager.swift

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -178,21 +178,21 @@ public class NetworkActivityIndicatorManager {
178178
notificationCenter.addObserver(
179179
self,
180180
selector: #selector(NetworkActivityIndicatorManager.networkRequestDidStart),
181-
name: Notification.Name.Task.DidResume,
181+
name: Request.didResume,
182182
object: nil
183183
)
184184

185185
notificationCenter.addObserver(
186186
self,
187187
selector: #selector(NetworkActivityIndicatorManager.networkRequestDidComplete),
188-
name: Notification.Name.Task.DidSuspend,
188+
name: Request.didSuspend,
189189
object: nil
190190
)
191191

192192
notificationCenter.addObserver(
193193
self,
194194
selector: #selector(NetworkActivityIndicatorManager.networkRequestDidComplete),
195-
name: Notification.Name.Task.DidComplete,
195+
name: Request.didFinish,
196196
object: nil
197197
)
198198
}
@@ -223,13 +223,8 @@ public class NetworkActivityIndicatorManager {
223223
)
224224

225225
DispatchQueue.main.async {
226-
#if swift(>=4.2)
227226
RunLoop.main.add(timer, forMode: .common)
228227
RunLoop.main.add(timer, forMode: .tracking)
229-
#else
230-
RunLoop.main.add(timer, forMode: .commonModes)
231-
RunLoop.main.add(timer, forMode: .UITrackingRunLoopMode)
232-
#endif
233228
}
234229

235230
startDelayTimer = timer
@@ -245,13 +240,8 @@ public class NetworkActivityIndicatorManager {
245240
)
246241

247242
DispatchQueue.main.async {
248-
#if swift(>=4.2)
249243
RunLoop.main.add(timer, forMode: .common)
250244
RunLoop.main.add(timer, forMode: .tracking)
251-
#else
252-
RunLoop.main.add(timer, forMode: .commonModes)
253-
RunLoop.main.add(timer, forMode: .UITrackingRunLoopMode)
254-
#endif
255245
}
256246

257247
completionDelayTimer = timer

Tests/NetworkActivityIndicatorManagerTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class NetworkActivityIndicatorManagerTestCase: XCTestCase {
231231
}
232232

233233
// When
234-
let _ = Alamofire.request("https://httpbin.org/delay/1")
234+
let _ = AF.request("https://httpbin.org/delay/1")
235235
waitForExpectations(timeout: timeout, handler: nil)
236236

237237
// Then
@@ -259,7 +259,7 @@ class NetworkActivityIndicatorManagerTestCase: XCTestCase {
259259
}
260260

261261
// When
262-
let _ = Alamofire.request("https://httpbin.org/status/404")
262+
let _ = AF.request("https://httpbin.org/status/404")
263263
waitForExpectations(timeout: timeout, handler: nil)
264264

265265
// Then
@@ -287,7 +287,7 @@ class NetworkActivityIndicatorManagerTestCase: XCTestCase {
287287
}
288288

289289
// When
290-
let _ = Alamofire.request("https://httpbin.org/delay/1")
290+
let _ = AF.request("https://httpbin.org/delay/1")
291291
waitForExpectations(timeout: timeout, handler: nil)
292292

293293
// Then
@@ -315,9 +315,9 @@ class NetworkActivityIndicatorManagerTestCase: XCTestCase {
315315
}
316316

317317
// When
318-
let _ = Alamofire.request("https://httpbin.org/delay/1")
319-
let _ = Alamofire.request("https://httpbin.org/delay/1")
320-
let _ = Alamofire.request("https://httpbin.org/delay/1")
318+
let _ = AF.request("https://httpbin.org/delay/1")
319+
let _ = AF.request("https://httpbin.org/delay/1")
320+
let _ = AF.request("https://httpbin.org/delay/1")
321321

322322
waitForExpectations(timeout: timeout, handler: nil)
323323

0 commit comments

Comments
 (0)