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
fb14d803
Commit
fb14d803
authored
Mar 27, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing file to commit
parent
b27b7c66
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
1Weather/UI/View controllers/Settings/SettingsDetilsViewController.swift
+69
-0
No files found.
1Weather/UI/View controllers/Settings/SettingsDetilsViewController.swift
0 → 100644
View file @
fb14d803
//
// SettingsDetailsViewController.swift
// 1Weather
//
// Created by Dmitry Stepanets on 27.03.2021.
//
import
UIKit
class
SettingsDetailsViewController
:
UIViewController
{
//Private
private
let
viewModel
:
SettingsDetailsViewModel
private
let
coordinator
:
SettingsCoordinator
private
let
cellFactory
:
SettingsDetailsCellFactory
private
let
tableView
=
UITableView
()
init
(
coordinator
:
SettingsCoordinator
,
settingsRow
:
SettingsRow
)
{
self
.
coordinator
=
coordinator
self
.
viewModel
=
SettingsDetailsViewModel
(
rowType
:
settingsRow
)
self
.
cellFactory
=
SettingsDetailsCellFactory
(
viewModel
:
self
.
viewModel
)
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
prepareController
()
prepareTable
()
}
}
//MARK:- Prepare
private
extension
SettingsDetailsViewController
{
func
prepareController
()
{
navigationItem
.
title
=
viewModel
.
rowType
.
localizedName
}
func
prepareTable
()
{
cellFactory
.
registerCells
(
on
:
tableView
)
tableView
.
separatorStyle
=
.
none
tableView
.
dataSource
=
self
tableView
.
delegate
=
self
tableView
.
separatorStyle
=
.
none
tableView
.
tableFooterView
=
UIView
()
tableView
.
rowHeight
=
UITableView
.
automaticDimension
tableView
.
estimatedRowHeight
=
UITableView
.
automaticDimension
view
.
addSubview
(
tableView
)
}
}
//MARK:- UITableView Data Source
extension
SettingsDetailsViewController
:
UITableViewDataSource
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
cellFactory
.
numberOfRows
(
inSection
:
section
)
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
return
cellFactory
.
cellFromTableView
(
tableView
:
tableView
,
indexPath
:
indexPath
)
}
}
//MARK:- UITableView Delegate
extension
SettingsDetailsViewController
:
UITableViewDelegate
{
}
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