Easier to apply code based style guide to storyboard.

Related tags

Tools Nori
Overview

Nori

Nori designs the view of the storyboard with source code.

nori

Usage

Label

Define the custom class that extends StyleableLabel as @IBDesignable. And implement the func intrinsicStyle() -> LabelStyle.

import Nori

@IBDesignable class LargeLabel: StyleableLabel {
    override func intrinsicStyle() -> LabelStyle {
        return LabelStyle {
            $0.textColor = Color.black.color
            $0.font = UIFont.systemFont(ofSize: FontSize.large.point)
        }
    }
}

Button

It's same as the Label.

@IBDesignable class StarButton: StyleableButton {
    override func intrinsicStyle(for state: UIControlState) -> ButtonStyle {
        return ButtonStyle {
            $0.backgroundColor = Color.green.color
            $0.cornerRadius = 10
            $0.title = LabelStyle {
                $0.textColor = UIColor.white
            }
        }
    }
}

Supported views

  • View
  • Button
  • ImageView
  • Label
  • TextField
  • Switch

License

Nori is released under the MIT license. See LICENSE for details.

You might also like...
The official Swift style guide for raywenderlich.com.
The official Swift style guide for raywenderlich.com.

The Official raywenderlich.com Swift Style Guide. Updated for Swift 5 This style guide is different from others you may see, because the focus is cent

Style guide & coding conventions for Swift projects

This repository is no longer active. A guide to our Swift style and conventions. This is an attempt to encourage patterns that accomplish the followin

A style guide for Swift.
A style guide for Swift.

Table Of Contents Overview Linter Standards Naming Conventions File Structure Types Statement Termination Variable Declaration Self Structs & Classes

LinkedIn's Official Swift Style Guide

Swift Style Guide Make sure to read Apple's API Design Guidelines. Specifics from these guidelines + additional remarks are mentioned below. This guid

Drag gesture modifier to easily apply to any view.

SwiftUIDragModifier A description of this package. This is my first SwiftUI Package. It provides a quick way to make any SwiftUI View draggable. After

Custom Label to apply animations on whole text or letters.
Custom Label to apply animations on whole text or letters.

Ophiuchus Custom Label to apply animations on whole text or letters. Check an article on our blog Inspired by this project on Dribble Installation Coc

iOS app built with UIKit and programatic auto-layouts to learn and apply knowledge. Offline storage using CoreData and Caching

PurpleImage Search Pixabay for images and save them offline to share and view To use: Clone the GitHub project, build and run in Xcode. The API is com

An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.
An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.

CZImageEditor CZImageEditor is an instagram-like image editor with clean and intuitive UI. It is pure swift and can apply preset filters and customize

Telegram iOS Source Code Compilation Guide

Telegram iOS Source Code Compilation Guide We welcome all developers to use our API and source code to create applications on our platform. There are

Telegram iOS Source Code Compilation Guide

Telegram iOS Source Code Compilation Guide We welcome all developers to use our API and source code to create applications on our platform. There are

An Event View based on Apple's Event Detail View. Written in Swift 3. Supports ARC, Autolayout and editing via StoryBoard.
An Event View based on Apple's Event Detail View. Written in Swift 3. Supports ARC, Autolayout and editing via StoryBoard.

An Event View based on Apple's Event Detail View. Written in Swift 3. Supports ARC, Autolayout and editing via StoryBoard. Installation CocoaPods PTEv

Style Art library process images using COREML with a set of pre trained machine learning models and convert them to Art style.
Style Art library process images using COREML with a set of pre trained machine learning models and convert them to Art style.

StyleArt Style Art is a library that process images using COREML with a set of pre trained machine learning models and convert them to Art style. Prev

An easier and faster way to code Autolayout
An easier and faster way to code Autolayout

EZAnchor 中文介绍 An easier way to code Autolayout Are you annoyed of coding .active = true while using Autolayout Anchors over and over again? Are you an

CompositionalLayoutDSL, library to simplify the creation of UICollectionViewCompositionalLayout. It wraps the UIKit API and makes the code shorter and easier to read.
CompositionalLayoutDSL, library to simplify the creation of UICollectionViewCompositionalLayout. It wraps the UIKit API and makes the code shorter and easier to read.

CompositionalLayoutDSL CompositionalLayoutDSL is a Swift library. It makes easier to create compositional layout for collection view. Requirements Doc

Pretty GCD calls and easier code execution.

Threader Pretty GCD calls and easier code execution. Overview Threader makes GCD calls easy to read & write. It also provides a simple way to execute

FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders.
FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders.

SWIFT OBJECTIVE-C FSPagerView is an elegant Screen Slide Library implemented primarily with UICollectionView. It is extremely helpful for making Banne

Example project guide you schedules multiple thread for network requests in RxSwift, which is optimize your app's performance better.
Example project guide you schedules multiple thread for network requests in RxSwift, which is optimize your app's performance better.

RxSwift-Multi-Threading-Example Example project guide you schedules multiple thread for network requests in RxSwift, which is optimize your app's perf

Guide users through your SwiftUI app with coach marks
Guide users through your SwiftUI app with coach marks

Guide users through your SwiftUI app with coach marks

✨ An elegant way to guide your beloved users in iOS apps - Material Showcase.
✨ An elegant way to guide your beloved users in iOS apps - Material Showcase.

Material Showcase for iOS An elegant and beautiful tap showcase view for iOS apps based on Material Design Guidelines. Requirement iOS 10.0+ Swift 4.2

Releases(0.2.0)
Owner
yukiasai
yukiasai
Laurine - Localization code generator written in Swift. Sweet!

Author's note: Thanks everyone for making Laurine the TOP trending Swift repository in the world - this is amazing and very heart-warming! But this is

Jiri Trecak 1.3k Dec 28, 2022
An Xcode plug-in to format your code using SwiftLint.

SwiftLintXcode An Xcode plug-in to format your code using SwiftLint. Runs swiftlint autocorrect --path CURRENT_FILE before *.swift file is saved. IMPO

Yuya Tanaka 348 Sep 18, 2022
Elegant Apply Style by Swift Method Chain.🌙

ApplyStyleKit ApplyStyleKit is a library that applies styles to UIKit using Swifty Method Chain. Normally, when applying styles to UIView etc.,it is n

shindyu 203 Nov 22, 2022
Elegant Apply Style by Swift Method Chain.🌙

ApplyStyleKit ApplyStyleKit is a library that applies styles to UIKit using Swifty Method Chain. Normally, when applying styles to UIView etc.,it is n

shindyu 203 Nov 22, 2022
Airbnb's Swift Style Guide.

Airbnb Swift Style Guide Goals Following this style guide should: Make it easier to read and begin understanding unfamiliar code. Make code easier to

Airbnb 1.8k Jan 3, 2023
LinkedIn's Official Swift Style Guide

Swift Style Guide Make sure to read Apple's API Design Guidelines. Specifics from these guidelines + additional remarks are mentioned below. This guid

LinkedIn 1.4k Jan 5, 2023
The Official raywenderlich.com Swift Style Guide.

The Official raywenderlich.com Swift Style Guide. Updated for Swift 5 This style guide is different from others you may see, because the focus is cent

raywenderlich 12.5k Jan 3, 2023
The Objective-C Style Guide used by The New York Times

NYTimes Objective-C Style Guide This style guide outlines the coding conventions of the iOS teams at The New York Times. We welcome your feedback in i

The New York Times 5.8k Jan 6, 2023
A style guide that outlines the coding conventions for raywenderlich.com

The official raywenderlich.com Objective-C style guide. This style guide outlines the coding conventions for raywenderlich.com. Introduction The reaso

raywenderlich 3.1k Jan 2, 2023
Style guide & coding conventions for Objective-C projects

This repository is no longer active. These guidelines build on Apple's existing Coding Guidelines for Cocoa. Unless explicitly contradicted below, ass

GitHub 1.7k Dec 9, 2022