chore: suppress warnings

This commit is contained in:
CMK 2022-05-07 11:42:10 +08:00
parent cc13ad2459
commit 8aa8825269
23 changed files with 34 additions and 53 deletions

View File

@ -537,7 +537,6 @@
DBCBED1726132DB500B49291 /* UserTimelineViewModel+Diffable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCBED1626132DB500B49291 /* UserTimelineViewModel+Diffable.swift */; };
DBCBED1D26132E1A00B49291 /* StatusFetchedResultsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCBED1C26132E1A00B49291 /* StatusFetchedResultsController.swift */; };
DBCC3B30261440A50045B23D /* UITabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCC3B2F261440A50045B23D /* UITabBarController.swift */; };
DBCC3B36261440BA0045B23D /* UINavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCC3B35261440BA0045B23D /* UINavigationController.swift */; };
DBCC3B8F26148F7B0045B23D /* CachedProfileViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCC3B8E26148F7B0045B23D /* CachedProfileViewModel.swift */; };
DBCC3B9526157E6E0045B23D /* APIService+Relationship.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCC3B9426157E6E0045B23D /* APIService+Relationship.swift */; };
DBCCC71E25F73297007E1AB6 /* APIService+Reblog.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCCC71D25F73297007E1AB6 /* APIService+Reblog.swift */; };
@ -1302,7 +1301,6 @@
DBCBED1626132DB500B49291 /* UserTimelineViewModel+Diffable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserTimelineViewModel+Diffable.swift"; sourceTree = "<group>"; };
DBCBED1C26132E1A00B49291 /* StatusFetchedResultsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusFetchedResultsController.swift; sourceTree = "<group>"; };
DBCC3B2F261440A50045B23D /* UITabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITabBarController.swift; sourceTree = "<group>"; };
DBCC3B35261440BA0045B23D /* UINavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UINavigationController.swift; sourceTree = "<group>"; };
DBCC3B8E26148F7B0045B23D /* CachedProfileViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CachedProfileViewModel.swift; sourceTree = "<group>"; };
DBCC3B9426157E6E0045B23D /* APIService+Relationship.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "APIService+Relationship.swift"; sourceTree = "<group>"; };
DBCCC71D25F73297007E1AB6 /* APIService+Reblog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "APIService+Reblog.swift"; sourceTree = "<group>"; };
@ -2792,7 +2790,6 @@
2D84350425FF858100EECE90 /* UIScrollView.swift */,
DB9E0D6E25EE008500CFDD76 /* UIInterpolatingMotionEffect.swift */,
DBCC3B2F261440A50045B23D /* UITabBarController.swift */,
DBCC3B35261440BA0045B23D /* UINavigationController.swift */,
DB73BF4827140BA300781945 /* UICollectionViewDiffableDataSource.swift */,
DB73BF4A27140C0800781945 /* UITableViewDiffableDataSource.swift */,
);
@ -4029,7 +4026,6 @@
DB9D7C21269824B80054B3DF /* APIService+Filter.swift in Sources */,
2D38F1E525CD46C100561493 /* HomeTimelineViewModel.swift in Sources */,
DB0FCB842796B2A2006C02E2 /* FavoriteViewController+DataSourceProvider.swift in Sources */,
DBCC3B36261440BA0045B23D /* UINavigationController.swift in Sources */,
DB0FCB68279507EF006C02E2 /* DataSourceFacade+Meta.swift in Sources */,
DB63F75C279956D000455B82 /* Persistence+Tag.swift in Sources */,
2D84350525FF858100EECE90 /* UIScrollView.swift in Sources */,

View File

@ -109,7 +109,7 @@
<key>MastodonIntent.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>35</integer>
<integer>20</integer>
</dict>
<key>MastodonIntents.xcscheme_^#shared#^_</key>
<dict>
@ -124,12 +124,12 @@
<key>NotificationService.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>36</integer>
<integer>19</integer>
</dict>
<key>ShareActionExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>37</integer>
<integer>21</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>

View File

@ -309,7 +309,7 @@ extension SceneCoordinator {
if scene.isOnboarding {
return OnboardingNavigationController(rootViewController: viewController)
} else {
return UINavigationController(rootViewController: viewController)
return AdaptiveStatusBarStyleNavigationController(rootViewController: viewController)
}
}()
modalNavigationController.modalPresentationCapturesStatusBarAppearance = true

View File

@ -29,7 +29,7 @@ extension PickServerSection {
weak dependency,
weak pickServerCellDelegate
] tableView, indexPath, item -> UITableViewCell? in
guard let dependency = dependency else { return nil }
guard let _ = dependency else { return nil }
switch item {
case .header:
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: OnboardingHeadlineTableViewCell.self), for: indexPath) as! OnboardingHeadlineTableViewCell

View File

@ -51,7 +51,7 @@ extension SettingsSection {
}
cell.delegate = settingsAppearanceTableViewCellDelegate
return cell
case .appearancePreference(let record, let appearanceType):
case .appearancePreference(let record, _):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SettingsToggleTableViewCell.self), for: indexPath) as! SettingsToggleTableViewCell
cell.delegate = settingsToggleCellDelegate
managedObjectContext.performAndWait {

View File

@ -7,13 +7,12 @@
import MastodonSDK
extension Mastodon.Entity.Tag: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(name)
}
public static func == (lhs: Mastodon.Entity.Tag, rhs: Mastodon.Entity.Tag) -> Bool {
return lhs.name == rhs.name
}
}
//extension Mastodon.Entity.Tag: Hashable {
// public func hash(into hasher: inout Hasher) {
// hasher.combine(name)
// }
//
// public static func == (lhs: Mastodon.Entity.Tag, rhs: Mastodon.Entity.Tag) -> Bool {
// return lhs.name == rhs.name
// }
//}

View File

@ -1,16 +0,0 @@
//
// UINavigationController.swift
// Mastodon
//
// Created by MainasuK Cirno on 2021-3-31.
//
import UIKit
// This not works!
// SeeAlso: `AdaptiveStatusBarStyleNavigationController`
extension UINavigationController {
open override var childForStatusBarStyle: UIViewController? {
return visibleViewController
}
}

View File

@ -99,7 +99,7 @@ extension DataSourceFacade {
try await managedObjectContext.performChanges {
guard let authenticationBox = _authenticationBox else { return }
guard let me = authenticationBox.authenticationRecord.object(in: managedObjectContext)?.user else { return }
guard let _ = authenticationBox.authenticationRecord.object(in: managedObjectContext)?.user else { return }
let request = SearchHistory.sortedFetchRequest
request.predicate = SearchHistory.predicate(
domain: authenticationBox.domain,

View File

@ -486,7 +486,7 @@ extension NotificationTableViewCellDelegate where Self: DataSourceProvider {
provider: self,
user: user
)
case .notification(let notification):
case .notification:
assertionFailure("TODO")
default:
assertionFailure("TODO")

View File

@ -494,7 +494,7 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider {
provider: self,
user: user
)
case .notification(let notification):
case .notification:
assertionFailure("TODO")
default:
assertionFailure("TODO")

View File

@ -138,7 +138,7 @@ extension TableViewControllerNavigateableCore where Self: DataSourceProvider {
target: .status,
status: record
)
case .notification(let record):
case .notification:
assertionFailure()
default:
assertionFailure()

View File

@ -93,7 +93,7 @@ extension UITableViewDelegate where Self: DataSourceProvider & MediaPreviewableV
guard let image = mediaView.thumbnail(),
let assetURLString = mediaView.configuration?.assetURL,
let assetURL = URL(string: assetURLString),
let resourceType = mediaView.configuration?.resourceType
let _ = mediaView.configuration?.resourceType
else {
// not provide preview unless thumbnail ready
return nil

View File

@ -118,7 +118,7 @@ extension AccountListViewController {
// the presentingViewController may deinit.
// Hold it and check the window to prevent PanModel crash
guard let presentingViewController = presentingViewController else { return }
guard let _ = presentingViewController else { return }
guard self.view.window != nil else { return }
self.hasLoaded = true

View File

@ -77,7 +77,7 @@ extension AutoCompleteViewModel.State {
override func didEnter(from previousState: GKState?) {
super.didEnter(from: previousState)
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
guard let viewModel = viewModel, let _ = stateMachine else { return }
let searchText = viewModel.inputText.value
let searchType = AutoCompleteViewModel.SearchType(inputText: searchText) ?? .default

View File

@ -68,7 +68,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, let stateMachine = stateMachine else { return }
stateMachine.enter(Loading.self)
}

View File

@ -186,7 +186,7 @@ extension HomeTimelineViewController {
}
func match(item: StatusItem) -> Bool {
let authenticationBox = AppContext.shared.authenticationService.activeMastodonAuthenticationBox.value
// let authenticationBox = AppContext.shared.authenticationService.activeMastodonAuthenticationBox.value
switch item {
case .feed(let record):
guard let feed = record.object(in: AppContext.shared.managedObjectContext) else { return false }

View File

@ -634,7 +634,7 @@ extension ProfileViewController {
return nil
}
let name = user.displayNameWithFallback
let record = ManagedObjectRecord<MastodonUser>(objectID: user.objectID)
let _ = ManagedObjectRecord<MastodonUser>(objectID: user.objectID)
let menu = MastodonMenu.setupMenu(
actions: [
.muteUser(.init(name: name, isMuting: self.viewModel.isMuting.value)),
@ -649,7 +649,7 @@ extension ProfileViewController {
.sink { [weak self] completion in
guard let self = self else { return }
switch completion {
case .failure(let error):
case .failure:
self.moreMenuBarButtonItem.menu = nil
case .finished:
break

View File

@ -154,10 +154,9 @@ extension SidebarViewController {
coordinator.animate { context in
self.collectionView.collectionViewLayout.invalidateLayout()
} completion: { [weak self] context in
// guard let self = self else { return }
} completion: { context in
// do nothing
}
}
}

View File

@ -448,7 +448,7 @@ extension SettingsViewController: SettingsAppearanceTableViewCellDelegate {
guard let dataSource = viewModel.dataSource else { return }
guard let indexPath = tableView.indexPath(for: cell) else { return }
let item = dataSource.itemIdentifier(for: indexPath)
guard case let .appearance(record) = item else { return }
guard case .appearance = item else { return }
Task { @MainActor in
switch appearanceMode {

View File

@ -255,6 +255,8 @@ extension MediaHostToMediaPreviewViewControllerAnimatedTransitioning {
rect.size.height -= offset
return rect
}()
// FIXME:
let maskLayerToFinalPath = maskLayerToFinalRect.flatMap { UIBezierPath(rect: $0) }?.cgPath
if let maskLayerToPath = maskLayerToPath {

View File

@ -34,7 +34,7 @@ extension APIService {
let value = response.value.ancestors + response.value.descendants
for entity in value {
Persistence.Status.createOrMerge(
_ = Persistence.Status.createOrMerge(
in: managedObjectContext,
context: Persistence.Status.PersistContext(
domain: domain,

View File

@ -95,7 +95,7 @@ extension InstanceService {
self.logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Instance] update instance for domain: \(domain)")
}
} receiveValue: { [weak self] response in
guard let self = self else { return }
guard let _ = self else { return }
// do nothing
}
.store(in: &disposeBag)

View File

@ -14,4 +14,5 @@ extension UIImage {
self.draw(in: CGRect(origin: .zero, size: size))
}
}
}