Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
1fe1b54b
Commit
1fe1b54b
authored
Apr 29, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the flow for enabling location permissions outside the app and then logging in.
parent
899bbabd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
1Weather/Model/DeviceLocationMonitor.swift
+12
-0
1Weather/Model/LocationManager.swift
+1
-0
No files found.
1Weather/Model/DeviceLocationMonitor.swift
View file @
1fe1b54b
...
...
@@ -151,6 +151,18 @@ internal class DeviceLocationMonitor: NSObject {
}
}
public
func
startLocationUpdatesIfPossible
()
{
onMain
{
guard
CLLocationManager
.
locationServicesEnabled
()
else
{
return
}
guard
CLLocationManager
.
authorizationStatus
()
==
CLAuthorizationStatus
.
authorizedAlways
||
CLLocationManager
.
authorizationStatus
()
==
CLAuthorizationStatus
.
authorizedWhenInUse
else
{
return
}
self
.
locationManager
.
startUpdatingLocation
()
}
}
public
var
hasLocationPermissions
:
Bool
{
guard
CLLocationManager
.
locationServicesEnabled
()
else
{
return
false
...
...
1Weather/Model/LocationManager.swift
View file @
1fe1b54b
...
...
@@ -231,6 +231,7 @@ public class LocationManager {
}
}
self
.
loadedLocations
=
true
self
.
deviceLocationMonitor
.
startLocationUpdatesIfPossible
()
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment