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

Rewrite Services & iOS Display Logic in Swift #5680

Closed
wants to merge 23 commits into from

Conversation

IsaacMarovitz
Copy link

@IsaacMarovitz IsaacMarovitz commented Sep 7, 2023

  • UTMProcess
  • UTMQemuSystem
  • UTMLocationManager
  • UTMLogging
  • UTMSpiceIO
  • Fix SPICE connections being refused
  • Change startProcess to use scoped UnsafePointer to resolve dangling pointer warning
  • VMScroll
  • VMCursor
  • VMDisplayMetalViewController
  • VMDisplayMetalViewController+Pointer
  • VMKeyboardButton
  • VMKeyboardView
  • VMDisplayViewController
  • VMDisplayMetalViewController+Touch
  • VMDisplayMetalViewController+Pencil
  • VMDisplayMetalViewController+Keyboard
  • VMDisplayMetalViewController+Gamepad

@osy
Copy link
Contributor

osy commented Sep 7, 2023

Just FYI, we purposely left objective c code in objective c if it’s more reasonable to use it due to either C library or Apple framework compatibility or because the code is cleaner.

@IsaacMarovitz
Copy link
Author

Just FYI, we purposely left objective c code in objective c if it’s more reasonable to use it due to either C library or Apple framework compatibility or because the code is cleaner.

I agree that there are some instances here where the Swift solution is significantly messier case in point, startProcess on UTMProcess. However, there are things here that can be converted to Swift with a clean solution. I'm happy to revert some of the rewrites if you decide they're too messy for your taste.

How it's written now is very much the "cheap-n-dirty" solution and not necessarily the cleanest "Swiftiest" way. I will work on improving the messier parts.

@osy
Copy link
Contributor

osy commented Sep 7, 2023

My philosophy usually is I don’t rewrite any code for the sake of rewriting it. It’s only if I need to implement a feature or I want to rearchitect a particular part or something. Case in point, the last rewrite I refactored a lot of the QEMU support code into QEMUKit and made swift friendly interfaces. I think that out of everything, the backend stuff least need to be converted to swift. There’s a lot of front end iOS stuff that’s still objc from the early days and moving to swift may actually benefit the code.

Anyways feel free to do what you want, just letting you know my thoughts early so you don’t waste any time if it doesn’t get merged.

@IsaacMarovitz IsaacMarovitz marked this pull request as ready for review September 8, 2023 02:29
@IsaacMarovitz IsaacMarovitz marked this pull request as draft September 8, 2023 16:03
@IsaacMarovitz IsaacMarovitz changed the title Rewrite Services in Swift Rewrite Services & iOS Display Logic in Swift Sep 8, 2023
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