All Projects → Boilertalk → BlockiesSwift

Boilertalk / BlockiesSwift

Licence: MIT License
Unique blocky identicons generator for Swift

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to BlockiesSwift

Swiftyattributes
A Swifty API for attributed strings
Stars: ✭ 1,303 (+2358.49%)
Mutual labels:  tvos, watchos, carthage, cocoa
Cocoalumberjack
A fast & simple, yet powerful & flexible logging framework for Mac and iOS
Stars: ✭ 12,584 (+23643.4%)
Mutual labels:  tvos, watchos, carthage
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+198.11%)
Mutual labels:  tvos, watchos, carthage
Wwdc Notes
WWDCNotes.com content ✨
Stars: ✭ 183 (+245.28%)
Mutual labels:  tvos, watchos, cocoa
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (+149.06%)
Mutual labels:  tvos, watchos, carthage
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (+160.38%)
Mutual labels:  tvos, watchos, carthage
Mechanica
A cross-platform library of Swift utils to ease your iOS | macOS | watchOS | tvOS and Linux development.
Stars: ✭ 27 (-49.06%)
Mutual labels:  tvos, watchos, carthage
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+20100%)
Mutual labels:  tvos, watchos, carthage
Iso8601
ISO8601 date parser and writer
Stars: ✭ 213 (+301.89%)
Mutual labels:  tvos, watchos, carthage
articles-ko
Articles for NSHipster.co.kr
Stars: ✭ 18 (-66.04%)
Mutual labels:  tvos, watchos, cocoa
WWDCNotes
WWDCNotes.com content
Stars: ✭ 343 (+547.17%)
Mutual labels:  tvos, watchos, cocoa
Sqift
Powerful Swift wrapper for SQLite
Stars: ✭ 119 (+124.53%)
Mutual labels:  tvos, watchos, carthage
Articles Zh Hans
Articles for NSHipster.cn
Stars: ✭ 113 (+113.21%)
Mutual labels:  tvos, watchos, cocoa
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (+173.58%)
Mutual labels:  tvos, watchos, carthage
Diff
Simple diff library in pure Swift
Stars: ✭ 110 (+107.55%)
Mutual labels:  tvos, watchos, carthage
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (+233.96%)
Mutual labels:  tvos, watchos, carthage
Dots
Lightweight Concurrent Networking Framework
Stars: ✭ 35 (-33.96%)
Mutual labels:  tvos, watchos, carthage
Mixpanel
Unofficial Swift Mixpanel client
Stars: ✭ 93 (+75.47%)
Mutual labels:  tvos, watchos, carthage
Sdwebimagewebpcoder
A WebP coder plugin for SDWebImage, use libwebp
Stars: ✭ 101 (+90.57%)
Mutual labels:  tvos, watchos, carthage
Cache
Swift caching library
Stars: ✭ 210 (+296.23%)
Mutual labels:  tvos, watchos, carthage

CI Status Version License Platform Carthage compatible

⚗️ BlockiesSwift

Sample Blockies

This library is a Swift implementation of the Ethereum fork of Blockies which is intended to be used in iOS, watchOS, tvOS and macOS apps.

Blockies generates unique images (identicons) for a given seed string. Those can be used to create images representing an Ethereum (or other Cryptocurrency) Wallet address or really anything else.

Example

To run the example project, run pod try BlockiesSwift. Or clone the repo, and run pod install from the Example directory.

Installation

CocoaPods

BlockiesSwift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'BlockiesSwift'

Carthage

BlockiesSwift is compatible with Carthage, a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To install it, simply add the following line to your Cartfile:

github "Boilertalk/BlockiesSwift"

Usage

Basic usage is very straight forward. You just create an instance of Blockies with your seed and call createImage() to get your image.

import BlockiesSwift

let blockies = Blockies(seed: "0x869bb8979d38a8bc07b619f9d6a0756199e2c724")
let img = blockies.createImage()

yourImageView.image = img

This will generate an image with size set to 8 and scale set to 4. size is the width and height of the Blockies image in blocks, scale is the width and height of one block in pixels.

Per default, random colors are generated for the given seed. You can change that but keep in mind that the pattern will also change if you provide custom colors as there will be less calls to the internal random() function.

The following is a full example.

import BlockiesSwift

let blockies = Blockies(
    seed: "0x869bb8979d38a8bc07b619f9d6a0756199e2c724",
    size: 5,
    scale: 10,
    color: UIColor.green,
    bgColor: UIColor.gray,
    spotColor: UIColor.orange
)
let img = blockies.createImage()

yourImageView.image = img

The following sizes work well for most cases.

  • size: 8, scale: 3
  • size: 5, scale: 10

Sizes above 10 generate more noisy structures. If you want to generate bigger images, you can go for a set of size and scale from the above and pass a customScale value to createImage(_:).

import BlockiesSwift

let blockies = Blockies(
    seed: "0x869bb8979d38a8bc07b619f9d6a0756199e2c724",
    size: 8,
    scale: 3
)
let img = blockies.createImage(customScale: 10)

yourImageView.image = img

The image in this example would be 8 * 3 = 24x24 pixels without a custom scale. With the customScale set to 10 it will be 8 * 3 * 10 = 240x240 pixels. The customScale lets you generate bigger images with the same structure quality as the smaller ones.

Author

Koray Koska, [email protected]

License

BlockiesSwift is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].