Join David Okun for an in-depth discussion in this video Making a great developer tool, part of Swift: Writing Reusable Frameworks.
- [Instructor] Let's talk about the work that goes into making a great developer tool. When you're making a great developer tool, you need to consider its documentation. Whenever somebody encounters your tool for the first time, you need to think about is your code well commented? As people read the code of your tool, can people understand what your tool is doing in plain English, as opposed to just swift code. Is the README document that people encounter when they go to the Get repository, comprehensive enough. Will people be able to just read that and understand exactly what it is that your tool does? And finally, does that README have clear integration instructions.
You need to be able to make sure that your tool is easy to integrate and easy to get started with right away. Think about this quote form Ken Williams, "Remember: the documentation, not the code, "defines what a module does." In order to work with this, there's a tool that my friend Richard Littauer made, called Standard README on GitHub. This is his command line interface generator that will allow you to create a nice README that's stubbed out with places for you to type in your own documentation. You don't have to use this, but I recommend this, because it's a great way to get started to make a great README for your developer tool.
Moving along, thinking about your tool, does it have an easy way to use it? Whenever somebody encounters your tool for the first time, they're going to want to see how it works and how it's going to affect their development process. So make sure your tool has a good sample app that's easy to use. Furthermore, in terms of integration, you want to make sure that that sample app runs out of the box. Having somebody complete additional steps as they make your sample app work, can often be time consuming, and it might discourage the developer from using that tool. And is that sample app documented, as well? As people use the sample app, can people understand, again in plain English, how that sample app works? Lastly, consider additional dependencies that your tool has.
You ultimately want to try to rely on just native iOS libraries, but if it does require additional dependencies, how do you handle that? Does the code that you write to initialize your particular framework or tool look elegant? Consider the developer experience, and make sure that your developer is going to enjoy using your tool to make a good user experience. Lastly, would you use this tool on your own projects? The tool we will be making in this course is something that I needed to make to help fulfill a couple of different projects that I have had in the past, so you want to think about if a good chef eats their own cooking, a good developer uses their own frameworks.
Along the way, he explains the differences and nuances between writing code for an application and for a reusable framework, as well as some of the fundamentals of AVFoundation, one of the core camera frameworks in iOS. David also shows how to refactor your code, understand Swift access control, develop an interface, and handle memory leaks, so your framework is ready to share with other developers.
- Creating your first build
- Making the camera work
- Creating a framework delegate
- Adding media
- Capturing images
- Correcting orientation
- Versioning and tagging releases in Git