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
5d73acf9
Commit
5d73acf9
authored
May 04, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Audomatically focus on Search Bar if there are no locations.
parent
e340a1da
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
1Weather/UI/View controllers/Locations/LocationViewController.swift
+3
-0
1Weather/UI/View controllers/Locations/LocationsViewModel.swift
+4
-0
No files found.
1Weather/UI/View controllers/Locations/LocationViewController.swift
View file @
5d73acf9
...
@@ -59,6 +59,9 @@ class LocationViewController:UIViewController {
...
@@ -59,6 +59,9 @@ class LocationViewController:UIViewController {
if
openedFromOnboarding
{
if
openedFromOnboarding
{
analytics
(
log
:
.
ANALYTICS_FTUE_SEARCH_SEEN
)
analytics
(
log
:
.
ANALYTICS_FTUE_SEARCH_SEEN
)
}
}
if
locationsViewModel
.
shouldFocusOnSearchBar
{
self
.
searchBar
.
becomeFirstResponder
()
}
}
}
override
func
traitCollectionDidChange
(
_
previousTraitCollection
:
UITraitCollection
?)
{
override
func
traitCollectionDidChange
(
_
previousTraitCollection
:
UITraitCollection
?)
{
...
...
1Weather/UI/View controllers/Locations/LocationsViewModel.swift
View file @
5d73acf9
...
@@ -51,6 +51,10 @@ public class LocationsViewModel {
...
@@ -51,6 +51,10 @@ public class LocationsViewModel {
return
fullLocation
==
locationManager
.
selectedLocation
return
fullLocation
==
locationManager
.
selectedLocation
}
}
public
var
shouldFocusOnSearchBar
:
Bool
{
return
!
locationManager
.
hasLocations
}
public
init
()
{
public
init
()
{
locationManager
.
add
(
delegate
:
self
)
locationManager
.
add
(
delegate
:
self
)
}
}
...
...
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