Skip to content
Declarative UI construction for iOS, written in Swift
Branch: master
Clone or download
timdonnelly Merge pull request #9 from bencochran/patch-1
Correct Tutorial 1 hierarchy description
Latest commit 5e8bcba Apr 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
BlueprintUI Initial Commit Mar 29, 2019
BlueprintUICommonControls Removed old snapshot reference images, updated snapshot assertions to… Mar 30, 2019
Documentation Correct Tutorial 1 hierarchy description Apr 1, 2019
SampleApp Remove dependency on external snapshot testing framework Mar 30, 2019
.gitignore Initial Commit Mar 29, 2019
.travis.yml
BlueprintUI.podspec Bump version to 0.2.2 Mar 30, 2019
BlueprintUICommonControls.podspec Bump version to 0.2.2 Mar 30, 2019
Gemfile Updated CocoaPods Mar 30, 2019
Gemfile.lock Updated CocoaPods Mar 30, 2019
LICENSE Initial Commit Mar 29, 2019
Podfile Remove dependency on external snapshot testing framework Mar 30, 2019
Podfile.lock Update travis config Mar 31, 2019
README.md Add CI status to README Mar 31, 2019
RELEASING.md Initial Commit Mar 29, 2019

README.md

Build Status

Blueprint

Declarative UI construction for iOS, written in Swift

Blueprint greatly simplifies the task of building and updating views as application state changes.

We still consider Blueprint experimental (and subject to major breaking API changes), but it has been used within Square's production iOS apps.

let rootElement = Label(text: "Hello from Blueprint!")
let view = BlueprintView(element: rootElement)

What does this library do?

Blueprint provides an architecture that allows you to:

  • Declaratively define a UI hierarchy as pure values (Swift structs and enums).
  • Display that hierarchy within your application.
  • Update that hierarchy as application state changes (including animated transitions).
When should I use it?

Use Blueprint any time you want to display a view hierarchy, but don't want to manage view lifecycle (hint: managing view lifecycle is a large portion of most conventional UIKit code). There are times when you want to manage view lifecycle (complex animations and transitions are a good example), and for these cases you may want to stick with a conventional approach.

How does it interact with UIKit?

Blueprint is not a replacement for UIKit! From the beginning, Blueprint has been designed as a compliment to all of the powerful tools that come with the platform. You can use Blueprint to manage the display of a single view controller, or of a single view representing a small part of the screen. Likewise, it's straightforward to host standard views and controls within a blueprint hierarchy, always leaving you with an escape hatch.


Documentation

Getting Started

  1. Hello, World

  2. The Element Hierarchy

  3. Building Custom Elements

  4. Layout

Reference

  1. Element

  2. BlueprintView

  3. ViewDescription

  4. Transitions

Tutorials

Tutorial setup instructions

  1. Using Blueprint in a View Controller

  2. Building a receipt layout with Blueprint


Adding Blueprint to an existing project

Two modules are provided:

  • BlueprintUI contains the core architecture and layout types.
  • BlueprintUICommonControls includes elements representing some common UIKit views and controls.

Blueprint is available via CocoaPods. Add it to your Podfile to integrate:

target MyTarget do
    pod 'BlueprintUI'
    pod 'BlueprintUICommonControls'
end

Release instructions


Copyright 2019 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You can’t perform that action at this time.