From a006518b3e23499be9809de26115b4d7697243d7 Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Thu, 19 Nov 2026 19:02:28 -0500 Subject: [PATCH] fix(mobile): build the iPad sidebar below iOS 18 Co-Authored-By: Claude Opus 5.5 --- apps/mobile/native/TabletSidebar.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 -- 2.54.1