Skip to content
/ C-41 Public
forked from ashfurrow/C-41

Developing fluency with Objective-C and Swift/Objective-C interoperability by migrating an Objective-C codebase to Swift. MVVM and ReactiveCocoa.

License

Notifications You must be signed in to change notification settings

nsakaimbo/C-41

 
 

Repository files navigation

Porting Objective-C to Swift

The goal of this project was to develop a greater fluency with Objective-C and understanding Swift/Objective-C interoperability by migrating an existing Objective-C codebase to Swift.

The candidate app is Ash Furrow's C-41, an application to "help people develop film at home by providing a series of 'recipes' for photographers to use." It's a small enough app that it's easy enough to reason about, and in addition provides examples of what good MVVM architecture is supposed to look like (with some Reactive Cocoa thrown into the mix).

I've learned a lot about Objective-C and Swift interoperability through this project, including a better understanding of:

  • Setting up an Objective-C bridging header, and working with the automatically-generated Swift header file

  • Static vs dynamic libraries

  • Objective-C class extensions and categories

  • Objective-C properties and instance variables

  • How to make Objective-C enums more Swift-friendly

  • Translating Objective-C #define preprocessor macros to Swift (in this specific case, the RAC macro provided with ReactiveCocoa)

  • Swift interoperability with the Objective-C runtime (e.g. for Key-Value Observing, which ReactiveCocoa heavily relies on)

Screenshot

Building

If necessary, update to the latest version of CocoaPods.

Clone the repository, then run pod install, opening the generated Xcode workspace.

License

Licensed under MIT 'cause why not.

Colour palette from ColourLovers.

About

Developing fluency with Objective-C and Swift/Objective-C interoperability by migrating an Objective-C codebase to Swift. MVVM and ReactiveCocoa.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 78.6%
  • Swift 21.0%
  • Ruby 0.4%