Skip to content

Commit

Permalink
Merge pull request #152 from iDevelopper/spm-support
Browse files Browse the repository at this point in the history
Spm support
  • Loading branch information
Marxon13 authored Mar 2, 2021
2 parents dd7cbf9 + 9ab1f04 commit a50e12e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ M13Checkbox.xcodeproj/xcuserdata/
M13Checkbox.xcworkspace/
Pods/
Podfile.lock
Playground/LaunchMe.xcworkspace/xcuserdata/*
Playground/LaunchMe.xcworkspace/xcuserdata/*

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/
.swiftpm/
34 changes: 26 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
//
// Package.swift
// M13Checkbox
//
// Created by McQuilkin, Brandon on 4/13/16.
// Copyright © 2016 Brandon McQuilkin. All rights reserved.
//
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "M13Checkbox"
name: "M13Checkbox",
platforms: [
.iOS(.v8),
.macOS(.v10_15)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "M13Checkbox",
targets: ["M13Checkbox"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "M13Checkbox",
dependencies: [],
path: "Sources"
)
]
)
13 changes: 11 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,19 @@ github "Marxon13/M13Checkbox"

#### Swift Package Manager

To install via Swift Package Manager, add the following as a dependency to your Package.swift file:
M13Checkbox supports SPM versions 5.1.0 and above. To use SPM, you should use Xcode 11 to open your project. Click `File` -> `Swift Packages` -> `Add Package Dependency`, enter `https://github.com/Marxon13/M13Checkbox`. Select the version you’d like to use.

You can also manually add the package to your Package.swift file:

```swift
.package(url: "https://github.com/Marxon13/M13Checkbox.git", from: "3.4.0")
```
.Package(url: "git@github.com:Marxon13/M13Checkbox.git", versions: Version(2,2,0)..<Version(2,2,3)),
Note: IBDesignables and IBInspectables will not work in interface builder.

Workaround: Create IBDesignable subclass of M13Checkbox, Use this subclass as custom class in interface builder. Example:
```swift
@IBDesignable
class M13CheckboxView : M13Checkbox {}
```

#### Manual
Expand Down

0 comments on commit a50e12e

Please sign in to comment.