![]() Now you can store a block as an Any type for the Objective-C part of the codebase. We use NS_ENUM macro in Objective-C code, and this construction is automatically recognized by Swift, so it imports with the Swift enum type. ![]() In the following sections, let’s have a quick overview of what we use. In the book, you’ll find all the necessary tools to make the coexistence of Objective-C and Swift code a good experience. The tool is platform agnostic, yet there are plenty of UIKit/ AppKit-specific rules based on the Coding Guidelines for Cocoa naming conventions.Īll the rules are described in a great e-book by Apple, Using Swift with Cocoa and Objective-C. But Swift has a tremendous Objective-C importer, ClangImporter, which is used to import Objective-C (and C) code into Swift automatically. The Objective-C API in the Swift world can feel a bit awkward. ![]() This is an optional Swift extension that may be used on top of the binary framework we distribute. Today we’re introducing PSPDFKitSwift, a collection of wrappers to and extensions for the regular amework. While interoperability between Objective-C and Swift is already good, we decided to put in extra effort to make using our SDK from Swift a first-class experience, matching what Apple provides with its frameworks. ![]() Our main SDK is written in Objective-C, but we can’t yet switch our SDK to Swift, both because we still have many customers using Objective-C, and because Swift does not yet have a stable ABI. At PSPDFKit, we use Swift in almost all our projects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |