-
Notifications
You must be signed in to change notification settings - Fork 381
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
Refactor settings menu in swiftui only UI #316
Conversation
c330118
to
7b30e19
Compare
一些简单的功能,可以在重构 UI 时顺便也重写了。一些比较复杂的,像输入翻译这几个,可以先桥接使用 objc,后面专门弄个 PR 来重写。 |
目前这个【检查更新】功能好像不对,麻烦你也看一下。 |
我已经添加objc桥接,但debug下部分功能系统权限授权有问题,无法做到全面测试。请review |
有两个小问题:
|
参考下面,你可以在 Easydict-debug.xcconfig 配置文件添加你自己的开发者账号,方便后续调试。
由于这个文件不应该提交,可以使用 git 忽略这个文件变动。(后面假如切换分支遇到问题,可以再改回来)
|
好的,我下周进行修改。thanks |
I added the nullable modifier to |
Wait for me to take a look. |
It's strange, I've tried a number of ways and none of them work. This is caused by being referenced by a Swift bridge file, and I'm not familiar with Swift. If there's really no way to fix it, we can just ignore the warning: #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability"
@property (nonatomic, weak) EZBaseQueryWindow *window;
#pragma clang diagnostic pop |
Nope. This is just a small issue and we should fix it easily. The log message already tells us how to fix it. /Users/kyle/Github/Easydict/Easydict/Feature/ViewController/Window/BaseQueryWindow/EZBaseQueryViewController.h:21:48: warning: conflicting nullability specifier on return types, '_Nullable' conflicts with existing specifier 'nonnull' [-Wnullability]
@property (nonatomic, weak) EZBaseQueryWindow *window;
^
In file included from /Users/kyle/Github/Easydict/Easydict/Feature/PerferenceWindow/EZSettingViewController.m:12:
/Users/kyle/Github/Easydict/Easydict/Feature/Utility/EZCategory/NSViewController+EZWindow.h:15:1: note: previous declaration is here
- (NSWindow *)window;
^
1 warning generated.
NS_ASSUME_NONNULL_BEGIN
@interface NSViewController (EZWindow)
- (NSWindow *)window;
@end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_BEGIN
@interface NSViewController (EZWindow)
-- (NSWindow *)window;
+- (nullable NSWindow *)window;
@end
NS_ASSUME_NONNULL_END You can just merge the patch here liyafly#1. |
Okay, I didn't see the whole log either, but according to you, does this duplicate the attribute definition in the category @tisfeng |
No, they are not the same. I didn't notice that they had the same name before. Maybe we can rename the name of @property (nonatomic, weak) EZBaseQueryWindow *baseQueryWindow; |
Certainly, I’ll go through everything to ensure that all the renaming is correct |
I tried renaming the |
Yes, It would be nice to rename it, because weak just infer nullable, and it would be clearer to add nullable, don't you think? @tisfeng |
Yes, I just want to confirm that renaming the property can fix this warning, and also explicitly adding nullable is ok. |
Fix Xcode nullable warning
(cherry picked from commit ca75f5a)
I ran the code, and there was no problem. If there are no other questions, we can continue to review. |
I'm not too familiar with SwiftUI, so feel free to point out any code issues — I'm here to learn. I've tested the features extensively and they seem fine for now. Welcome to review and give feedback! My English isn't very good, please bear with me. |
#286 初步完成UI,功能是否需要等使用swift重构后添加还是使用桥接Objc完成呢?