A library that makes defines your style sheet like a breeze.

Overview

Atelier

A library that makes defines your style sheet like a breeze.

Requirements

  • iOS 13.0+
  • Xcode 12.0+
  • Swift 5.3+

Installation

You can add Atelier to an Xcode project by adding it as a package dependency.

https://github.com/Hsieh-1989/Atelier.git

If you want to use HSLayout in a SwiftPM project, it's as simple as adding a dependencies clause to your Package.swift:

dependencies: [
    .package(url: "https://github.com/Hsieh-1989/Atelier.git", from: "0.1.0")
]

Examples

Colors

Define your color palette:

// define your color brush
enum Colors: String, HexColorBrush {
    case red = "#FF0000FF"
    case orange = "#FF8000FF"
    case yellow = "#FFFF00FF"
    case green = "#00FF00FF"
    case cyan = "#00FFFFFF"
    case blue = "#0000FFFF"
    case purple = "#800080FF"
    case brown = "#996633FF"
}

// wrapped it to the palette
extension UIColor {
    @Palette(Colors.self)
    static var palette: ColorPalette
}

// usage
view.backgroundColor = .palette(.red)

Image

Define your image palette:

// define your image brush
enum Shape: String, SystemImageBrush {
    case seal
    case circle
    case capsule
    case oval
}

// wrapped it to the palette
extension UIImage {
    @Palette(Shape.self)
    static var shape: ImagePalette
}

// usage
imageView.image = .shape(.seal)

Categorize your assets!

One of the benefits of defining your own type to represent your assets is your can categorize them!

enum Bird: String, CaseIterable, NamedImageBrush {
    case budgie
    case dove
    ...
}

enum Dog: String, CaseIterable, NamedImageBrush {
    case corgi
    case poodle
    ...
}

enum Inset: String, CaseIterable, DynamicNamedImageBrush {
    case bee
    case bug
    ...
}

extension UIImage {
    @Palette(Bird.self)
    static var bird: ImagePalette
    
    @Palette(Dog.self)
    static var dog: ImagePalette
    
    @Palette(Inset.self)
    static var inset: ImagePalette
}
// usage
birdImageView.image = .bird(.budgie)
dogImageView.image = .dob(.corgi)
insetImageView.image = .inset(.bee)

More Advanced Usage

You can check the Example App to see more examples!

You might also like...
XcodeColorSense - An Xcode plugin that makes working with color easier.
XcodeColorSense - An Xcode plugin that makes working with color easier.

XcodeColorSense An Xcode plugin that makes working with color easier. Inspired by ColorSense-for-Xcode with extra care for Hex color Features Show col

SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.
SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

MSLView - Shadertoy-style SwiftUI view

MSLView SwiftUI view for Shadertoy-style MSL shaders import MSLView struct Cons

Image filtering UI library like Instagram.
Image filtering UI library like Instagram.

Sharaku Usage How to present SHViewController let imageToBeFiltered = UIImage(named: "targetImage") let vc = SHViewController(image: imageToBeFiltered

Shows your photo library grouped by events, to easily export them to your computer
Shows your photo library grouped by events, to easily export them to your computer

Groupir Shows your photo library grouped by events, to easily export them to your computer Features Currently supported features: reading your photo l

A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below.
A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below.

MCScratchImageView GIF Showcase Requirments iOS 8.0+ Xcode 7.2+ Swift 4.0 Installation CocoaPods pod "MCScratchImageView" Manually Just drag MCScratch

📸 Instagram-like image picker & filters for iOS
📸 Instagram-like image picker & filters for iOS

YPImagePicker YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It is feature-rich and highly customizable to match

ZImageCropper is a simplest way to crop image to any shapes you like.
ZImageCropper is a simplest way to crop image to any shapes you like.

ZImageCropper ZImageCropper is a simplest way to crop image to any shapes you like. Example To run the example project, clone the repo, and run pod in

Generates an image that looks like LEGO Art.

LegoArtFilter Generates an image that looks like LEGO Art. This library supports both iOS (14≤) and macOS (11≤). Usage // Get CGImage from CIImage let

Owner
Hsieh Min Che
iOS Developer from Taipei
Hsieh Min Che
Rough lets you draw in a sketchy, hand-drawn-like, style.

Rough (Swift) Rough lets you draw in a sketchy, hand-drawn-like, style. It is Swift clone of Rough.js. The library defines primitives to draw lines, c

null 96 Nov 24, 2022
ImagePickerSheetController replicates the custom photo action sheet in iMessage.

ImagePickerSheetController About ImagePickerSheetController is a component that replicates the custom photo action sheet in iMessage. It's very simila

Laurin Brandner 1.5k Jan 3, 2023
Highly customizable Action Sheet Controller with Assets Preview written in Swift

PPAssetsActionController Play with me ▶️ ?? If you want to play with me, just tap here and enjoy! ?? ?? Show me ?? Try me ?? The easiest way to try me

Pavel Pantus 72 Feb 4, 2022
A apple music cover picture shadow style image library

ShadowImageView A apple music cover picture shadow style image library ShadowImageView is a iOS 10 Apple Music style image view, help you create elege

Old Donkey 794 Dec 17, 2022
TRex 🦖 TRex makes OCR easy and accessible on a Mac

TRex ?? TRex makes OCR easy and accessible on a Mac. But what is OCR anyway? Imagine you have a PDF file or a Web page where you can't select the text

Ameba Labs 700 Dec 23, 2022
Makes dealing with images buttery smooth.

ImageButter Image viewer for iOS that supports WebP. What is WebP? Find out more here. You can find more about why we created this here. Features Anim

Dollar Shave Club 397 Nov 19, 2022
iOS Framework that makes it easy to preview images on any UIImageView.

AZImagePreview iOS Framework that makes it easy to preview images on any UIImageView. Screenshots Installation: Cocoa Pods: pod 'AZImagePreview' Swift

Antonio Zaitoun 25 Dec 11, 2022
ColorKit makes it easy to find the dominant colors of an image

ColorKit ColorKit is your companion to work with colors on iOS. Features Installation Sample Project Contributing License Features Dominant Colors Col

Boris Emorine 570 Jan 5, 2023
SDWebImageMockPlugin makes possible the creation of snapshot testing with views using SDWebImage to configure images

SDWebImageMockPlugin makes possible the creation of snapshot testing with views using SDWebImage to configure images.

FABERNOVEL 4 Oct 19, 2022
STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy.

STDevRxExt Example To run the Example.playground, clone the repo, and run pod install from the Example directory first. Requirements iOS 9.0+ tvOS 9.0

STDev 6 Mar 26, 2021