File tree 4 files changed +11
-13
lines changed
4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 339
339
buildSettings = {
340
340
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
341
341
CODE_SIGN_STYLE = Automatic;
342
+ DEVELOPMENT_TEAM = Z4DAU59V98;
342
343
INFOPLIST_FILE = Clima/Info.plist;
343
344
LD_RUNPATH_SEARCH_PATHS = (
344
345
"$(inherited)",
345
346
"@executable_path/Frameworks",
346
347
);
347
- PRODUCT_BUNDLE_IDENTIFIER = co.appbrewery.Clima ;
348
+ PRODUCT_BUNDLE_IDENTIFIER = advanc3d.ua ;
348
349
PRODUCT_NAME = "$(TARGET_NAME)";
349
350
SWIFT_VERSION = 5.0;
350
351
TARGETED_DEVICE_FAMILY = "1,2";
356
357
buildSettings = {
357
358
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
358
359
CODE_SIGN_STYLE = Automatic;
360
+ DEVELOPMENT_TEAM = Z4DAU59V98;
359
361
INFOPLIST_FILE = Clima/Info.plist;
360
362
LD_RUNPATH_SEARCH_PATHS = (
361
363
"$(inherited)",
362
364
"@executable_path/Frameworks",
363
365
);
364
- PRODUCT_BUNDLE_IDENTIFIER = co.appbrewery.Clima ;
366
+ PRODUCT_BUNDLE_IDENTIFIER = advanc3d.ua ;
365
367
PRODUCT_NAME = "$(TARGET_NAME)";
366
368
SWIFT_VERSION = 5.0;
367
369
TARGETED_DEVICE_FAMILY = "1,2";
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ import CoreLocation
12
12
extension WeatherViewController : CLLocationManagerDelegate {
13
13
func locationManager( _ manager: CLLocationManager , didUpdateLocations locations: [ CLLocation ] ) {
14
14
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 )
19
19
}
20
20
}
21
21
Original file line number Diff line number Diff line change @@ -20,13 +20,9 @@ class WeatherViewController: UIViewController {
20
20
var weatherManager = WeatherManager ( )
21
21
22
22
let locationManager = CLLocationManager ( )
23
- var currentLatitude : CLLocationDegrees ?
24
- var currentLongitude : CLLocationDegrees ?
25
23
26
24
override func viewDidLoad( ) {
27
25
super. viewDidLoad ( )
28
- currentLocationButton. isHidden = true
29
-
30
26
locationManager. delegate = self
31
27
locationManager. requestWhenInUseAuthorization ( )
32
28
locationManager. requestLocation ( )
@@ -41,7 +37,7 @@ class WeatherViewController: UIViewController {
41
37
}
42
38
43
39
@IBAction func getToCurrentLocationPressed( _ sender: UIButton ) {
44
- weatherManager . fetchWeather ( latitude : currentLatitude , longitude : currentLongitude )
40
+ locationManager . requestLocation ( )
45
41
}
46
42
47
43
}
Original file line number Diff line number Diff line change 2
2
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
<plist version =" 1.0" >
4
4
<dict >
5
- <key >NSLocationWhenInUseUsageDescription </key >
6
- <string >We need your location to provide you with weather where you are. </string >
7
5
<key >CFBundleDevelopmentRegion </key >
8
6
<string >$(DEVELOPMENT_LANGUAGE) </string >
9
7
<key >CFBundleExecutable </key >
22
20
<string >1 </string >
23
21
<key >LSRequiresIPhoneOS </key >
24
22
<true />
23
+ <key >NSLocationWhenInUseUsageDescription </key >
24
+ <string >We need your location to provide you with weather where you are. </string >
25
25
<key >UIApplicationSceneManifest </key >
26
26
<dict >
27
27
<key >UIApplicationSupportsMultipleScenes </key >
You can’t perform that action at this time.
0 commit comments