Skip to content

Commit f7a246c

Browse files
Update project to Swift 4.2
1 parent 36dad27 commit f7a246c

File tree

4 files changed

+12
-45
lines changed

4 files changed

+12
-45
lines changed

Countries.xcodeproj/project.pbxproj

+5-4
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@
265265
TargetAttributes = {
266266
00107D6B2125DE0E0064C231 = {
267267
CreatedOnToolsVersion = 9.4.1;
268+
LastSwiftMigration = 1000;
268269
TestTargetID = 00934D752121CC0F00D5354C;
269270
};
270271
00934D752121CC0F00D5354C = {
@@ -385,7 +386,7 @@
385386
);
386387
PRODUCT_BUNDLE_IDENTIFIER = ca.jeffreyfulton.CountriesUITests;
387388
PRODUCT_NAME = "$(TARGET_NAME)";
388-
SWIFT_VERSION = 4.0;
389+
SWIFT_VERSION = 4.2;
389390
TARGETED_DEVICE_FAMILY = "1,2";
390391
TEST_TARGET_NAME = Countries;
391392
};
@@ -404,7 +405,7 @@
404405
);
405406
PRODUCT_BUNDLE_IDENTIFIER = ca.jeffreyfulton.CountriesUITests;
406407
PRODUCT_NAME = "$(TARGET_NAME)";
407-
SWIFT_VERSION = 4.0;
408+
SWIFT_VERSION = 4.2;
408409
TARGETED_DEVICE_FAMILY = "1,2";
409410
TEST_TARGET_NAME = Countries;
410411
};
@@ -537,7 +538,7 @@
537538
);
538539
PRODUCT_BUNDLE_IDENTIFIER = ca.jeffreyfulton.Countries;
539540
PRODUCT_NAME = "$(TARGET_NAME)";
540-
SWIFT_VERSION = 4.0;
541+
SWIFT_VERSION = 4.2;
541542
TARGETED_DEVICE_FAMILY = "1,2";
542543
};
543544
name = Debug;
@@ -555,7 +556,7 @@
555556
);
556557
PRODUCT_BUNDLE_IDENTIFIER = ca.jeffreyfulton.Countries;
557558
PRODUCT_NAME = "$(TARGET_NAME)";
558-
SWIFT_VERSION = 4.0;
559+
SWIFT_VERSION = 4.2;
559560
TARGETED_DEVICE_FAMILY = "1,2";
560561
};
561562
name = Release;

Countries.xcodeproj/xcshareddata/xcschemes/Countries.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<CommandLineArguments>
7575
<CommandLineArgument
7676
argument = "--countries-datasource local-mock"
77-
isEnabled = "YES">
77+
isEnabled = "NO">
7878
</CommandLineArgument>
7979
</CommandLineArguments>
8080
<AdditionalOptions>
-39
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,7 @@
1-
//
2-
// AppDelegate.swift
3-
// Countries
4-
//
5-
// Created by Jeffrey Fulton on 2018-08-13.
6-
// Copyright © 2018 Jeffrey Fulton. All rights reserved.
7-
//
8-
91
import UIKit
102

113
@UIApplicationMain
124
class AppDelegate: UIResponder, UIApplicationDelegate {
13-
145
var window: UIWindow?
15-
16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// Override point for customization after application launch.
19-
return true
20-
}
21-
22-
func applicationWillResignActive(_ application: UIApplication) {
23-
// 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.
24-
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25-
}
26-
27-
func applicationDidEnterBackground(_ application: UIApplication) {
28-
// 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.
29-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30-
}
31-
32-
func applicationWillEnterForeground(_ application: UIApplication) {
33-
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34-
}
35-
36-
func applicationDidBecomeActive(_ application: UIApplication) {
37-
// 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.
38-
}
39-
40-
func applicationWillTerminate(_ application: UIApplication) {
41-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42-
}
43-
44-
456
}
467

Countries/Screens/CountryDetails/CountryDetailsViewController.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ class CountryDetailsViewController: UIViewController {
1515

1616
init(country: CountryWithFullDetails) {
1717
let distance = country.area.squareRoot() * 1300
18-
mapRegion = MKCoordinateRegionMakeWithDistance(country.coordinate, distance, distance)
18+
19+
mapRegion = MKCoordinateRegion(
20+
center: country.coordinate,
21+
latitudinalMeters: distance,
22+
longitudinalMeters: distance
23+
)
1924

2025
nameText = country.name
2126
regionText = "\(country.subregion), \(country.region)"

0 commit comments

Comments
 (0)