Skip to content

Commit

Permalink
SPM Support (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfcon committed Sep 14, 2021
1 parent 915fc46 commit d9020a8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 12 deletions.
30 changes: 30 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "MJExtension",
products: [
.library(name: "MJExtension", targets: ["MJExtension"]),
],
dependencies: [],
targets: [
.target(
name: "MJExtension",
dependencies: [],
path: "MJExtension",
exclude: ["Info.plist"],
publicHeadersPath: ".",
cxxSettings: [
.headerSearchPath("."),
]
),
// Mixed languages are not supported now. Go MJExtension project to see tests.
// .testTarget(
// name: "MJExtensionTests",
// dependencies: ["MJExtension"],
// path: "MJExtensionTests",
// exclude: ["Info.plist"]
// )
]
)
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
MJExtension
===
[![SPM supported](https://img.shields.io/badge/SPM-supported-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
![podversion](https://img.shields.io/cocoapods/v/MJExtension.svg)
![Platform](https://img.shields.io/cocoapods/p/MJExtension.svg?style=flat)

- A fast, convenient and nonintrusive conversion framework between JSON and model.
- 转换速度快、使用简单方便的字典转模型框架

Expand Down Expand Up @@ -48,27 +50,27 @@ MJExtension

### <a id="Installation"></a> Installation【安装】

#### From CocoaPods【使用CocoaPods】
#### CocoaPods【使用CocoaPods】

```ruby
pod 'MJExtension'
```

#### Carthage

```ruby
github "CoderMJLee/MJExtension"
```

#### Swift Package Manager

Released from [`3.4.0`](https://github.com/CoderMJLee/MJExtension/releases/)

#### Manually【手动导入】

- Drag all source files under folder `MJExtension` to your project.【将`MJExtension`文件夹中的所有源代码拽入项目中】
- Import the main header file:`#import "MJExtension.h"`【导入主头文件:`#import "MJExtension.h"`

```objc
MJExtension.h
MJConst.h MJConst.m
MJFoundation.h MJFoundation.m
MJProperty.h MJProperty.m
MJType.h MJType.m
NSObject+MJCoding.h NSObject+MJCoding.m
NSObject+MJProperty.h NSObject+MJProperty.m
NSObject+MJKeyValue.h NSObject+MJKeyValue.m
```

## <a id="Examples"></a> Examples【示例】

**Add `MJKeyValue` protocol to your model if needed【如果有需要, 请在模型中加入 `MJKeyValue` 协议】**
Expand Down

0 comments on commit d9020a8

Please sign in to comment.