Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Refactor EZPreferencesWindowController into Swift #202

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Oct 28, 2023

A base PR to migrate Preferences System into Swift.

Also MASPreferences is a very old framework written by ObjectiveC and it has been archived by the owner on Mar 6, 2023.

Can we consider migrating into other modern Swifty framework? eg. Settings

If you agree, I'd like to split the migration into 4 steps. And everyone can do one if they had time.

  1. Migrate EZPreferencesWindowController from ObjectiveC into Swift
  2. Migrate other MASPreferencesViewController into Swift (Settings does not support ObjectiveC)
  3. Migrate from MASPreferences -> Settings (MASPreferencesViewController -> SettingsPane)

I'll also make the Preference UI part as a standalone SwiftPM to reduce the xcodeproj dependency.

  1. (Optional) Write some PreferencesViewController using SwiftUI instead of AppKit in the future

Settings supports AppKit, SwiftUI and mix them together.

image

@Kyle-Ye Kyle-Ye requested a review from tisfeng October 28, 2023 15:37
@Kyle-Ye
Copy link
Collaborator Author

Kyle-Ye commented Oct 28, 2023

干掉 MASPreferences 后就不用 Easydict 自己维护一套 DarkManager 了,可以直接走 Color Asset 就行。
目前 MASPreferences 下使用这套看起来会有 bug 😂

@tisfeng
Copy link
Owner

tisfeng commented Oct 29, 2023

可以的,之前我想重构设置页时也看过 Settings ,只是担心一下改动太大,不好维护,现在有你来负责 Swift 改造自然是好的 😃

用 SwiftUI 也是可以的,只是重构尽量和之前保持一致,一步步来,保持平稳过渡。

前期我可能没办法给到帮助,Swift 部份代码需要你来维护,辛苦了。

@Kyle-Ye Kyle-Ye requested a review from tisfeng October 29, 2023 04:10
@Kyle-Ye
Copy link
Collaborator Author

Kyle-Ye commented Oct 29, 2023

用 SwiftUI 也是可以的,只是重构尽量和之前保持一致,一步步来,保持平稳过渡。

Sure. Let's do it step by step. 🚀

@tisfeng tisfeng merged commit bf2bf70 into tisfeng:dev Oct 29, 2023
2 checks passed
tisfeng added a commit that referenced this pull request Nov 3, 2023
Jerry23011 pushed a commit to Jerry23011/Easydict that referenced this pull request Dec 3, 2023
Jerry23011 pushed a commit to Jerry23011/Easydict that referenced this pull request Dec 3, 2023
@Kyle-Ye Kyle-Ye deleted the optimize/swift branch December 29, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants