A framework and generator for displaying SwiftUI component libraries

Related tags

Animation Exhibition
Overview

Exhibition

Exhibition is a framework and generator for displaying a SwiftUI component library.

Inspired by Storybook and Showkase

Installation

Swift Package Manager

Usage

  1. Add Exhibition to your project via Swift package manager using https://github.com/mjarvis/Exhibition.git
  2. Install Sourcery
  3. Copy Exhibition.swifttemplate into your project
  4. Modify your SwiftUI previews to use ExhibitProvider
    import Exhibition
    
    struct Foo_Previews: ExhibitProvider, PreviewProvider {
        static var exhibit = Exhibit(name: "Foo") { parameters in
            Foo(
                title: parameters.constant(name: "title", defaultValue: "Title"),
                content: parameters.binding(name: "content")
            )
            .previewLayout(.sizeThatFits)
        }
    }
  5. Run Sourcery to generate your Exhibition: sourcery --sources Your/Source/Path --templates Exhibition.swifttemplate --output ./Sources/Generated
  6. Show exhibition in a swift view

TODO:

  • Debug (#1)

    • Dark mode (#1)
    • RTL
    • Text sizing
    • Investigate other assistive switches
  • Search (#2)

    • Search top level
    • Search nested
  • Sections (#5)

    • Collapsing
    • Rows
      • Icon
      • Title
  • Element

    • Push

    • Present

    • Layout rules (#4)

    • Parameters (#3)

    • Code samples (copy-able snippets)

    • Code documentation (jazzy / swiftdocc)

  • Layout

    • iPhone
    • iPad
    • macOS
    • watchOS
    • tvOS

Metadata?

Comments
  • Allow Exhibition display in an existing navigation stack

    Allow Exhibition display in an existing navigation stack

    When pushing Exhibition in a navigation stack a double navigation bar is visible due to the nested NavigationView. Would be nice to have some way to indicate to the lib that the extra navigation view was not required.

    Screen Shot 2022-02-28 at 12 54 29 PM enhancement 
    opened by IanHoar 3
  • Support debug mutation of some parameters

    Support debug mutation of some parameters

    Resolves #3

    Adds support for String, Bool, and Int parameter types.

    Allows for the consumer to specify custom parameter views, both for overriding types we support, and for adding additional types as well.

    Kapture 2022-02-16 at 10 29 36

    Please add comments (or tickets after this is merged) for additional types that should be supported by default.

    enhancement 
    opened by mjarvis 3
  • Allow customization of Exhibition display

    Allow customization of Exhibition display

    Moves the NavigationView out into the swift template. This allows for customization of the template, for example, to push onto an exiting navigation stack instead, or to modify toolbar items.

    Also adds a close button if the exhibit list is presented.

    Closes #38

    opened by mjarvis 1
  • Exploration into custom presentation via Layout

    Exploration into custom presentation via Layout

    Relates to #32

    Using the layout system for presentation has exposed a large issue with the layout system design, and perhaps with the underlying exhibit Context -> Debug menu relationship.

    The layout closure allows for insertion of additional views before conditionally displaying the exhibit.

    This bypasses the path that fills the parameter list, causing the context to not appear in the debug menu until the popover has been displayed once.

    Resolving this could involve refactoring the Context passing mechanism, or adjusting the layout system to work with the current mechanism. Further exploration is needed.

    enhancement invalid 
    opened by mjarvis 1
  • Fix compilation on macOS

    Fix compilation on macOS

    Resolves #31

    Separates Example app into iOS and macOS targets. Updates Exhibition code to compile + run to macOS.

    Unable to currently test myself as I'm using macOS 11.6, and some of the swiftui features in use are macOS 12+ only. Will see how CI does and look into updating my computer.

    opened by mjarvis 1
  • Add custom layout builder to Exhibit

    Add custom layout builder to Exhibit

    Resolves #4

    Allows for customization of the view that is displayed in the exhibition. For example, adding padding, inserting in a list, positioning, etc.

    This layout builder does not affect SwiftUI previews.

    Also uses sizeThatFits as default preview layout. Consumers can implement their own static var previews if they wish to change this

    Screen Shot 2022-02-23 at 12 22 59

    enhancement 
    opened by mjarvis 1
  • Add simple debug view

    Add simple debug view

    Resolves #1

    Adds a simple debug view presented as a sheet over top of a given exhibit.

    This debug view currently provides a picker for changing the preferred color scheme, and an immutable list of the current exhibits parameters.

    Kapture 2022-02-14 at 11 05 06

    enhancement 
    opened by mjarvis 1
  • Exhibit Layout

    Exhibit Layout

    Exhibit should provide some form of exposing layout options for how it is displayed.

    Unknown as to how this should be formed. Thinking about alignment, filling, etc.

    enhancement 
    opened by mjarvis 1
  • Remove `Exhibit` type, use protocol requirements to build exhibit

    Remove `Exhibit` type, use protocol requirements to build exhibit

    Refactors ExhibitProvider to have separate getters for name, section, and exhibit.

    Benefits:

    • Consistent API for exhibit content and layout
    • Detachment of Layout to Content types allows for use of view modifiers directly.
    • autocomplete more reliable and output code easier to read.

    Best way to review API changes is to look at the rich diff for README.md

    opened by mjarvis 0
  • Fix layout direction switcher

    Fix layout direction switcher

    Setting the environment up higher was not affecting the actual exhibit displayed. Moving this keeps the main navigation and debug view intact as normal while adjusting the direction of the exhibits.

    bug 
    opened by mjarvis 0
  • Add Dynamic type size selector to debug

    Add Dynamic type size selector to debug

    Resolves #12

    Note: This only affects the content size of the exhibits themselves. Placing the environment change higher up was causing navigation to reset, and undesirable UI changes in the list and debug view.

    Kapture 2022-03-17 at 14 32 17

    enhancement 
    opened by mjarvis 0
  • Improve displaying multiple variations

    Improve displaying multiple variations

    Rather than requiring the user to open the debug menu and adjust parameters, we should support displaying multiple variations of a given object, by applying different values to parameters. Perhaps a iterable parameters? or an array of variants with parameters overridden?

    enhancement 
    opened by mjarvis 0
  • Floating Debug View

    Floating Debug View

    It would be a great improvement to have the debug view be a floating view.

    This view could be moved and resized in order to not cover an exhibit, and allow the user to make adjustments to parameters and see them in real time.

    It would be desirable for this to be global, and the contents auto-update to show the context of the visible exhibit when navigating around the exhibition.

    enhancement 
    opened by mjarvis 2
  • Collection Parameter View

    Collection Parameter View

    A parameter view which allows for passing of a collection of objects, for example [Int]. This should push into another list showing each of the contents, along with a button to add entries, and stock editing capabilities (delete, re-arrange).

    enhancement 
    opened by mjarvis 0
Owner
Malcolm Jarvis
Malcolm Jarvis
A slider widget with a popup bubble displaying the precise value selected written on Swift.

A slider widget with a popup bubble displaying the precise value selected written on Swift. We specialize in the designing and coding of

Ramotion 1.9k Dec 23, 2022
An animated label for displaying numbers

RollingDigitsLabel A simple label that animates a number with each digit falling into place. Installation Swift Package Manager dependencies: [ .p

Nathan Chiu 6 Dec 31, 2022
A SwiftUI component to make handling of email links better.

EmailLink A SwiftUI component to make handling of email links better. Not only will EmailLink use the correct default client, it will also prompt the

Joe Scotto 16 Sep 24, 2022
TRightImageButton is a simple and flexible UI component fully written in Swift.

TRightImageButton is a simple and flexible UI component fully written in Swift. TRightImageButton is developed to help programmers create a button with right image quickly without having to write many lines of codes.

Nguyen Duc Thinh 2 Aug 18, 2022
TTouchAnimatedButton is a simple and flexible animation component fully written in Swift

TTouchAnimatedButton is a simple and flexible animation component fully written in Swift. TTouchAnimatedButton is developed to make user feel button click becomes more vivid and realistic.

Nguyen Duc Thinh 2 Aug 18, 2022
iOS Component for creating a pulsing animation.

PulsingHalo PulsingHalo has been discontinued, and is no longer being maintained. Please check out Pulsator which is the new version of this written w

Shuichi Tsutsumi 1.8k Dec 29, 2022
WWDC 2019'da tanıtılan yeni UI framework'ü SwiftUI'ya giriş amacı gütmektedir.

SwiftUI-Presentation Burada SwiftUI'yı Türkçe bir şekilde sunmak istiyorum. Playground'u açtıktan sonra Editor -> Show Rendered Markup seçeneği ile bi

Barış Uyar 2 Apr 28, 2022
SwiftUI animated image view that works on iOS and layout just as SwiftUI.Image

SwiftUI.AnimatedImage SwiftUI animated image view that works on iOS and layout just as SwiftUI.Image Screen.Recording.2021-07-31.at.02.18.33.mov Insta

Marcin Krzyzanowski 50 Oct 14, 2022
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Gordan Glavaš 9 Nov 5, 2022
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
Gemini is rich scroll based animation framework for iOS, written in Swift.

Overview What is the Gemini? Gemini is rich scroll based animation framework for iOS, written in Swift. You can easily use GeminiCollectionView, which

Shohei Yokoyama 3k Dec 27, 2022
Testing the new ShazamKit framework announced at WWDC 2021

ShazamKit Demo Using the ShazamKit framework announced at WWDC 2021 to perform song recognition. Demo Tweet Usage Open the project and change the Bund

Sai Kambampati 18 Mar 17, 2022
Facebook's Pop Framework, By Examples

Facebook's Pop Framework, By Examples --- This project is a tutorial (Check tutorial here) for how to use Pop framework by Facebook. Its very easy and

Hossam Ghareeb 183 Aug 1, 2022
DaisyChain is a micro framework which makes UIView animations chaining dead simple.

DaisyChain DaisyChain is a micro framework which makes UIView animations chaining dead simple. It uses the exact same interface you are familiars with

Ali Karagoz 31 Nov 3, 2022
Simple, extensible interpolation framework

THIS PROJECT IS NO LONGER MAINTAINED. Popsicle is a Swift framework for creating and managing interpolations of different value types with built-in UI

David Roman 1.1k Nov 17, 2022
A micro-framework that leverages Swift Property Wrappers to implement the Service Locator pattern

Locatable Context Locatable is a Swift micro framework that leverages Property Wrappers to implement the Service Locator pattern, through a custom att

Vincent Pradeilles 116 Jan 9, 2022
Design-system-demo - This example code is bare-bones to show you what this framework can do

Basic Style Dictionary This example code is bare-bones to show you what this fra

Tylen St Hilaire 0 Feb 3, 2022
Publish–subscribe design pattern implementation framework, with an ability to publish events by topic.

TopicEventBus Publish–subscribe design pattern implementation framework, with ability to publish events by topic. (NotificationCenter extended alterna

Matan Abravanel 55 Nov 29, 2021