Skip to content

Latest commit

 

History

History
94 lines (67 loc) · 3.64 KB

INSTALLATION.md

File metadata and controls

94 lines (67 loc) · 3.64 KB

Installation

Option 1: Use Package.swift

Edit Package.swift to add the lib as a dependency:

dependencies: [
  .package(url: "https://github.com/Kjuly/ColorCalculation.git", .upToNextMajor(from: "1.0"))
]

For a detailed guide, read Apple's developer doc Creating a standalone Swift package with Xcode and Swift's Swift Package Manager.

Option 2: Use Xcode Project

To add a package dependency to your Xcode project, select File > Add Package Dependency and enter the URL: https://github.com/Kjuly/ColorCalculation.git.

For a detailed guide, read Apple's developer doc: Adding package dependencies to your app.

  1. Edit Podfile to add the dependency:
# Integrating CocoaPods with an existing workspace requires one extra line in your Podfile.
# Remove it if not.
workspace 'YourWorkspace'

# Provide the platform info, iOS 16.0+ as an example here.
platform :ios, '16.0'

# Add package to your project target
target 'YourProjectTarget' do
  project 'Path/To/Your/YourProjectTarget.xcodeproj'

  pod 'ColorCalculation', '~> 1.0'
end
  1. Close your Xcode project and run commands below:
$ pod install

For a detailed guide, read CocoaPods's doc: Using CocoaPods.

Tip

  • Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.
  • Use pod update <PODNAME> only when you want to update pods to a newer version.

You can find a detailed explanation here.

  1. Edit Cartfile to add the dependency:
github "Kjuly/ColorCalculation" ~> 1.0
  1. Run the command in terminal:
$ carthage update --use-xcframeworks
  1. Drag the built ColorCalculation.xcframework from Carthage/Build to the "Frameworks, Libraries, and Embedded Content" section of your Xcode project.

Tip

If you are using Carthage for an application, select "Embed & Sign", otherwise "Do Not Embed".

For a detailed guide, read Carthage's Quick Start.

Important

Carthage builds your dependencies and provides you with a binary framework, which defaults to a Release configuration. So if you want to print debug logs on the console, you need to run the command below. Xcode will update *.xcframework automatically if you've added them already.

$ carthage update --use-xcframeworks --configuration Debug

Once you're done debugging, just don't forget to switch it back to production:

$ carthage update --use-xcframeworks

If you don't want to use any of the above package managers, you can add packages to your project manually.

  1. Run the commands in terminal:
$ cd path/to/your/root/project/directory
$ git submodule add https://github.com/Kjuly/ColorCalculation.git Libs/ColorCalculation
  1. Open your project and add a reference to the source code folder: "ColorCalculation/ColorCalculation".

For a detailed guide about git submodule usage, read git's doc: git-submodule.