Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Giant project Objective C to Swift

I've running project and its really gigantic, it contain almost 1000 files and 4 Custom (own built) framework and almost 10 others added via Pods. I've gone through Migrating Your Objective-C Code to Swift and also Migrate with Swiftify.

I started to converting each file one by one as Apple suggest but first Conversion isn't successfully done by Swiftify and also dependency issues.

So at this position its looks like that I start walking in Sahara Desert, where I can't see any end point.

So I need some suggestion how to convert to Swift this kinda huge scale project?

like image 955
Aleem Avatar asked Oct 23 '18 06:10

Aleem


People also ask

How to migrate from Objective-C to Swift?

The process of Migrating Objective-C code to Swift. The most effectual approach to convert a full Objective-C app to Swift is, to begin with, one class at a time, especially a class without any subclass since you can’t subclass Swift classes in Obj-C.

What is the difference between Swift and Objective-C testing?

Unlike that in the case of Objective-C, code written in Swift can be compiled and the errors can be fixed, along with the code writing part. Hence, Swift act better and faster in the testing process, when compared to the process of testing the Objective-C code.

How to integrate converted IOS code back to Objective-C?

The feature of interoperability enables to integrated converted iOS code back to Objective-C without any hassle, which implies you can explore the myriad of options that Swift offers and then, integrate it back into your Obj-C project without rewriting everything at once. It is always better, to begin with the latest Obj-C code.

What is Swift for iOS development?

Swift is an open-source language and the swift code can be portable on many more platforms than Objective-C was ever. Swift for iOS development is a static-typed language which works with LLVM compiler and can reuse the existing code, eradicate unused resources, manage inline functions, and so on.


1 Answers

I recently converted SVProgressHUD to swift using Swiftify. The converted code can be found at here.

The major takeaways would be:

  1. To start the code conversion one file at a time maintaining interoperability with Objective C, that is the converted swift file should be interoperable with your existing Objective-C code.
  2. Pick a class which does not have subclasses and is simple.

Conversion Strategy Flowchart

The detailed conversion strategy can be found here.

like image 86
Md. Ibrahim Hassan Avatar answered Nov 02 '22 06:11

Md. Ibrahim Hassan