![]() ![]() I can see that there is a public stored property called Name, and there is also a public initializer that takes a name. So, if I jump to its definition, it will take me further down in this generated interface and show me everything that is in Spaceship that I can make use of. And that Spaceship is also part of FlightKit. So, now I need to know actually how to create one of these, and I can see in the interface that there is an Initializer that takes a Spaceship. That seems to be some little piece of UI that I might want to show. So I can see that there is this LaunchViewController, which is a subclass of UIViewController. Every public type, public method, everything that I can use when I import FlightKit. What this will do is it will take me to the generated interface for FlightKit.Īnd this shows all the public APIs. ![]() So, either I could go look at the documentation, or I can Command click the name FlightKit, and click Jump to Definition. Well, just like any framework you're used to using already, the first thing you'll do is Import it.Īnd now, I'd like to go ahead and get started using some of the APIs from FlightKit. So let's go back to the code and start using it. Then, I'll just drag in my XCFramework, and that has been wired up automatically as a dependency of my target. Then, I'll scroll down to Frameworks, Libraries, and Embedded Content. So, to actually be able to use the FlightKit XCFramework, all I need to do is click on the Project in the Project Navigator, select my target, and make sure the General tab is selected. Well, I've actually got this awesome XCFramework I'd like to use, called FlightKit.Īnd FlightKit gives me some UI that I'd to present in my application. Well, that is because it's hooked up to this launch method right here, and its body is totally empty. You can see, it has got a big, blue Launch button, and when you click it, it does nothing. And I will go ahead and click Run to run it on the iPad Simulator. So here, I've got a pretty simple iOS app. So, now I'd actually like to just show you how easy it is to get started using an XCFramework. And Xcode will set up your client's search pads automatically.Īnd of course- XCFrameworks support binary distribution of Swift and C-based code. And not only can you bundle up frameworks, but you can also use XCFrameworks to bundle up static libraries, and their corresponding headers. ![]() So, no matter which API your clients want to use, they will be able to use your framework effectively. You can also have a variant for Mac apps that use AppKit, and a variant for Mac apps that use UIKit. Because a single XCFramework can also contain a variant for any of the platforms that Xcode supports. A single XCFramework can contain a variant for the simulator, and for the device. So XCFrameworks are a new way to bundle up multiple variants of your framework in a way that will work across Xcode versions going forward. Next, I'll talk about what's inside an XCFramework, and how you can go about creating one for your project.Īnd then finally, my colleague, Jordan, will come up and talk to you about some things that framework authors should consider to make using their framework as smooth as possible. And I will also talk about some things that clients should consider when they're choosing to use third-party code. So, in this talk, I'm going to introduce you to XCFrameworks, the new supported way to distribute binary frameworks. If you have the ability to ship the source code of your project, then Swift Packages are really, really great.īut not everyone has the ability to ship the source of their libraries, and if you don't, then Xcode 11 supports distributing binary libraries using the new XCFrameworks format. And because they are distributed in Source form, there is no requirement to maintain binary compatibility with your clients. And Swift Packages are a great way to distribute your code, because Xcode knows how to manage their dependencies, and it will figure out which version of your Packages to use automatically. With the new support for Swift Packages in Xcode 11, it's easy to create and use them in your projects and distribute them to others. ![]() Now, before I talk about binary frameworks, I actually want to take a moment to talk about Swift Packages. And I am super excited to talk to you about how Xcode 11 allows you to create and distribute Binary Frameworks in Swift. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |