mirror of
https://github.com/exyte/Macaw.git
synced 2024-11-11 01:42:35 +03:00
Merge pull request #254 from hirschfl/swift_package_manger
Add support for Swift Package Manager
This commit is contained in:
commit
600d99e765
23
Package.swift
Normal file
23
Package.swift
Normal file
@ -0,0 +1,23 @@
|
||||
// swift-tools-version:4.0
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Macaw",
|
||||
products: [
|
||||
.library(
|
||||
name: "Macaw",
|
||||
targets: ["Macaw"]),
|
||||
],
|
||||
dependencies: [],
|
||||
targets: [
|
||||
.target(
|
||||
name: "SWXMLHash",
|
||||
dependencies: [],
|
||||
path: "Dependencies/SWXMLHash"),
|
||||
.target(
|
||||
name: "Macaw",
|
||||
dependencies: ["SWXMLHash"],
|
||||
path: "Source")
|
||||
]
|
||||
)
|
10
README.md
10
README.md
@ -89,6 +89,16 @@ pod "Macaw", "0.9.1"
|
||||
github "Exyte/Macaw" ~> 0.9.1
|
||||
```
|
||||
|
||||
## [Swift Package Manager] (https://swift.org/package-manager/)
|
||||
|
||||
To install it, simply add the following line to to the `dependencies` value of your `Package.swift`:
|
||||
|
||||
```swift
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/exyte/Macaw.git", from: "0.9.2")
|
||||
]
|
||||
```
|
||||
|
||||
## Building from sources
|
||||
|
||||
To build Macaw from sources:
|
||||
|
@ -71,6 +71,11 @@ class TextRenderer: NodeRenderer {
|
||||
}
|
||||
|
||||
fileprivate func getMFont() -> MFont {
|
||||
guard #available(iOS 9.0, macOS 10.11, *) else {
|
||||
// This case should never happen, since the deployment target is set to iOS 9.0/macOS 10.11.
|
||||
// However it is needed for the Swift Package Manager to work accordingly.
|
||||
return MFont()
|
||||
}
|
||||
guard let text = text else {
|
||||
return MFont.systemFont(ofSize: 18.0)
|
||||
}
|
||||
@ -89,6 +94,11 @@ class TextRenderer: NodeRenderer {
|
||||
}
|
||||
|
||||
fileprivate func getWeight(_ weight: String) -> MFont.Weight? {
|
||||
guard #available(iOS 9.0, macOS 10.11, *) else {
|
||||
// This case should never happen, since the deployment target is set to iOS 9.0/macOS 10.11.
|
||||
// However it is needed for the Swift Package Manager to work accordingly.
|
||||
return .none
|
||||
}
|
||||
switch weight {
|
||||
case "normal":
|
||||
return MFont.Weight.regular
|
||||
|
Loading…
Reference in New Issue
Block a user