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
c7d6b24e
Commit
c7d6b24e
authored
Mar 30, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing the LocationController UI
parent
e6ea1f92
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
7 deletions
+71
-7
1Weather.xcodeproj/project.pbxproj
+4
-1
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
1Weather/Coordinators/LocationSearchCoordinator.swift
+32
-0
1Weather/Coordinators/TodayCoordinator.swift
+7
-1
1Weather/Resources/Assets.xcassets/location_arrow.imageset/Contents.json
+16
-0
1Weather/Resources/Assets.xcassets/location_arrow.imageset/location_arrow.pdf
+0
-0
1Weather/Resources/en.lproj/Localizable.strings
+6
-0
1Weather/UI/View controllers/Locations/LocationViewController.swift
+0
-0
1Weather/UI/View controllers/Today/Cells/TodayForecastTimePeriodCell.swift
+1
-1
1Weather/UI/View controllers/Today/TodayViewController.swift
+5
-4
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
c7d6b24e
...
@@ -115,6 +115,7 @@
...
@@ -115,6 +115,7 @@
CDE2BF222609D4250085C930
/* ForecastWindSpeedCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDE2BF212609D4250085C930
/* ForecastWindSpeedCell.swift */
;
};
CDE2BF222609D4250085C930
/* ForecastWindSpeedCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDE2BF212609D4250085C930
/* ForecastWindSpeedCell.swift */
;
};
CDE2BF252609D9140085C930
/* ForecastWindButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDE2BF242609D9140085C930
/* ForecastWindButton.swift */
;
};
CDE2BF252609D9140085C930
/* ForecastWindButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDE2BF242609D9140085C930
/* ForecastWindButton.swift */
;
};
CDEE8AD725DA882200C289DE
/* ForecastPeriodButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDEE8AD625DA882200C289DE
/* ForecastPeriodButton.swift */
;
};
CDEE8AD725DA882200C289DE
/* ForecastPeriodButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDEE8AD625DA882200C289DE
/* ForecastPeriodButton.swift */
;
};
CDF9BF8E26133D050037847D
/* LocationSearchCoordinator.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDF9BF8D26133D050037847D
/* LocationSearchCoordinator.swift */
;
};
CE578FD325F7E89400E8B85D
/* DayTimeWeather.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FD225F7E89400E8B85D
/* DayTimeWeather.swift */
;
};
CE578FD325F7E89400E8B85D
/* DayTimeWeather.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FD225F7E89400E8B85D
/* DayTimeWeather.swift */
;
};
CE578FE525FB415F00E8B85D
/* CityCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE225FB415F00E8B85D
/* CityCell.swift */
;
};
CE578FE525FB415F00E8B85D
/* CityCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE225FB415F00E8B85D
/* CityCell.swift */
;
};
CE578FE625FB415F00E8B85D
/* LocationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE325FB415F00E8B85D
/* LocationViewController.swift */
;
};
CE578FE625FB415F00E8B85D
/* LocationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE325FB415F00E8B85D
/* LocationViewController.swift */
;
};
...
@@ -265,6 +266,7 @@
...
@@ -265,6 +266,7 @@
CDE2BF212609D4250085C930
/* ForecastWindSpeedCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastWindSpeedCell.swift
;
sourceTree
=
"<group>"
;
};
CDE2BF212609D4250085C930
/* ForecastWindSpeedCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastWindSpeedCell.swift
;
sourceTree
=
"<group>"
;
};
CDE2BF242609D9140085C930
/* ForecastWindButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastWindButton.swift
;
sourceTree
=
"<group>"
;
};
CDE2BF242609D9140085C930
/* ForecastWindButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastWindButton.swift
;
sourceTree
=
"<group>"
;
};
CDEE8AD625DA882200C289DE
/* ForecastPeriodButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastPeriodButton.swift
;
sourceTree
=
"<group>"
;
};
CDEE8AD625DA882200C289DE
/* ForecastPeriodButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastPeriodButton.swift
;
sourceTree
=
"<group>"
;
};
CDF9BF8D26133D050037847D
/* LocationSearchCoordinator.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LocationSearchCoordinator.swift
;
sourceTree
=
"<group>"
;
};
CE578FD225F7E89400E8B85D
/* DayTimeWeather.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DayTimeWeather.swift
;
sourceTree
=
"<group>"
;
};
CE578FD225F7E89400E8B85D
/* DayTimeWeather.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DayTimeWeather.swift
;
sourceTree
=
"<group>"
;
};
CE578FE225FB415F00E8B85D
/* CityCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CityCell.swift
;
sourceTree
=
"<group>"
;
};
CE578FE225FB415F00E8B85D
/* CityCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CityCell.swift
;
sourceTree
=
"<group>"
;
};
CE578FE325FB415F00E8B85D
/* LocationViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LocationViewController.swift
;
sourceTree
=
"<group>"
;
};
CE578FE325FB415F00E8B85D
/* LocationViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LocationViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -448,6 +450,7 @@
...
@@ -448,6 +450,7 @@
CD32CE0A260C744A00235081
/* MenuCoordinator.swift */
,
CD32CE0A260C744A00235081
/* MenuCoordinator.swift */
,
CD37D3F2260DF4FB002669D6
/* SettingsCoordinator.swift */
,
CD37D3F2260DF4FB002669D6
/* SettingsCoordinator.swift */
,
CD866A75260F77C500E96A5C
/* SettingsDetailsCoordinator.swift */
,
CD866A75260F77C500E96A5C
/* SettingsDetailsCoordinator.swift */
,
CDF9BF8D26133D050037847D
/* LocationSearchCoordinator.swift */
,
);
);
path
=
Coordinators
;
path
=
Coordinators
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -1088,6 +1091,7 @@
...
@@ -1088,6 +1091,7 @@
CDE2BF252609D9140085C930
/* ForecastWindButton.swift in Sources */
,
CDE2BF252609D9140085C930
/* ForecastWindButton.swift in Sources */
,
CD32CE16260C77C600235081
/* MenuHeaderButton.swift in Sources */
,
CD32CE16260C77C600235081
/* MenuHeaderButton.swift in Sources */
,
CD251ED82603633800ED7A65
/* ForecastPrecipitationCell.swift in Sources */
,
CD251ED82603633800ED7A65
/* ForecastPrecipitationCell.swift in Sources */
,
CDF9BF8E26133D050037847D
/* LocationSearchCoordinator.swift in Sources */
,
CD86246125E662BC0097F3FB
/* SunUvLineView.swift in Sources */
,
CD86246125E662BC0097F3FB
/* SunUvLineView.swift in Sources */
,
CD32CE0B260C744A00235081
/* MenuCoordinator.swift in Sources */
,
CD32CE0B260C744A00235081
/* MenuCoordinator.swift in Sources */
,
CEC526FA25E7959A00DA58A5
/* WeatherSource.swift in Sources */
,
CEC526FA25E7959A00DA58A5
/* WeatherSource.swift in Sources */
,
...
@@ -1110,7 +1114,6 @@
...
@@ -1110,7 +1114,6 @@
CD17C5F625D15B4400EE884E
/* TodayViewController.swift in Sources */
,
CD17C5F625D15B4400EE884E
/* TodayViewController.swift in Sources */
,
CD86245E25E646350097F3FB
/* SunUvView.swift in Sources */
,
CD86245E25E646350097F3FB
/* SunUvView.swift in Sources */
,
CEAFF08325DFC67F00DF4EBF
/* Location.swift in Sources */
,
CEAFF08325DFC67F00DF4EBF
/* Location.swift in Sources */
,
CD8E040D25F8F3D2001785B6
/* ForecastTimePeriodCell.swift in Sources */
,
87C171EC25FF79CC00DA3464
/* EnvironmentManager.swift in Sources */
,
87C171EC25FF79CC00DA3464
/* EnvironmentManager.swift in Sources */
,
CD82300725D6A73F00A05501
/* TodayConditionButton.swift in Sources */
,
CD82300725D6A73F00A05501
/* TodayConditionButton.swift in Sources */
,
CDC6126A25E90C8800188DA7
/* GraphLineSettings.swift in Sources */
,
CDC6126A25E90C8800188DA7
/* GraphLineSettings.swift in Sources */
,
...
...
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/UserInterfaceState.xcuserstate
View file @
c7d6b24e
No preview for this file type
1Weather/Coordinators/LocationSearchCoordinator.swift
0 → 100644
View file @
c7d6b24e
//
// LocationSearchCoordinator.swift
// 1Weather
//
// Created by Dmitry Stepanets on 30.03.2021.
//
import
UIKit
class
LocationSearchCoordinator
:
Coordinator
{
//Private
private
let
parentViewController
:
UIViewController
//Public
var
childCoordinators
=
[
Coordinator
]()
var
parentCoordinator
:
Coordinator
?
init
(
parentViewController
:
UIViewController
)
{
self
.
parentViewController
=
parentViewController
}
func
start
()
{
let
searchViewController
=
LocationViewController
(
coordinator
:
self
)
let
navigationController
=
UINavigationController
(
rootViewController
:
searchViewController
)
self
.
parentViewController
.
present
(
navigationController
,
animated
:
true
)
}
func
viewControllerDidEnd
(
controller
:
UIViewController
)
{
parentCoordinator
?
.
childDidFinish
(
child
:
self
)
}
}
1Weather/Coordinators/TodayCoordinator.swift
View file @
c7d6b24e
...
@@ -21,11 +21,17 @@ class TodayCoordinator:Coordinator {
...
@@ -21,11 +21,17 @@ class TodayCoordinator:Coordinator {
}
}
func
start
()
{
func
start
()
{
let
todayViewController
=
TodayViewController
()
let
todayViewController
=
TodayViewController
(
coordinator
:
self
)
navigationController
.
viewControllers
=
[
todayViewController
]
navigationController
.
viewControllers
=
[
todayViewController
]
tabBarController
?
.
add
(
viewController
:
navigationController
)
tabBarController
?
.
add
(
viewController
:
navigationController
)
}
}
func
openLocationsSearch
()
{
let
searchCoordinator
=
LocationSearchCoordinator
(
parentViewController
:
navigationController
)
searchCoordinator
.
parentCoordinator
=
self
searchCoordinator
.
start
()
}
func
viewControllerDidEnd
(
controller
:
UIViewController
)
{
func
viewControllerDidEnd
(
controller
:
UIViewController
)
{
//
//
}
}
...
...
1Weather/Resources/Assets.xcassets/location_arrow.imageset/Contents.json
0 → 100644
View file @
c7d6b24e
{
"images"
:
[
{
"filename"
:
"location_arrow.pdf"
,
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
},
"properties"
:
{
"preserves-vector-representation"
:
true
,
"template-rendering-intent"
:
"template"
}
}
1Weather/Resources/Assets.xcassets/location_arrow.imageset/location_arrow.pdf
0 → 100644
View file @
c7d6b24e
File added
1Weather/Resources/en.lproj/Localizable.strings
View file @
c7d6b24e
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
//General
//General
"general.close" = "close";
"general.close" = "close";
"general.more" = "more";
"general.more" = "more";
"general.search" = "search";
//Forecast
//Forecast
"forecast.sunny" = "Sunny";
"forecast.sunny" = "Sunny";
...
@@ -94,6 +95,11 @@
...
@@ -94,6 +95,11 @@
"tabBar.menu" = "menu";
"tabBar.menu" = "menu";
// Search
// Search
"search.popularCities" = "Popular cities";
"search.title" = "Search location";
"search.savedCities" = "saved cities";
"search.results" = "Results";
"search.currentLocation" = "Use current location";
"search.error.maxLocationWarning" = "To keep your 1Weather running in tip-top shape, please limit the number of locations to %@";
"search.error.maxLocationWarning" = "To keep your 1Weather running in tip-top shape, please limit the number of locations to %@";
"search.error.deleteError" = "Failed to delete location.";
"search.error.deleteError" = "Failed to delete location.";
"search.accessibility.tapToSelectLocation" = "Tap to select this location";
"search.accessibility.tapToSelectLocation" = "Tap to select this location";
...
...
1Weather/UI/View controllers/Locations/LocationViewController.swift
View file @
c7d6b24e
This diff is collapsed.
Click to expand it.
1Weather/UI/View controllers/Today/Cells/TodayForecastTimePeriodCell.swift
View file @
c7d6b24e
...
@@ -35,7 +35,7 @@ class TodayForecastTimePeriodCell: UITableViewCell {
...
@@ -35,7 +35,7 @@ class TodayForecastTimePeriodCell: UITableViewCell {
public
func
configure
(
with
location
:
Location
)
{
public
func
configure
(
with
location
:
Location
)
{
self
.
forecastTimePeriodView
.
set
(
daily
:
location
.
daily
,
hourly
:
location
.
hourly
)
self
.
forecastTimePeriodView
.
set
(
daily
:
location
.
daily
,
hourly
:
location
.
hourly
)
if
graphIsDrawn
==
false
{
if
graphIsDrawn
==
false
{
self
.
handleSegmentDidChange
()
self
.
handleSegmentDidChange
()
self
.
graphIsDrawn
=
true
self
.
graphIsDrawn
=
true
}
}
...
...
1Weather/UI/View controllers/Today/TodayViewController.swift
View file @
c7d6b24e
...
@@ -10,6 +10,7 @@ import CoreLocation
...
@@ -10,6 +10,7 @@ import CoreLocation
class
TodayViewController
:
UIViewController
{
class
TodayViewController
:
UIViewController
{
//Private
//Private
private
let
coordinator
:
TodayCoordinator
private
let
viewModel
=
TodayViewModel
()
private
let
viewModel
=
TodayViewModel
()
private
let
todayCellFactory
:
TodayCellFactory
private
let
todayCellFactory
:
TodayCellFactory
private
let
cityButton
=
NavigationCityButton
()
private
let
cityButton
=
NavigationCityButton
()
...
@@ -22,7 +23,8 @@ class TodayViewController: UIViewController {
...
@@ -22,7 +23,8 @@ class TodayViewController: UIViewController {
}
}
}
}
init
()
{
init
(
coordinator
:
TodayCoordinator
)
{
self
.
coordinator
=
coordinator
self
.
todayCellFactory
=
TodayCellFactory
(
viewModel
:
viewModel
)
self
.
todayCellFactory
=
TodayCellFactory
(
viewModel
:
viewModel
)
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
}
}
...
@@ -51,8 +53,7 @@ class TodayViewController: UIViewController {
...
@@ -51,8 +53,7 @@ class TodayViewController: UIViewController {
}
}
@objc
private
func
handleCityButton
()
{
@objc
private
func
handleCityButton
()
{
let
locationViewController
=
LocationViewController
(
closeButtonIsHidden
:
false
)
self
.
coordinator
.
openLocationsSearch
()
present
(
locationViewController
,
animated
:
true
)
}
}
@objc
private
func
handleNotificationButton
()
{
@objc
private
func
handleNotificationButton
()
{
...
@@ -71,7 +72,7 @@ private extension TodayViewController {
...
@@ -71,7 +72,7 @@ private extension TodayViewController {
func
prepareNavigationBar
()
{
func
prepareNavigationBar
()
{
//City button
//City button
cityButton
.
isHidden
=
tru
e
cityButton
.
isHidden
=
fals
e
cityButton
.
addTarget
(
self
,
action
:
#selector(
handleCityButton
)
,
for
:
.
touchUpInside
)
cityButton
.
addTarget
(
self
,
action
:
#selector(
handleCityButton
)
,
for
:
.
touchUpInside
)
let
cityBarItem
=
UIBarButtonItem
(
customView
:
cityButton
)
let
cityBarItem
=
UIBarButtonItem
(
customView
:
cityButton
)
...
...
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