All Projects → joshchngs → swift-package-manager-ios

joshchngs / swift-package-manager-ios

Licence: MIT license
Example of how to use SPM v4 to manage iOS dependencies

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to swift-package-manager-ios

FakeBundle
🗄 Use Resources in your Swift Package Manager executable
Stars: ✭ 13 (-90.44%)
Mutual labels:  swift-package-manager
PerfectLearnGuide
Are you eager to get programming with Swift and Perfect? This PerfectLearnGuide will help you.
Stars: ✭ 19 (-86.03%)
Mutual labels:  swift-package-manager
YMFF
Feature management made easy.
Stars: ✭ 26 (-80.88%)
Mutual labels:  swift-package-manager
Archery
Declare all your project's metadata and what you can do with it in one single place.
Stars: ✭ 47 (-65.44%)
Mutual labels:  swift-package-manager
GoogleCloudLogging
Swift (Darwin) library for logging application events in Google Cloud.
Stars: ✭ 24 (-82.35%)
Mutual labels:  swift-package-manager
taza
🧼 keep your iOS project clean
Stars: ✭ 47 (-65.44%)
Mutual labels:  swift-package-manager
PagedLists
Paginated UITableView and UICollectionViews for iOS.
Stars: ✭ 69 (-49.26%)
Mutual labels:  swift-package-manager
geofeatures2
A lightweight, high performance geometry library in Swift.
Stars: ✭ 18 (-86.76%)
Mutual labels:  swift-package-manager
SwiLex
A universal lexer library in Swift.
Stars: ✭ 29 (-78.68%)
Mutual labels:  swift-package-manager
Dots
Lightweight Concurrent Networking Framework
Stars: ✭ 35 (-74.26%)
Mutual labels:  swift-package-manager
Validated
A rule-based validation framework
Stars: ✭ 31 (-77.21%)
Mutual labels:  swift-package-manager
TeadsSDK-iOS
Teads SDK iOS Sample App - Check out an open-source sample of the Teads iOS SDK implementation
Stars: ✭ 22 (-83.82%)
Mutual labels:  swift-package-manager
tracelog
TraceLog is a highly configurable, flexible, portable, and simple to use debug logging system for Swift and Objective-C applications running on Linux, macOS, iOS, watchOS, and tvOS.
Stars: ✭ 52 (-61.76%)
Mutual labels:  swift-package-manager
ecs-demo
Minimal demo App for the Fireblade Entity-Component System (ECS)
Stars: ✭ 20 (-85.29%)
Mutual labels:  swift-package-manager
Sqlable
Swift library for making storing data in a SQLite database simple and magic-free
Stars: ✭ 83 (-38.97%)
Mutual labels:  swift-package-manager
SwiftCurrent
A library for managing complex workflows in Swift
Stars: ✭ 286 (+110.29%)
Mutual labels:  swift-package-manager
AirPlay
Small framework that lets users track iOS AirPlay availability and extra features.
Stars: ✭ 46 (-66.18%)
Mutual labels:  swift-package-manager
BJOTPViewController
Entering OTP made simpler.
Stars: ✭ 42 (-69.12%)
Mutual labels:  swift-package-manager
PiedPiper
A small set of classes and functions to make easy use of Futures, Promises and async computation in general. All written in Swift for iOS 10+, WatchOS 3, tvOS and Mac OS X apps.
Stars: ✭ 44 (-67.65%)
Mutual labels:  swift-package-manager
danger-swift-xcodesummary
A Danger-Swift plugin that adds build errors, warnings and unit tests results generated from xcodebuild to your Danger report
Stars: ✭ 72 (-47.06%)
Mutual labels:  swift-package-manager

Swift Package Manager with iOS

This project demonstrates a working method for using Swift Package Manager (SPM) to manage the dependencies of an iOS project. It has been tested with Xcode 9.1, using Swift 4 and the SPM v4 description format.

Note: At this time there is no official support for iOS targets or the related system libraries in SPM.

To get started:

  1. Install the xcodeproj ruby library: sudo gem install xcodeproj

  2. Run ruby generate-project-dependencies.rb in the project root directory. This will pull down dependencies as defined in Package.swift and then generate and modify a Dependencies project which is then included as a sub-project by the example project.

  3. Open SwiftPackagesWithiOS.xcodeproj in Xcode

  4. Build the main target (you may need to manually build the target for the Dependencies sub-project).

This will build a simple app that depends on RxSwift. RxSwift was chosen because it shows how to handle modules generated from Objective-C.

The end result will be a standard iOS application, with Static Frameworks for each of its dependencies embedded within the bundle.

You can link the dependencies dynamically if you prefer, by removing the config.build_settings['MACH_O_TYPE'] = 'staticlib' line in generate-project-dependencies.rb. If you do this you will need to embed the dependencies in your main app target.

You can step through the commits to see what steps were taken, with a brief overview of the process below.

Process:

(This process hasn't been tested with Xcode 8.3 & Swift 3.1)

  1. Generate iOS App project with Xcode
  2. Generate swift package for Dependencies
  3. Create dummy source file for Dependencies (I've chosen to put this in .deps-sources but does not necessarily need to be hidden)
  4. Modify build settings in generated xcodeproj (this is done in generate-project-dependencies.rb)
  5. Add Dependencies.xcodeproj as subproject of the main app xcodeproj
  6. Add a dependency (to RxSwift in this example) in Package.swift
  7. Link our App with the new Rx*.frameworks
  8. Write some sample code to verify that the import works
  9. Override MODULEMAP_FILE setting for non-Swift modules
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].