Template for creating a new iOS library.
- Create a new repo from this template library
- Customize GitHub repo settings
- Rename the Xcode project using (stackoverflow/60984691/3777116)
- Rename folders under the Sources/ directory
- Re-configure Xcode project with new filepaths
- Confirm project is compiling and tests are green ✅
- Compilation error gotchas: Ensure Tests files are in the Test target; ensure .h file is Public under Build Phases > Headers
- Update Xcode settings, updating:
- iOS minimum
- Bundle identifier
- Rename CocoaPods .podpsec file
- Update references to
LibraryTemplate
in the following configs:- CI (
.github/workflows/build.yml
) - Swift Package Manager manifest (Package.swift file)
- CocoaPods podspec
- CI (
- Review spec details closely and replace all details, including but not limited to:
- iOS minimum
- Git source
- Update Demo project
- Rename Xcode project
- Update Swift package source
- Update Podfile
- Test that SPM integration and CocoaPods integration work
- Update documentation
- Set CODEOWNERS (.github/CODEOWNERS)
- Customize the file header by modifying X.xcodeproj/xcshareddata/IDETemplateMacros.plist (e.g. add
___FULLUSERNAME___
to include name in headers) - Update the LICENSE file with your name and the current year
- Fill out README
- Update title, description, and badge links
- To determine Swift version, run
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift --version
- To determine Swift version, run
- Remove instructions
- Customize Usage, Installation, Credits, License
- Update title, description, and badge links
- Fill out CHANGELOG
- Update GitHub repo details
- Ensure CI is green ✅
Now you're all set to develop your library, tests and demo project!
In case you'd rather create your setup from scratch:
- Create new Xcode project
LibraryTemplate
(using Xcode 13.0 at time of writing)- Select *Framework for project type
- Select Swift for language
- Check Include Tests and de-select Include Docs
- Update library Xcode settings
- Select iOS Minimum (set to 14.0 at time of writing)
- Remove Team
- Move Xcode files to root of repo and re-add files back to Xcode
- Create custom file header under X.xcodeproj/xcshareddata/IDETemplateMacros.plist
- Create Swift Package Manager manifest
- Create CocoaPods podspec
- Create Demo project and validate both specs integrate
- Setup CI
Point to the most recent release or to the main
branch for the very latest.
pod 'LibraryTemplate', :git => 'https://github.com/hkellaway/LibraryTemplate.git', :tag => 'x.x.x'
pod 'LibraryTemplate', :git => 'https://github.com/hkellaway/LibraryTemplate.git', :branch => 'main'
LibraryTemplate was created by Harlan Kellaway.
LibraryTemplate is available under the MIT license. See the LICENSE file for more info.