Compare commits
1
Commits
@@ -44,7 +44,9 @@ final class TabletSidebarView: ExpoView {
|
|||||||
let onPlaylistPress = EventDispatcher()
|
let onPlaylistPress = EventDispatcher()
|
||||||
var playlists: [SidebarPlaylist] = []
|
var playlists: [SidebarPlaylist] = []
|
||||||
private let selectionProxy = SidebarSelectionProxy()
|
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 coverImages: [String: UIImage] = [:]
|
||||||
private var coverTasks: [String: URLSessionDataTask] = [:]
|
private var coverTasks: [String: URLSessionDataTask] = [:]
|
||||||
var accountName = ""
|
var accountName = ""
|
||||||
@@ -201,7 +203,7 @@ extension TabletSidebarView {
|
|||||||
var rows: [UITab] = []
|
var rows: [UITab] = []
|
||||||
for playlist in playlists {
|
for playlist in playlists {
|
||||||
let identifier = playlistTabPrefix + playlist.id
|
let identifier = playlistTabPrefix + playlist.id
|
||||||
let tab = playlistTabs[identifier] ?? UITab(
|
let tab = playlistTabs[identifier] as? UITab ?? UITab(
|
||||||
title: playlist.title, image: nil, identifier: identifier,
|
title: playlist.title, image: nil, identifier: identifier,
|
||||||
viewControllerProvider: { _ in UIViewController() })
|
viewControllerProvider: { _ in UIViewController() })
|
||||||
playlistTabs[identifier] = tab
|
playlistTabs[identifier] = tab
|
||||||
@@ -233,7 +235,7 @@ extension TabletSidebarView {
|
|||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
self.coverTasks[url] = nil
|
self.coverTasks[url] = nil
|
||||||
self.coverImages[url] = roundedIcon(image)
|
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
|
coverTasks[url] = task
|
||||||
|
|||||||
Reference in new issue
Block a user