diff --git a/apps/mobile/native/TabletSidebar.swift b/apps/mobile/native/TabletSidebar.swift index 9d1b477..acd741b 100644 --- a/apps/mobile/native/TabletSidebar.swift +++ b/apps/mobile/native/TabletSidebar.swift @@ -44,7 +44,9 @@ final class TabletSidebarView: ExpoView { let onPlaylistPress = EventDispatcher() var playlists: [SidebarPlaylist] = [] private let selectionProxy = SidebarSelectionProxy() - private var playlistTabs: [String: UITab] = [:] + /// Playlist rows by identifier. Typed loosely because stored properties + /// can't be gated to iOS 18, where `UITab` arrives; values are always `UITab`. + private var playlistTabs: [String: NSObject] = [:] private var coverImages: [String: UIImage] = [:] private var coverTasks: [String: URLSessionDataTask] = [:] var accountName = "" @@ -201,7 +203,7 @@ extension TabletSidebarView { var rows: [UITab] = [] for playlist in playlists { let identifier = playlistTabPrefix + playlist.id - let tab = playlistTabs[identifier] ?? UITab( + let tab = playlistTabs[identifier] as? UITab ?? UITab( title: playlist.title, image: nil, identifier: identifier, viewControllerProvider: { _ in UIViewController() }) playlistTabs[identifier] = tab @@ -233,7 +235,7 @@ extension TabletSidebarView { guard let self else { return } self.coverTasks[url] = nil self.coverImages[url] = roundedIcon(image) - if let tab = self.playlistTabs[identifier] { tab.image = self.coverImages[url] } + if let tab = self.playlistTabs[identifier] as? UITab { tab.image = self.coverImages[url] } } } coverTasks[url] = task