Revamp Settings Section: Complete Migrating to Swift & SwiftUI
Overview
This pull request aims to overhaul the existing Settings section of the app, transitioning it from the old Objective-C code with XLForm package usage to modern Swift code utilizing SwiftUI. The revamp covers the Settings screen along with its connected components such as SettingsAdvanced Screen, AutoUpload Screen, ChangeAutoUploadFileName screen, and associated small views.
This significant refactoring enhances maintainability, optimises performance of app, improves user experience, and aligns with modern iOS development standards.
- [x] Navigation between More & Settings Screens
- [ ] Settings Screen
- [ ] Advanced Screen
- [ ] Navigation between More & Advanced Screens
- [ ] AutoUpload Screen
- [ ] Navigation between More & Settings Screens
- [ ] ChangeAutoUploadFileName Screen
- [ ] Navigation between AutoUpload & ChangeAutoUploadFileName Screens
- [ ] Other bugs fixes in Settings Section
P.S.: I'll keep adding screenshots with every particular screen commit.
@marinofaggiana please keep on reviewing once you get time, as otherwise this will be a big chunk of code at last. I'll try to be punctual, except if I have university exams in between.
Hi @adityagi02 welcome !! I absolutely thank you for your great help, for any questions, reviews or anything else we are here for you. Out of curiosity, what university are you attending?
Note.
- please use DCO for signed your push
- compatibility with keychain get/put calls must be maintained
- for everything else you are free to indulge yourself as you wish
Thanks a lot !
ping @mpivchev
Thank you for the warm welcome! I love Nextcloud & I'm glad to be contributing here.💙
I'm currently enrolled at the Indian Institute of Information Technology. It's a privilege to be part of an institution that requires passing one of the toughest STEM exams in the world, the JEE Mains & Advanced, for admission.
I'll definitely keep the points you mentioned in mind.
Thanks again !!
New Settings Screen
Some queries:
- Firstly, In this Privacy Form, we have vaguely defined toggle text which is confusing. Either we have to change the content text or we have to add some proper footer explanation of what each toggles do.
- When you click "Get Source Code", a browser sheet opens but it's UI is not proper, we have to follow a common and more descriptive view for this.✅
Here user cannot Sign In as cancel button is overlapping. Corrected✅
Hi @adityagi02 some problem with OpenSSL ?
Hi @adityagi02 some problem with OpenSSL ?
![]()
yeah, my Xcode which is causing some issue with fetching OpenSSL, so i kept a local dependency you can just add OpenSSL from manager and build with that it'll work fine.
Hi @adityagi02 some problem with OpenSSL ?
yeah, my Xcode which is causing some issue with fetching OpenSSL, so i kept a local dependency you can just add OpenSSL from manager and build with that it'll work fine.
yes, sure, but is strange, it shouldn't happen
Hi @adityagi02 some problem with OpenSSL ?
yeah, my Xcode which is causing some issue with fetching OpenSSL, so i kept a local dependency you can just add OpenSSL from manager and build with that it'll work fine.
yes, sure, but is strange, it shouldn't happen
Yes, it can be an issue otherwise. I have 3 different XCode versions in my desktop for different tasks, maybe that has caused this, but i'll check for exact reason and update if possible.
My machine:
macOS Sonoma Version 14.3
XCode Version 15.0.1
New AutoUpload Screen
Queries:
- We have to rethink the arrangements of these sections, and reconsider these vaguely defined texts on them.
@adityagi02 thanks again for the work you are doing, remember that user switching also needs to be managed.
For example, you can be in the settings, push "Files" , change user and then push "More", at this point the setting must be reloaded otherwise it shows incorrect data (of the previous user).
New Advanced Screen
Changes:
-
All picker menus are now new SwiftUI pickers and constant throughout Settings. Old:-
New:-✅
-
No need of any new View❌
-
I have made the
trashimage red, so that it highlights.(Just my idea)
Queries:
- We have same texts for two different sections, should we have some changes on these.
@mpivchev
We were not having any confirmation alerts, when the user taps on clear log file section.
Added✅
Sorry for the DCO, i can't sort this out. I've tried commiting from terminal and XCode both, still It's not working.
Hi @adityagi02, thank you for this, it looks great so far :)
Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev
Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev
Don't worry, school always comes first !
Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev
Don't worry, school always comes first !
If you have some free time today or tomorrow, could you please address the doubts mentioned in the review comments above?
Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev
Don't worry, school always comes first !
If you have some free time today or tomorrow, could you please address the doubts mentioned in the review comments above?
mm where can you report the doubts thx
Hi, I have completed all the tasks, you can start final review. There is a small merge conflict, will resolve it afterwards.
@marinofaggiana @mpivchev
maybe a font more small (15 pt)
In Settings: Lock: On (? is off, which passcode)
In Advanced/Capabilities the view title is absent (look End-to-end encryption view)
More space at bottom fore read the content and also in Advanced
(for now stop)
sure!! Is that all?
- maybe a font more small (15 pt)
- In Settings: Lock: On (? is off, which passcode)
- In Advanced/Capabilities the view title is absent (look End-to-end encryption view)
More space at bottom fore read the content and also in Advanced
(for now stop)
sure!! Is that all?
hope yes :D .. and please fix the packages + conflicts
Hey @marinofaggiana, Can you direct me to a right direction regarding Lock On/Off as i'm stuck on it? Whenever I'm working on it, there are some blockers in connecting this old style TOPasscodeController package code with SwiftUI. The earlier NCSettings' code is more compatible with this package due to being written in Objective-C.
Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue
Hi ! please Rebase (we have implemented the UIScene)
not building currently inside AutoUploadView !!
not building currently inside AutoUploadView !!
![]()
can I fix in your code ?
not building currently inside AutoUploadView !!
![]()
- Rebase from Develop
- you can get the serverUrl
let serverUrl = NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) you can put it where you want.
so your code will be:
SelectView(serverUrl: serverUrl) or viewModel.serverUrl (if you have put the code in viewModel) .onDisappear { viewModel.setAutoUploadDirectory(serverUrl: serverUrl) }
Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue
is this done, so that we can proceed to merge.
Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue
is this done, so that we can proceed to merge.
Hi @adityagi02 thanks for your job, only some consideration:
-
private let manageDatabase = NCManageDatabase() Why init a new DB instance and not use the share instance ?
-
NCSettings line 130: every time I change something reload NCViewE2EE(account: AppDelegate().account, rootViewController: nil) which in turn tests the GET API https://nextcloud.homelinux.org/ocs/v2.php/apps/end_to_end_encryption/api/v1/public-key , this is not good, network access or API calls should only be used when required (therefore be careful when using the ObservedObject)
-
can you use the Lint ?
@mpivchev It would be nice if I could help you too
Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue
is this done, so that we can proceed to merge.
Hi @adityagi02 thanks for your job, only some consideration:
- private let manageDatabase = NCManageDatabase() Why init a new DB instance and not use the share instance ?
- NCSettings line 130: every time I change something reload NCViewE2EE(account: AppDelegate().account, rootViewController: nil) which in turn tests the GET API https://nextcloud.homelinux.org/ocs/v2.php/apps/end_to_end_encryption/api/v1/public-key , this is not good, network access or API calls should only be used when required (therefore be careful when using the ObservedObject)
- can you use the Lint ?
@mpivchev It would be nice if I could help you too
Hey, thanks for these points. I got some idea, but still i think i'll need some help, so @mpivchev can we have a small meet around some time tomorrow, so that i can resolve some silly doubts i had. Thank you again @marinofaggiana

(for now stop)