Fix some SwiftLint warnings.

This commit is contained in:
Doug
2026-09-10 17:18:45 +01:00
committed by Stefan Ceriu
parent 268ed62af9
commit 5d050f6dfc
12 changed files with 13 additions and 25 deletions
@@ -113,7 +113,7 @@ struct CreateRoomScreen: View {
if let avatarImage = context.viewState.avatarImage {
Image(uiImage: avatarImage)
.resizable()
.aspectRatio(contentMode: .fill)
.scaledToFill()
.scaledFrame(size: 70, relativeTo: .title)
.avatarShape(context.viewState.isSpace ? .roundedRect : .circle, size: 70)
.overlay(alignment: .bottomTrailing) {
@@ -74,7 +74,7 @@ struct TimelineMediaPreviewRedactConfirmationView: View {
mediaProvider: context.mediaProvider) {
Color.compound.bgSubtleSecondary
}
.aspectRatio(contentMode: .fill)
.scaledToFill()
}
.clipShape(RoundedRectangle(cornerRadius: 8))
.accessibilityHidden(true)
@@ -45,7 +45,7 @@ struct NotificationPermissionsScreen: View {
Asset.Images.notificationsPromptGraphic
.swiftUIImage
.resizable()
.aspectRatio(contentMode: .fit)
.scaledToFit()
.accessibilityHidden(true)
}
}
@@ -461,6 +461,7 @@ class TimelineInteractionHandler {
audioPlayerState(for: itemID)?.setPlaybackSpeed(nextSpeed)
}
// swiftlint:disable:next cyclomatic_complexity
func playPauseAudio(for itemID: TimelineItemIdentifier) async {
MXLog.info("Toggle play/pause audio for itemID \(itemID)")
guard let timelineItem = timelineController.timelineItems.firstUsingStableID(itemID) else {
@@ -266,11 +266,11 @@ struct TimelineReplyView: View {
CompoundIcon(\.image)
.padding(4.0)
}
.aspectRatio(contentMode: .fill)
.scaledToFill()
case .iconAsset(let asset):
Image(asset: asset)
.resizable()
.aspectRatio(contentMode: .fit)
.scaledToFit()
.padding(8.0)
case .icon(let keyPath):
CompoundIcon(keyPath, size: .medium, relativeTo: .body)
@@ -79,7 +79,7 @@ struct GalleryItemTileView: View {
size: item.size,
mediaProvider: mediaProvider) { imageView in
imageView
.aspectRatio(contentMode: .fill)
.scaledToFill()
} placeholder: {
placeholder
}
@@ -125,7 +125,7 @@ private struct GalleryListRow: View {
size: item.size,
mediaProvider: mediaProvider) { imageView in
imageView
.aspectRatio(contentMode: .fill)
.scaledToFill()
} placeholder: {
Color.compound.bgSubtleSecondary
}