-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update after review
- Loading branch information
Showing
28 changed files
with
420 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
Riot/Modules/Spaces/SpaceRoomList/ExploreRoom/ShowSpaceExploreRoomCoordinator.swift
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
Riot/Modules/Spaces/SpaceRoomList/ExploreRoom/ShowSpaceExploreRoomViewModelType.swift
This file was deleted.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
Riot/Modules/Spaces/SpaceRoomList/ExploreRoom/SpaceExploreRoomCoordinator.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// File created from ScreenTemplate | ||
// $ createScreen.sh Spaces/SpaceRoomList/ExploreRoom ShowSpaceExploreRoom | ||
/* | ||
Copyright 2021 New Vector Ltd | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
final class SpaceExploreRoomCoordinator: SpaceExploreRoomCoordinatorType { | ||
|
||
// MARK: - Properties | ||
|
||
// MARK: Private | ||
|
||
private var spaceExploreRoomViewModel: SpaceExploreRoomViewModelType | ||
private let spaceExploreRoomViewController: SpaceExploreRoomViewController | ||
|
||
// MARK: Public | ||
|
||
// Must be used only internally | ||
var childCoordinators: [Coordinator] = [] | ||
|
||
weak var delegate: SpaceExploreRoomCoordinatorDelegate? | ||
|
||
// MARK: - Setup | ||
|
||
init(parameters: SpaceExploreRoomCoordinatorParameters) { | ||
let spaceExploreRoomViewModel = SpaceExploreRoomViewModel(parameters: parameters) | ||
let spaceExploreRoomViewController = SpaceExploreRoomViewController.instantiate(with: spaceExploreRoomViewModel) | ||
self.spaceExploreRoomViewModel = spaceExploreRoomViewModel | ||
self.spaceExploreRoomViewController = spaceExploreRoomViewController | ||
} | ||
|
||
// MARK: - Public methods | ||
|
||
func start() { | ||
self.spaceExploreRoomViewModel.coordinatorDelegate = self | ||
} | ||
|
||
func toPresentable() -> UIViewController { | ||
return self.spaceExploreRoomViewController | ||
} | ||
} | ||
|
||
// MARK: - SpaceExploreRoomViewModelCoordinatorDelegate | ||
extension SpaceExploreRoomCoordinator: SpaceExploreRoomViewModelCoordinatorDelegate { | ||
func spaceExploreRoomViewModel(_ viewModel: SpaceExploreRoomViewModelType, didSelect item: SpaceExploreRoomListItemViewData, from sourceView: UIView?) { | ||
self.delegate?.spaceExploreRoomCoordinator(self, didSelect: item, from: sourceView) | ||
} | ||
|
||
func spaceExploreRoomViewModelDidCancel(_ viewModel: SpaceExploreRoomViewModelType) { | ||
self.delegate?.spaceExploreRoomCoordinatorDidCancel(self) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Riot/Modules/Spaces/SpaceRoomList/ExploreRoom/SpaceExploreRoomCoordinatorParameters.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Copyright 2021 New Vector Ltd | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
struct SpaceExploreRoomCoordinatorParameters { | ||
let session: MXSession | ||
let spaceId: String | ||
let spaceName: String? | ||
} |
29 changes: 29 additions & 0 deletions
29
Riot/Modules/Spaces/SpaceRoomList/ExploreRoom/SpaceExploreRoomCoordinatorType.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// File created from ScreenTemplate | ||
// $ createScreen.sh Spaces/SpaceRoomList/ExploreRoom ShowSpaceExploreRoom | ||
/* | ||
Copyright 2021 New Vector Ltd | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import Foundation | ||
|
||
protocol SpaceExploreRoomCoordinatorDelegate: AnyObject { | ||
func spaceExploreRoomCoordinator(_ coordinator: SpaceExploreRoomCoordinatorType, didSelect item: SpaceExploreRoomListItemViewData, from sourceView: UIView?) | ||
func spaceExploreRoomCoordinatorDidCancel(_ coordinator: SpaceExploreRoomCoordinatorType) | ||
} | ||
|
||
/// `SpaceExploreRoomCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow. | ||
protocol SpaceExploreRoomCoordinatorType: Coordinator, Presentable { | ||
var delegate: SpaceExploreRoomCoordinatorDelegate? { get } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.