Skip to content

Workflow to convert Objc code to Swift #10

@fespinoza

Description

@fespinoza

For a given file A.m we want to create a file A.swift to replace it:

  1. Create A.swift with the right properties and intializers
  2. Port methods (from private utility methods to public ones*)
    1. write the swift version of method foo in A.swift, not necessarily improving the code, but just translating it from objc to swift
    2. remove foo in A.m
    3. stage new method in swift change and deleted lines only in A.m
    4. commit changes: Converting foo to swift
    5. undo removal of foo in A.m
    6. move to the next method
  3. Replace usages of A.m for A.swif in the source code (and commit)
  4. Remove A.m and A.h from the project
  5. Fix any remaining compile error
  6. Improve the current existing swift code and commit changes by one

Then reviewing the changes will be way easier by commit, as only the relevant conversions are set.

*: start with the private methods that don’t depend on other methods

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions