Skip to content

Commit 4bf8ec2

Browse files
committedOct 28, 2022
release candidate
1 parent 0ac66bf commit 4bf8ec2

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed
 

‎Clima.xcodeproj/project.pbxproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,13 @@
339339
buildSettings = {
340340
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
341341
CODE_SIGN_STYLE = Automatic;
342+
DEVELOPMENT_TEAM = Z4DAU59V98;
342343
INFOPLIST_FILE = Clima/Info.plist;
343344
LD_RUNPATH_SEARCH_PATHS = (
344345
"$(inherited)",
345346
"@executable_path/Frameworks",
346347
);
347-
PRODUCT_BUNDLE_IDENTIFIER = co.appbrewery.Clima;
348+
PRODUCT_BUNDLE_IDENTIFIER = advanc3d.ua;
348349
PRODUCT_NAME = "$(TARGET_NAME)";
349350
SWIFT_VERSION = 5.0;
350351
TARGETED_DEVICE_FAMILY = "1,2";
@@ -356,12 +357,13 @@
356357
buildSettings = {
357358
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
358359
CODE_SIGN_STYLE = Automatic;
360+
DEVELOPMENT_TEAM = Z4DAU59V98;
359361
INFOPLIST_FILE = Clima/Info.plist;
360362
LD_RUNPATH_SEARCH_PATHS = (
361363
"$(inherited)",
362364
"@executable_path/Frameworks",
363365
);
364-
PRODUCT_BUNDLE_IDENTIFIER = co.appbrewery.Clima;
366+
PRODUCT_BUNDLE_IDENTIFIER = advanc3d.ua;
365367
PRODUCT_NAME = "$(TARGET_NAME)";
366368
SWIFT_VERSION = 5.0;
367369
TARGETED_DEVICE_FAMILY = "1,2";

‎Clima/Controller/WeatherVC+CLLoсationDelegate.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import CoreLocation
1212
extension WeatherViewController: CLLocationManagerDelegate {
1313
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
1414
if let location = locations.last {
15-
currentLatitude = location.coordinate.latitude
16-
currentLongitude = location.coordinate.longitude
17-
currentLocationButton.isHidden = false
18-
weatherManager.fetchWeather(latitude: currentLatitude, longitude: currentLongitude)
15+
locationManager.stopUpdatingLocation()
16+
let lat = location.coordinate.latitude
17+
let lon = location.coordinate.longitude
18+
weatherManager.fetchWeather(latitude: lat, longitude: lon)
1919
}
2020
}
2121

‎Clima/Controller/WeatherViewController.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ class WeatherViewController: UIViewController {
2020
var weatherManager = WeatherManager()
2121

2222
let locationManager = CLLocationManager()
23-
var currentLatitude: CLLocationDegrees?
24-
var currentLongitude: CLLocationDegrees?
2523

2624
override func viewDidLoad() {
2725
super.viewDidLoad()
28-
currentLocationButton.isHidden = true
29-
3026
locationManager.delegate = self
3127
locationManager.requestWhenInUseAuthorization()
3228
locationManager.requestLocation()
@@ -41,7 +37,7 @@ class WeatherViewController: UIViewController {
4137
}
4238

4339
@IBAction func getToCurrentLocationPressed(_ sender: UIButton) {
44-
weatherManager.fetchWeather(latitude: currentLatitude, longitude: currentLongitude)
40+
locationManager.requestLocation()
4541
}
4642

4743
}

‎Clima/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>NSLocationWhenInUseUsageDescription</key>
6-
<string>We need your location to provide you with weather where you are.</string>
75
<key>CFBundleDevelopmentRegion</key>
86
<string>$(DEVELOPMENT_LANGUAGE)</string>
97
<key>CFBundleExecutable</key>
@@ -22,6 +20,8 @@
2220
<string>1</string>
2321
<key>LSRequiresIPhoneOS</key>
2422
<true/>
23+
<key>NSLocationWhenInUseUsageDescription</key>
24+
<string>We need your location to provide you with weather where you are.</string>
2525
<key>UIApplicationSceneManifest</key>
2626
<dict>
2727
<key>UIApplicationSupportsMultipleScenes</key>

0 commit comments

Comments
 (0)
Please sign in to comment.