Fix some warnings
This commit is contained in:
parent
55a0a04e60
commit
96c3e17531
|
@ -58,7 +58,7 @@ final class SafariActivity: UIActivity {
|
|||
}
|
||||
|
||||
Task {
|
||||
await sceneCoordinator?.present(scene: .safari(url: url as URL), from: nil, transition: .safariPresent(animated: true, completion: nil))
|
||||
_ = await sceneCoordinator?.present(scene: .safari(url: url as URL), from: nil, transition: .safariPresent(animated: true, completion: nil))
|
||||
activityDidFinish(true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ extension DataSourceFacade {
|
|||
let alertController = await UIAlertController(for: error, title: nil, preferredStyle: .alert)
|
||||
let okAction = await UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default)
|
||||
await alertController.addAction(okAction)
|
||||
await dependency.coordinator.present(
|
||||
_ = await dependency.coordinator.present(
|
||||
scene: .alertController(alertController: alertController),
|
||||
from: nil,
|
||||
transition: .alertController(animated: true, completion: nil)
|
||||
|
|
|
@ -35,7 +35,7 @@ extension DataSourceFacade {
|
|||
hashtag: tag.name
|
||||
)
|
||||
|
||||
provider.coordinator.present(
|
||||
_ = provider.coordinator.present(
|
||||
scene: .hashtagTimeline(viewModel: hashtagTimelineViewModel),
|
||||
from: provider,
|
||||
transition: .show
|
||||
|
@ -61,7 +61,7 @@ extension DataSourceFacade {
|
|||
hashtag: name
|
||||
)
|
||||
|
||||
provider.coordinator.present(
|
||||
_ = provider.coordinator.present(
|
||||
scene: .hashtagTimeline(viewModel: hashtagTimelineViewModel),
|
||||
from: provider,
|
||||
transition: .show
|
||||
|
|
|
@ -24,7 +24,7 @@ extension DataSourceFacade {
|
|||
item: mediaPreviewItem,
|
||||
transitionItem: mediaPreviewTransitionItem
|
||||
)
|
||||
dependency.coordinator.present(
|
||||
_ = dependency.coordinator.present(
|
||||
scene: .mediaPreview(viewModel: mediaPreviewViewModel),
|
||||
from: dependency,
|
||||
transition: .custom(transitioningDelegate: dependency.mediaPreviewTransitionController)
|
||||
|
|
|
@ -56,13 +56,13 @@ extension DataSourceFacade {
|
|||
url.pathComponents[2] == "statuses" {
|
||||
let statusID = url.pathComponents[3]
|
||||
let threadViewModel = RemoteThreadViewModel(context: provider.context, authContext: provider.authContext, statusID: statusID)
|
||||
await provider.coordinator.present(scene: .thread(viewModel: threadViewModel), from: nil, transition: .show)
|
||||
_ = await provider.coordinator.present(scene: .thread(viewModel: threadViewModel), from: nil, transition: .show)
|
||||
} else {
|
||||
await provider.coordinator.present(scene: .safari(url: url), from: nil, transition: .safariPresent(animated: true, completion: nil))
|
||||
_ = await provider.coordinator.present(scene: .safari(url: url), from: nil, transition: .safariPresent(animated: true, completion: nil))
|
||||
}
|
||||
case .hashtag(_, let hashtag, _):
|
||||
let hashtagTimelineViewModel = HashtagTimelineViewModel(context: provider.context, authContext: provider.authContext, hashtag: hashtag)
|
||||
await provider.coordinator.present(scene: .hashtagTimeline(viewModel: hashtagTimelineViewModel), from: provider, transition: .show)
|
||||
_ = await provider.coordinator.present(scene: .hashtagTimeline(viewModel: hashtagTimelineViewModel), from: provider, transition: .show)
|
||||
case .mention(_, let mention, let userInfo):
|
||||
await coordinateToProfileScene(
|
||||
provider: provider,
|
||||
|
|
|
@ -47,7 +47,7 @@ extension DataSourceFacade {
|
|||
mastodonUser: user
|
||||
)
|
||||
|
||||
provider.coordinator.present(
|
||||
_ = provider.coordinator.present(
|
||||
scene: .profile(viewModel: profileViewModel),
|
||||
from: provider,
|
||||
transition: .show
|
||||
|
@ -75,7 +75,7 @@ extension DataSourceFacade {
|
|||
}
|
||||
|
||||
guard let mention = mentions?.first(where: { $0.username == mention }) else {
|
||||
await provider.coordinator.present(
|
||||
_ = await provider.coordinator.present(
|
||||
scene: .safari(url: url),
|
||||
from: provider,
|
||||
transition: .safariPresent(animated: true, completion: nil)
|
||||
|
@ -102,7 +102,7 @@ extension DataSourceFacade {
|
|||
}
|
||||
}()
|
||||
|
||||
await provider.coordinator.present(
|
||||
_ = await provider.coordinator.present(
|
||||
scene: .profile(viewModel: profileViewModel),
|
||||
from: provider,
|
||||
transition: .show
|
||||
|
|
|
@ -43,7 +43,7 @@ extension DataSourceFacade {
|
|||
dependency: provider,
|
||||
status: status
|
||||
)
|
||||
provider.coordinator.present(
|
||||
_ = provider.coordinator.present(
|
||||
scene: .activityViewController(
|
||||
activityViewController: activityViewController,
|
||||
sourceView: button,
|
||||
|
@ -358,7 +358,8 @@ extension DataSourceFacade {
|
|||
dependency: dependency,
|
||||
status: status
|
||||
)
|
||||
await dependency.coordinator.present(
|
||||
|
||||
_ = dependency.coordinator.present(
|
||||
scene: .activityViewController(
|
||||
activityViewController: activityViewController,
|
||||
sourceView: menuContext.button,
|
||||
|
|
|
@ -487,7 +487,7 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
|
|||
authContext: authContext,
|
||||
kind: .rebloggedBy(status: status)
|
||||
)
|
||||
await coordinator.present(
|
||||
_ = await coordinator.present(
|
||||
scene: .rebloggedBy(viewModel: userListViewModel),
|
||||
from: self,
|
||||
transition: .show
|
||||
|
@ -511,7 +511,7 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
|
|||
authContext: authContext,
|
||||
kind: .favoritedBy(status: status)
|
||||
)
|
||||
await coordinator.present(
|
||||
_ = await coordinator.present(
|
||||
scene: .favoritedBy(viewModel: userListViewModel),
|
||||
from: self,
|
||||
transition: .show
|
||||
|
|
|
@ -143,7 +143,7 @@ extension UITableViewDelegate where Self: DataSourceProvider & MediaPreviewableV
|
|||
title: L10n.Common.Alerts.SavePhotoFailure.title,
|
||||
message: L10n.Common.Alerts.SavePhotoFailure.message
|
||||
)
|
||||
self.coordinator.present(
|
||||
_ = self.coordinator.present(
|
||||
scene: .alertController(alertController: alertController),
|
||||
from: self,
|
||||
transition: .alertController(animated: true, completion: nil)
|
||||
|
|
|
@ -93,10 +93,7 @@ extension ComposeViewController {
|
|||
.sink { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
guard self.traitCollection.userInterfaceIdiom == .pad else { return }
|
||||
var items = [self.publishBarButtonItem]
|
||||
// if self.traitCollection.horizontalSizeClass == .regular {
|
||||
// items.append(self.characterCountBarButtonItem)
|
||||
// }
|
||||
let items = [self.publishBarButtonItem]
|
||||
self.navigationItem.rightBarButtonItems = items
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
|
@ -175,7 +172,7 @@ extension ComposeViewController {
|
|||
let alertController = UIAlertController(for: error, title: nil, preferredStyle: .alert)
|
||||
let okAction = UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default, handler: nil)
|
||||
alertController.addAction(okAction)
|
||||
coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ extension DiscoveryCommunityViewModel.State {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let viewModel else { return }
|
||||
|
||||
switch previousState {
|
||||
case is Reloading:
|
||||
|
|
|
@ -108,7 +108,7 @@ extension DiscoveryHashtagsViewController: UITableViewDelegate {
|
|||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): \(indexPath)")
|
||||
guard case let .hashtag(tag) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return }
|
||||
let hashtagTimelineViewModel = HashtagTimelineViewModel(context: context, authContext: viewModel.authContext, hashtag: tag.name)
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .hashtagTimeline(viewModel: hashtagTimelineViewModel),
|
||||
from: self,
|
||||
transition: .show
|
||||
|
@ -218,7 +218,7 @@ extension DiscoveryHashtagsViewController: TableViewControllerNavigateable {
|
|||
|
||||
guard case let .hashtag(tag) = item else { return }
|
||||
let hashtagTimelineViewModel = HashtagTimelineViewModel(context: context, authContext: viewModel.authContext, hashtag: tag.name)
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .hashtagTimeline(viewModel: hashtagTimelineViewModel),
|
||||
from: self,
|
||||
transition: .show
|
||||
|
|
|
@ -117,7 +117,7 @@ extension DiscoveryNewsViewController: UITableViewDelegate {
|
|||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): \(indexPath)")
|
||||
guard case let .link(link) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return }
|
||||
guard let url = URL(string: link.url) else { return }
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .safari(url: url),
|
||||
from: self,
|
||||
transition: .safariPresent(animated: true, completion: nil)
|
||||
|
@ -214,7 +214,7 @@ extension DiscoveryNewsViewController: TableViewControllerNavigateable {
|
|||
|
||||
guard case let .link(link) = item else { return }
|
||||
guard let url = URL(string: link.url) else { return }
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .safari(url: url),
|
||||
from: self,
|
||||
transition: .safariPresent(animated: true, completion: nil)
|
||||
|
|
|
@ -125,8 +125,7 @@ extension DiscoveryNewsViewModel.State {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
|
||||
guard let viewModel else { return }
|
||||
|
||||
switch previousState {
|
||||
case is Reloading:
|
||||
|
|
|
@ -126,7 +126,7 @@ extension DiscoveryPostsViewModel.State {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let viewModel else { return }
|
||||
|
||||
switch previousState {
|
||||
case is Reloading:
|
||||
|
|
|
@ -70,7 +70,7 @@ extension HashtagTimelineViewModel.State {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let stateMachine = stateMachine else { return }
|
||||
|
||||
stateMachine.enter(Loading.self)
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ extension HashtagTimelineViewModel.State {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let viewModel else { return }
|
||||
|
||||
switch previousState {
|
||||
case is Reloading:
|
||||
|
|
|
@ -300,7 +300,7 @@ extension HomeTimelineViewController {
|
|||
}
|
||||
|
||||
@objc private func showWelcomeAction(_ sender: UIAction) {
|
||||
coordinator.present(scene: .welcome, from: self, transition: .modal(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .welcome, from: self, transition: .modal(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func showRegisterAction(_ sender: UIAction) {
|
||||
|
@ -332,12 +332,12 @@ extension HomeTimelineViewController {
|
|||
|
||||
@objc private func showConfirmEmail(_ sender: UIAction) {
|
||||
let mastodonConfirmEmailViewModel = MastodonConfirmEmailViewModel()
|
||||
coordinator.present(scene: .mastodonConfirmEmail(viewModel: mastodonConfirmEmailViewModel), from: nil, transition: .modal(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .mastodonConfirmEmail(viewModel: mastodonConfirmEmailViewModel), from: nil, transition: .modal(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func showAccountList(_ sender: UIAction) {
|
||||
let accountListViewModel = AccountListViewModel(context: context, authContext: viewModel.authContext)
|
||||
coordinator.present(scene: .accountList(viewModel: accountListViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .accountList(viewModel: accountListViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func showProfileAction(_ sender: UIAction) {
|
||||
|
@ -347,12 +347,12 @@ extension HomeTimelineViewController {
|
|||
guard let self = self else { return }
|
||||
guard let textField = alertController?.textFields?.first else { return }
|
||||
let profileViewModel = RemoteProfileViewModel(context: self.context, authContext: self.viewModel.authContext, userID: textField.text ?? "")
|
||||
self.coordinator.present(scene: .profile(viewModel: profileViewModel), from: self, transition: .show)
|
||||
_ = self.coordinator.present(scene: .profile(viewModel: profileViewModel), from: self, transition: .show)
|
||||
}
|
||||
alertController.addAction(showAction)
|
||||
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
|
||||
alertController.addAction(cancelAction)
|
||||
coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func showThreadAction(_ sender: UIAction) {
|
||||
|
@ -362,12 +362,12 @@ extension HomeTimelineViewController {
|
|||
guard let self = self else { return }
|
||||
guard let textField = alertController?.textFields?.first else { return }
|
||||
let threadViewModel = RemoteThreadViewModel(context: self.context, authContext: self.viewModel.authContext, statusID: textField.text ?? "")
|
||||
self.coordinator.present(scene: .thread(viewModel: threadViewModel), from: self, transition: .show)
|
||||
_ = self.coordinator.present(scene: .thread(viewModel: threadViewModel), from: self, transition: .show)
|
||||
}
|
||||
alertController.addAction(showAction)
|
||||
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
|
||||
alertController.addAction(cancelAction)
|
||||
coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
private func showNotification(_ sender: UIAction, notificationType: Mastodon.Entity.Notification.NotificationType) {
|
||||
|
@ -436,7 +436,7 @@ extension HomeTimelineViewController {
|
|||
authContext: viewModel.authContext,
|
||||
setting: currentSetting
|
||||
)
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .settings(viewModel: settingsViewModel),
|
||||
from: self,
|
||||
transition: .modal(animated: true, completion: nil)
|
||||
|
|
|
@ -388,14 +388,14 @@ extension HomeTimelineViewController {
|
|||
@objc private func manuallySearchButtonPressed(_ sender: UIButton) {
|
||||
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||
let searchDetailViewModel = SearchDetailViewModel(authContext: viewModel.authContext)
|
||||
coordinator.present(scene: .searchDetail(viewModel: searchDetailViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .searchDetail(viewModel: searchDetailViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func settingBarButtonItemPressed(_ sender: UIBarButtonItem) {
|
||||
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||
guard let setting = context.settingService.currentSetting.value else { return }
|
||||
let settingsViewModel = SettingsViewModel(context: context, authContext: viewModel.authContext, setting: setting)
|
||||
coordinator.present(scene: .settings(viewModel: settingsViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .settings(viewModel: settingsViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func refreshControlValueChanged(_ sender: RefreshControl) {
|
||||
|
|
|
@ -62,7 +62,7 @@ extension HomeTimelineViewModel.LoadLatestState {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let viewModel else { return }
|
||||
|
||||
let latestFeedRecords = viewModel.fetchedResultsController.records.prefix(APIService.onceRequestStatusMaxCount)
|
||||
let parentManagedObjectContext = viewModel.fetchedResultsController.fetchedResultsController.managedObjectContext
|
||||
|
|
|
@ -276,7 +276,7 @@ extension MediaPreviewViewController: MediaPreviewImageViewControllerDelegate {
|
|||
title: L10n.Common.Alerts.SavePhotoFailure.title,
|
||||
message: L10n.Common.Alerts.SavePhotoFailure.message
|
||||
)
|
||||
self.coordinator.present(
|
||||
_ = self.coordinator.present(
|
||||
scene: .alertController(alertController: alertController),
|
||||
from: self,
|
||||
transition: .alertController(animated: true, completion: nil)
|
||||
|
|
|
@ -189,7 +189,7 @@ extension MastodonConfirmEmailViewController {
|
|||
alertController.addAction(openEmailAction)
|
||||
alertController.addAction(cancelAction)
|
||||
alertController.preferredAction = openEmailAction
|
||||
self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
_ = self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func resendButtonPressed(_ sender: UIButton) {
|
||||
|
@ -197,18 +197,17 @@ extension MastodonConfirmEmailViewController {
|
|||
let resendAction = UIAlertAction(title: L10n.Scene.ConfirmEmail.DontReceiveEmail.resendEmail, style: .default) { _ in
|
||||
let url = Mastodon.API.resendEmailURL(domain: self.viewModel.authenticateInfo.domain)
|
||||
let viewModel = MastodonResendEmailViewModel(resendEmailURL: url, email: self.viewModel.email)
|
||||
self.coordinator.present(scene: .mastodonResendEmail(viewModel: viewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
_ = self.coordinator.present(scene: .mastodonResendEmail(viewModel: viewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
}
|
||||
let okAction = UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default) { _ in
|
||||
}
|
||||
alertController.addAction(resendAction)
|
||||
alertController.addAction(okAction)
|
||||
self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
_ = self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
func showEmailAppAlert() {
|
||||
let clients = ThirdPartyMailClient.clients
|
||||
let application = UIApplication.shared
|
||||
let availableClients = clients.filter { client -> Bool in
|
||||
ThirdPartyMailer.isMailClientAvailable(client)
|
||||
}
|
||||
|
@ -220,14 +219,14 @@ extension MastodonConfirmEmailViewController {
|
|||
alertController.addAction(alertAction)
|
||||
_ = availableClients.compactMap { client -> UIAlertAction in
|
||||
let alertAction = UIAlertAction(title: client.name, style: .default) { _ in
|
||||
_ = ThirdPartyMailer.open(client, completionHandler: nil)
|
||||
ThirdPartyMailer.open(client, completionHandler: nil)
|
||||
}
|
||||
alertController.addAction(alertAction)
|
||||
return alertAction
|
||||
}
|
||||
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .cancel, handler: nil)
|
||||
alertController.addAction(cancelAction)
|
||||
self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
_ = self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ extension MastodonRegisterViewController: PHPickerViewControllerDelegate {
|
|||
let alertController = UIAlertController(for: error, title: "", preferredStyle: .alert)
|
||||
let okAction = UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default, handler: nil)
|
||||
alertController.addAction(okAction)
|
||||
self.coordinator.present(
|
||||
_ = self.coordinator.present(
|
||||
scene: .alertController(alertController: alertController),
|
||||
from: nil,
|
||||
transition: .alertController(animated: true, completion: nil)
|
||||
|
|
|
@ -46,7 +46,7 @@ extension FavoriteViewModel {
|
|||
extension FavoriteViewModel.State {
|
||||
class Initial: FavoriteViewModel.State {
|
||||
override func isValidNextState(_ stateClass: AnyClass) -> Bool {
|
||||
guard let viewModel = viewModel else { return false }
|
||||
guard viewModel != nil else { return false }
|
||||
switch stateClass {
|
||||
case is Reloading.Type:
|
||||
return true
|
||||
|
@ -130,13 +130,12 @@ extension FavoriteViewModel.State {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let viewModel else { return }
|
||||
|
||||
if previousState is Reloading {
|
||||
maxID = nil
|
||||
}
|
||||
|
||||
|
||||
Task {
|
||||
do {
|
||||
let response = try await viewModel.context.apiService.favoritedStatuses(
|
||||
|
|
|
@ -503,7 +503,7 @@ extension ProfileViewController {
|
|||
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||
guard let setting = context.settingService.currentSetting.value else { return }
|
||||
let settingsViewModel = SettingsViewModel(context: context, authContext: viewModel.authContext, setting: setting)
|
||||
coordinator.present(scene: .settings(viewModel: settingsViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .settings(viewModel: settingsViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||
}
|
||||
|
||||
@objc private func shareBarButtonItemPressed(_ sender: UIBarButtonItem) {
|
||||
|
|
|
@ -134,7 +134,7 @@ extension UserListViewModel.State {
|
|||
maxID = nil
|
||||
}
|
||||
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let viewModel = viewModel else { return }
|
||||
|
||||
let maxID = self.maxID
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ extension ReportViewController: ReportServerRulesViewControllerDelegate {
|
|||
return
|
||||
}
|
||||
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .reportStatus(viewModel: viewModel.reportStatusViewModel),
|
||||
from: self,
|
||||
transition: .show
|
||||
|
|
|
@ -75,7 +75,7 @@ extension ReportStatusViewModel.State {
|
|||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
||||
guard let viewModel else { return }
|
||||
|
||||
let maxID = viewModel.statusFetchedResultsController.statusIDs.last
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ extension MainTabBarController {
|
|||
let alertController = UIAlertController(for: error, title: nil, preferredStyle: .alert)
|
||||
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
|
||||
alertController.addAction(okAction)
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .alertController(alertController: alertController),
|
||||
from: nil,
|
||||
transition: .alertController(animated: true, completion: nil)
|
||||
|
|
|
@ -174,7 +174,7 @@ extension SearchViewController {
|
|||
// FIXME:
|
||||
// use `.customPush(animated: false)` false to disable navigation bar animation for searchBar layout
|
||||
// but that should be a fade transition whe fixed size searchBar
|
||||
self.coordinator.present(scene: .searchDetail(viewModel: searchDetailViewModel), from: self, transition: .customPush(animated: false))
|
||||
_ = self.coordinator.present(scene: .searchDetail(viewModel: searchDetailViewModel), from: self, transition: .customPush(animated: false))
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
}
|
||||
|
|
|
@ -401,7 +401,7 @@ extension SettingsViewController: UITableViewDelegate {
|
|||
)
|
||||
let okAction = UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default, handler: nil)
|
||||
alertController.addAction(okAction)
|
||||
self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
||||
_ = self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
case .signOut:
|
||||
|
@ -549,7 +549,7 @@ extension SettingsViewController: MetaLabelDelegate {
|
|||
switch meta {
|
||||
case .url(_, _, let url, _):
|
||||
guard let url = URL(string: url) else { return }
|
||||
coordinator.present(scene: .safari(url: url), from: self, transition: .safariPresent(animated: true, completion: nil))
|
||||
_ = coordinator.present(scene: .safari(url: url), from: self, transition: .safariPresent(animated: true, completion: nil))
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ extension SuggestionAccountViewController: UITableViewDelegate {
|
|||
case .account(let record):
|
||||
guard let account = record.object(in: context.managedObjectContext) else { return }
|
||||
let cachedProfileViewModel = CachedProfileViewModel(context: context, authContext: viewModel.authContext, mastodonUser: account)
|
||||
coordinator.present(
|
||||
_ = coordinator.present(
|
||||
scene: .profile(viewModel: cachedProfileViewModel),
|
||||
from: self,
|
||||
transition: .show
|
||||
|
|
|
@ -263,7 +263,7 @@ extension MediaHostToMediaPreviewViewControllerAnimatedTransitioning {
|
|||
}()
|
||||
|
||||
// FIXME:
|
||||
let maskLayerToFinalPath = maskLayerToFinalRect.flatMap { UIBezierPath(rect: $0) }?.cgPath
|
||||
_ = maskLayerToFinalRect.flatMap { UIBezierPath(rect: $0) }?.cgPath
|
||||
|
||||
if let maskLayerToPath = maskLayerToPath {
|
||||
maskLayer.path = maskLayerToPath
|
||||
|
|
|
@ -17,7 +17,7 @@ extension AttachmentViewModel {
|
|||
let exporter = NextLevelSessionExporter(withAsset: urlAsset)
|
||||
exporter.outputFileType = .mp4
|
||||
|
||||
var isLandscape: Bool = {
|
||||
let isLandscape: Bool = {
|
||||
guard let track = urlAsset.tracks(withMediaType: .video).first else {
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -105,7 +105,6 @@ extension NotificationView.ViewModel {
|
|||
timestampUpdatePublisher.prepend(Date()).eraseToAnyPublisher()
|
||||
)
|
||||
.sink { [weak self] timestamp, _ in
|
||||
guard let self = self else { return }
|
||||
guard let timestamp = timestamp else {
|
||||
notificationView.dateLabel.configure(content: PlaintextMetaContent(string: ""))
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue