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

Add documentation for BlurHashDecode #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 Swift/BlurHashDecode.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import UIKit

extension UIImage {
/// This creates a UIImage containing the placeholder image decoded from the BlurHash string, or returns nil if decoding failed.
/// - Parameters:
/// - blurHash: A string containing the BlurHash.
/// - size: The requested output size. You should keep this small, and let UIKit scale it up for you. 32 pixels wide is plenty.
/// - punch: Adjusts the contrast of the output image. Tweak it if you want a different look for your placeholders.
public convenience init?(blurHash: String, size: CGSize, punch: Float = 1) {
guard blurHash.count >= 6 else { return nil }

Expand Down