Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatiable with Swift Package Manager(SPM) #331

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# Swift PM
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

31 changes: 31 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// swift-tools-version:5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "YYModel",
platforms: [
.iOS(.v12),
.tvOS(.v12),
.macOS(.v10_13),
.watchOS(.v4)
],
products: [
.library(name: "YYModel", targets: ["YYModel"])
],
dependencies: [],
targets: [
.target(
name: "YYModel",
dependencies: [],
path: "YYModel",
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("../include"),
]
),
.testTarget(name: "YYModelTests", dependencies: ["YYModel"], path: "YYModelTests")
],
swiftLanguageVersions: [.v5]
)
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ You can map a json key (key path) or an array of json key (key path) to one or m
Installation
==============

### Swift Package Manager
1. Xcode -> File -> Add Package Dependencies...
2. Search Package URL: `[email protected]:ibireme/YYModel.git` and add the `YYModel` library to your targets in `Link Binary With Libraries`.
3. `@import YYModel;`


### CocoaPods

1. Add `pod 'YYModel'` to your Podfile.
Expand Down Expand Up @@ -577,6 +583,11 @@ EEE MMM dd HH:mm:ss Z yyyy

安装
==============
### Swift Package Manager
1. Xcode -> File -> Add Package Dependencies...
2. 搜索 Package URL: `[email protected]:ibireme/YYModel.git` 并将生成的 `YYModel` 库添加到 targets 当中的 `Link Binary With Libraries`。
3. 导入 `@import YYModel;`


### CocoaPods

Expand Down
1 change: 1 addition & 0 deletions include/NSObject+YYModel.h
1 change: 1 addition & 0 deletions include/YYClassInfo.h
1 change: 1 addition & 0 deletions include/YYModel.h