Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Python/build/
*.so
*.o
*.pyc
.build/

# Website
Website/node_modules/
Expand Down
35 changes: 35 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

// swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"

import PackageDescription

let package = Package(
name: "blurhash",
defaultLocalization: "en",
products: [
.library(
name: "BlurHash",
targets: ["BlurHash"]
),
],
dependencies: [],
targets: [
.target(
name: "BlurHash",
dependencies: [],
path: "./Swift",
exclude: [
"BlurHashKit",
"BlurHashTest",
"License.txt",
"Readme.md",
],
sources: [
"BlurHashDecode.swift",
"BlurHashEncode.swift",
]
),
]
)
10 changes: 10 additions & 0 deletions Swift/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
and encoder for BlurHash to and from `UIImage`. Both files are completeiy standalone, and can simply be copied into your
project directly.

### Usage

#### Swift Package Manager

Add the following dependency to your Package.swift file:

```swift
.package(name: "blurhash", url: "https://github.com/woltapp/blurhash.git", .branch("master")),
```

### Decoding

[BlurHashDecode.swift](BlurHashDecode.swift) implements the following extension on `UIImage`:
Expand Down