[PR #246] [MERGED] 添加 iPad 支持 #321

Closed
opened 2026-03-03 11:42:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Finb/Bark/pull/246
Author: @iGuan7u
Created: 8/17/2024
Status: Merged
Merged: 9/2/2024
Merged by: @Finb

Base: masterHead: master


📝 Commits (7)

  • 5115ff6 添加 iPad 支持
  • 1ff06ff 兼容 iOS13
  • 8cd40a8 在 iOS14 上使用BarkSplitViewController,iOS13使用 UITabBarController
  • 45d4427 添加 BarkTabBarController
  • 402b19a iPad下让左侧导航栏一直显示
  • ad7f7dc 去掉 ViewModel 中的UIKit 引入
  • 55a0533 同步 sectionViewController 和 compactController 当前显示页面

📊 Changes

13 files changed (+346 additions, -64 deletions)

View changed files

📝 Bark.xcodeproj/project.pbxproj (+22 -2)
📝 Bark/AppDelegate.swift (+8 -20)
📝 Common/Client.swift (+5 -5)
Controller/BarkSplitViewController.swift (+50 -0)
Controller/BarkTabBarController.swift (+30 -0)
📝 Controller/BaseViewController.swift (+5 -1)
📝 Controller/GroupFilterViewModel.swift (+2 -2)
📝 Controller/MessageListViewController.swift (+43 -18)
📝 Controller/MessageListViewModel.swift (+13 -9)
📝 Controller/MessageSettingsViewController.swift (+21 -5)
Controller/SectionViewController-iPad.swift (+84 -0)
Controller/SectionViewModel-iPad.swift (+50 -0)
📝 Controller/ServerListViewController.swift (+13 -2)

📄 Description

看到 这个 issue有感,这么实用的应用如果能支持 iPad 就更好了,Swift/RX 苦手,略尽绵力。

代码改动似乎不小,以下希望能帮助 Review:

  • Bark/AppDelegate 增加判断版本跟设备型号,如果是 iPad 设备改用系统的 UISplitViewController 承载
  • iPad 布局代码:BarkSplitViewController, SectionViewController-iPad, SectionViewModel-iPad
  • 其他的改动都是为了适配 iPad actionSheet 的展示,由 rx.modelSelected 改为 rx.itemSelected,改由增加传递 indexPath,方便 actionSheet popover 能正确定位 sourceView,否则 iPad 下单纯展示 actionSheet 会直接出现崩溃

已自测已知路径,能正常支持 iPad 分屏模式:
Simulator Screenshot - iPad Air (5th generation) - 2024-08-17 at 17 15 18
Simulator Screenshot - iPad Air (5th generation) - 2024-08-17 at 17 17 24
Simulator Screenshot - iPad Air (5th generation) - 2024-08-17 at 17 17 45


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Finb/Bark/pull/246 **Author:** [@iGuan7u](https://github.com/iGuan7u) **Created:** 8/17/2024 **Status:** ✅ Merged **Merged:** 9/2/2024 **Merged by:** [@Finb](https://github.com/Finb) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (7) - [`5115ff6`](https://github.com/Finb/Bark/commit/5115ff6d43523f5391f5909bbbf33a12aecd8df3) 添加 iPad 支持 - [`1ff06ff`](https://github.com/Finb/Bark/commit/1ff06ff48106fab71d84f47cc3043806af5b1a89) 兼容 iOS13 - [`8cd40a8`](https://github.com/Finb/Bark/commit/8cd40a83955d23d0c0dd48f578050307fb96a324) 在 iOS14 上使用BarkSplitViewController,iOS13使用 UITabBarController - [`45d4427`](https://github.com/Finb/Bark/commit/45d4427d2ecb88a51d6fbc4eb953575fd872d220) 添加 BarkTabBarController - [`402b19a`](https://github.com/Finb/Bark/commit/402b19a0bdf6ac19779e6ebaf111860708242780) iPad下让左侧导航栏一直显示 - [`ad7f7dc`](https://github.com/Finb/Bark/commit/ad7f7dc23ba85f4d82103a8353429804691812ac) 去掉 ViewModel 中的UIKit 引入 - [`55a0533`](https://github.com/Finb/Bark/commit/55a0533864046d84bd849289424fed88c65fc592) 同步 sectionViewController 和 compactController 当前显示页面 ### 📊 Changes **13 files changed** (+346 additions, -64 deletions) <details> <summary>View changed files</summary> 📝 `Bark.xcodeproj/project.pbxproj` (+22 -2) 📝 `Bark/AppDelegate.swift` (+8 -20) 📝 `Common/Client.swift` (+5 -5) ➕ `Controller/BarkSplitViewController.swift` (+50 -0) ➕ `Controller/BarkTabBarController.swift` (+30 -0) 📝 `Controller/BaseViewController.swift` (+5 -1) 📝 `Controller/GroupFilterViewModel.swift` (+2 -2) 📝 `Controller/MessageListViewController.swift` (+43 -18) 📝 `Controller/MessageListViewModel.swift` (+13 -9) 📝 `Controller/MessageSettingsViewController.swift` (+21 -5) ➕ `Controller/SectionViewController-iPad.swift` (+84 -0) ➕ `Controller/SectionViewModel-iPad.swift` (+50 -0) 📝 `Controller/ServerListViewController.swift` (+13 -2) </details> ### 📄 Description 看到 [这个 issue](https://github.com/Finb/Bark/issues/118)有感,这么实用的应用如果能支持 iPad 就更好了,Swift/RX 苦手,略尽绵力。 代码改动似乎不小,以下希望能帮助 Review: - Bark/AppDelegate 增加判断版本跟设备型号,如果是 iPad 设备改用系统的 UISplitViewController 承载 - iPad 布局代码:BarkSplitViewController, SectionViewController-iPad, SectionViewModel-iPad - 其他的改动都是为了适配 iPad actionSheet 的展示,由 `rx.modelSelected` 改为 `rx.itemSelected`,改由增加传递 indexPath,方便 actionSheet popover 能正确定位 sourceView,否则 iPad 下单纯展示 actionSheet 会直接出现崩溃 已自测已知路径,能正常支持 iPad 分屏模式: ![Simulator Screenshot - iPad Air (5th generation) - 2024-08-17 at 17 15 18](https://github.com/user-attachments/assets/2150cc12-acba-48a7-946f-2e9c7f4a5ce6) ![Simulator Screenshot - iPad Air (5th generation) - 2024-08-17 at 17 17 24](https://github.com/user-attachments/assets/591161ba-ffd0-498a-b53f-474c4a0bec7b) ![Simulator Screenshot - iPad Air (5th generation) - 2024-08-17 at 17 17 45](https://github.com/user-attachments/assets/6a7b6135-ce73-4705-a0bc-77081adc03f0) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 11:42:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Bark#321
No description provided.