diff options
| author | mojganii <mojgan.jelodar@codic.se> | 2024-03-11 16:11:33 +0100 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2024-03-12 08:31:23 +0100 |
| commit | 8506380b6f7453720faccf692b60ffd8a1bc112e (patch) | |
| tree | d6b462d48943d756e9e29cbce2a2c3dfc5633331 /ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift | |
| parent | 1c89cd07fb90e23dd52a5e9441a2d144e913a7c3 (diff) | |
| download | mullvadvpn-8506380b6f7453720faccf692b60ffd8a1bc112e.tar.xz mullvadvpn-8506380b6f7453720faccf692b60ffd8a1bc112e.zip | |
adding section header view in select location
- each section should have its own distinct header view.
- custom list section has an action that should take user to add/edit custom list.it will be coming during upcoming changes.
- refactoring location cell
- removing LocationCellFactory
Diffstat (limited to 'ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift')
| -rw-r--r-- | ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift index 3c37884544..baa3cce181 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift @@ -83,7 +83,7 @@ final class LocationViewController: UIViewController { }) ) - setUpDataSource() + setUpDataSources() setUpTableView() setUpTopContent() @@ -119,17 +119,24 @@ final class LocationViewController: UIViewController { // MARK: - Private - private func setUpDataSource() { + private func setUpDataSources() { + let allLocationDataSource = AllLocationDataSource() + let customListsDataSource = CustomListsDataSource(repository: customListRepository) dataSource = LocationDataSource( tableView: tableView, - allLocations: AllLocationDataSource(), - customLists: CustomListsDataSource(repository: customListRepository) + allLocations: allLocationDataSource, + customLists: customListsDataSource ) dataSource?.didSelectRelayLocations = { [weak self] locations in self?.didSelectRelays?(locations) } + dataSource?.didTapEditCustomLists = { [weak self] in + guard let self else { return } + delegate?.didRequestRouteToCustomLists(self) + } + if let cachedRelays { dataSource?.setRelays(cachedRelays.relays, selectedLocations: relayLocations, filter: filter) } |
