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
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
6 deletions
+70
-6
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
+0
-0
1Weather/UI/View controllers/Today/TodayViewController.swift
+5
-4
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
c7d6b24e
...
...
@@ -115,6 +115,7 @@
CDE2BF222609D4250085C930
/* ForecastWindSpeedCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDE2BF212609D4250085C930
/* ForecastWindSpeedCell.swift */
;
};
CDE2BF252609D9140085C930
/* ForecastWindButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDE2BF242609D9140085C930
/* ForecastWindButton.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 */
;
};
CE578FE525FB415F00E8B85D
/* CityCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE225FB415F00E8B85D
/* CityCell.swift */
;
};
CE578FE625FB415F00E8B85D
/* LocationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE325FB415F00E8B85D
/* LocationViewController.swift */
;
};
...
...
@@ -265,6 +266,7 @@
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>"
;
};
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>"
;
};
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>"
;
};
...
...
@@ -448,6 +450,7 @@
CD32CE0A260C744A00235081
/* MenuCoordinator.swift */
,
CD37D3F2260DF4FB002669D6
/* SettingsCoordinator.swift */
,
CD866A75260F77C500E96A5C
/* SettingsDetailsCoordinator.swift */
,
CDF9BF8D26133D050037847D
/* LocationSearchCoordinator.swift */
,
);
path
=
Coordinators
;
sourceTree
=
"<group>"
;
...
...
@@ -1088,6 +1091,7 @@
CDE2BF252609D9140085C930
/* ForecastWindButton.swift in Sources */
,
CD32CE16260C77C600235081
/* MenuHeaderButton.swift in Sources */
,
CD251ED82603633800ED7A65
/* ForecastPrecipitationCell.swift in Sources */
,
CDF9BF8E26133D050037847D
/* LocationSearchCoordinator.swift in Sources */
,
CD86246125E662BC0097F3FB
/* SunUvLineView.swift in Sources */
,
CD32CE0B260C744A00235081
/* MenuCoordinator.swift in Sources */
,
CEC526FA25E7959A00DA58A5
/* WeatherSource.swift in Sources */
,
...
...
@@ -1110,7 +1114,6 @@
CD17C5F625D15B4400EE884E
/* TodayViewController.swift in Sources */
,
CD86245E25E646350097F3FB
/* SunUvView.swift in Sources */
,
CEAFF08325DFC67F00DF4EBF
/* Location.swift in Sources */
,
CD8E040D25F8F3D2001785B6
/* ForecastTimePeriodCell.swift in Sources */
,
87C171EC25FF79CC00DA3464
/* EnvironmentManager.swift in Sources */
,
CD82300725D6A73F00A05501
/* TodayConditionButton.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 {
}
func
start
()
{
let
todayViewController
=
TodayViewController
()
let
todayViewController
=
TodayViewController
(
coordinator
:
self
)
navigationController
.
viewControllers
=
[
todayViewController
]
tabBarController
?
.
add
(
viewController
:
navigationController
)
}
func
openLocationsSearch
()
{
let
searchCoordinator
=
LocationSearchCoordinator
(
parentViewController
:
navigationController
)
searchCoordinator
.
parentCoordinator
=
self
searchCoordinator
.
start
()
}
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 @@
//General
"general.close" = "close";
"general.more" = "more";
"general.search" = "search";
//Forecast
"forecast.sunny" = "Sunny";
...
...
@@ -94,6 +95,11 @@
"tabBar.menu" = "menu";
// 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.deleteError" = "Failed to delete 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
1Weather/UI/View controllers/Today/TodayViewController.swift
View file @
c7d6b24e
...
...
@@ -10,6 +10,7 @@ import CoreLocation
class
TodayViewController
:
UIViewController
{
//Private
private
let
coordinator
:
TodayCoordinator
private
let
viewModel
=
TodayViewModel
()
private
let
todayCellFactory
:
TodayCellFactory
private
let
cityButton
=
NavigationCityButton
()
...
...
@@ -22,7 +23,8 @@ class TodayViewController: UIViewController {
}
}
init
()
{
init
(
coordinator
:
TodayCoordinator
)
{
self
.
coordinator
=
coordinator
self
.
todayCellFactory
=
TodayCellFactory
(
viewModel
:
viewModel
)
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
}
...
...
@@ -51,8 +53,7 @@ class TodayViewController: UIViewController {
}
@objc
private
func
handleCityButton
()
{
let
locationViewController
=
LocationViewController
(
closeButtonIsHidden
:
false
)
present
(
locationViewController
,
animated
:
true
)
self
.
coordinator
.
openLocationsSearch
()
}
@objc
private
func
handleNotificationButton
()
{
...
...
@@ -71,7 +72,7 @@ private extension TodayViewController {
func
prepareNavigationBar
()
{
//City button
cityButton
.
isHidden
=
tru
e
cityButton
.
isHidden
=
fals
e
cityButton
.
addTarget
(
self
,
action
:
#selector(
handleCityButton
)
,
for
:
.
touchUpInside
)
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