• Stars
    star
    602
  • Rank 74,409 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Swift DSL for writing slide decks in Xcode

✨ DeckUI

DeckUI is a Swift DSL (domain specific language) for writing slide decks in Xcode. It allows for quick creation of slides and content in a language and environment you are familiar with.

But why?

Well, I made this because:

  • I was bored on an airplane
  • Wanted to use this as a demo for future conference talk on Swift DSLs
  • Need something more customizable than markdown for writing slide decks and more codey than Keynote

πŸ‘‰ Watch Introducing DeckUI - Write slide decks in Swift on my YouTube channel for more explaination and full demo

✨ Features

  • Create slide decks in pure Swift code
  • Decks are presented in SwiftUI with Presenter
  • Build decks without knowing any SwiftUI
    • With Deck, Slide, Title, Words, Bullets, Media, Columns
  • Use RawView to drop any SwiftUI view
    • Fully interactable and great for demos
  • Display code with Code
    • Use up and down arrows to highlight lines of code as your talking about them
  • Support videos on Media

🐌 Future Features

  • Support iOS and maybe tvOS
  • Fix bug with Media remote image loading and slide transitions
  • Animations within a slide
  • More customization on Words
  • Nesting of Bullets
  • Syntax highlighting for Code
  • Documentation
  • More examples

Simple Demo

import SwiftUI
import DeckUI

struct ContentView: View {
    var body: some View {
        Presenter(deck: self.deck)
    }
}

extension ContentView {
    var deck: Deck {
        Deck(title: "SomeConf 2023") {
            Slide(alignment: .center) {
                Title("Welcome to DeckUI")
            }

            Slide {
                Title("Quick Demo")
                Columns {
                    Column {
                        Bullets {
                            Words("Bullets")
                            Words("Words")
                            Words("Images")
                            Words("Columns")
                        }
                    }

                    Column {
                        Media(.remoteImage(URL(string: "https://www.fillmurray.com/g/200/300")!))
                    }
                }
            }
        }
    }
}
Screen.Recording.2022-09-08.at.12.40.41.AM.mov

πŸ’» Installing

Swift Package Manager

  • File > Swift Packages > Add Package Dependency
  • Add https://github.com/joshdholtz/DeckUI.git
  • Select "Up to Next Major" with "1.0.0"

πŸš€ Getting Started

There are no official "Getting Started" docs yet πŸ˜… But look at...

πŸ“– Documentation

100% not documented yet but I'll get there πŸ€·β€β™‚οΈ

🏎 Performance

Probably bad and never production ready 😈 Please only use DeckUI for a single presentation and never at any scale.

πŸ‘¨β€πŸ’» Contributing

Yes please! I'm happy to discuss issues and review/merge pull requests πŸ™‚ I will do my best to get to the but I am a dad, work at RevenueCat, and the lead maintainer of fastlane so I might not respond right away.

πŸ“š Examples

Slide

Slide can be used without any parameters but can be given a custom alignment, padding, and theme.

Slide {
    // Content
}
Slide(alignment: .center, padding: 80, theme: .white) {
    // Content
}

Title

Title can be used by itself or with an optional subtitle. It was real similar to Words but larger.

Slide(alignment: .center) {
    Title("Introducing...")
}
Slide {
    Title("Introduction", subtitle: "What is it?")
    // Content
}

Words

Words are similar to what a textbox would be in Keynote, PowerPoint, or Google Slides. There will eventually be more style configurations for words.

Slide(alignment: .center) {
    Title("Center alignment")
    Words("Slides can be center aligned")
    Words("And more words")
}

Bullets

Bullets turns Words into a list. It takes an optional style parameter where you can choose between .bullets and .dash. Bullets cannot be nested yet but soonℒ️.

Slide {
    Title("Introduction", subtitle: "What is it?")
    Bullets {
        Words("A custom Swift DSL to make slide decks")
        Words("Distributed as a Swift Package")
        Words("Develop your slide deck in Xcode with Swift")
    }
}
Slide {
    Title("Introduction", subtitle: "What is it?")
    Bullets(style: .dash) {
        Words("A custom Swift DSL to make slide decks")
        Words("Distributed as a Swift Package")
        Words("Develop your slide deck in Xcode with Swift")
    }
}

Media

Media provides a few ways to display images from various source types. This will eventually support videos.

Slide {
    Media(.assetImage("some-asset-name"))
    Media(.bundleImage("some-file-name.jpg"))
    Media(.remoteImage(URL(string: "http://placekitten.com/g/200/300"))!)
}

Columns

Columns allow you to use one to infinte Columns. Put other slide content in Column.

Slide {
    Title("Columns")
    Columns {
        Column {
            // Content
        }

        Column {
            // Content
        }
    }
}
Slide {
    Title("Columns")
    Columns {
        Column {
            // Content
        }

        Column {
            // Content
        }

        Column {
            // Content
        }

        Column {
            // Content
        }
    }
}

Code

Code is a super specifi version Words. It will:

  • Display text as monospace
  • Scroll vertical if bigger than screen
  • Highlight lines of code when up and down arrows are pressed
Slide {
    Code("""
    struct ContentView: View {
        var body: some View {
            Text("Hello slides")
        }
    }
    """)
}
Slide {
    Code("""
    struct ContentView: View {
        var body: some View {
            Text("Hello slides")
        }
    }
    """, , enableHighlight: false)
}

RawView

Drop any SwiftUI view inside of RawView. Could be built-in SwiftUI views like Text or Button but can also be any custom SwiftUI view.

Slide {
    RawView {
        CounterView()
    }
}

struct CounterView: View {
    @State var count = 0

    var body: some View {
        Button {
            self.count += 1
        } label: {
            Text("Press me - \(self.count)")
                .font(.system(size: 60))
                .padding(.horizontal, 40)
                .padding(.vertical, 20)
                .foregroundColor(.white)
                .overlay(
                    RoundedRectangle(cornerRadius: 25)
                    .stroke(Color.white, lineWidth: 2)
                )
        }.buttonStyle(.plain)
    }
}

Themes

A Theme can be set in Presenter or individually on Slide. There are three default themes (.dark, .black, .white) but feel free to use your own.

struct ContentView: View {
    var body: some View {
        Presenter(deck: self.deck, showCamera: true)
    }
}

extension Theme {
    public static let venonat: Theme = Theme(
        background: Color(hex: "#624a7b"),
        title: Foreground(
            color: Color(hex: "#ff5a5a"),
            font: Font.system(size: 80,
                              weight: .bold,
                              design: .default)
        ),
        subtitle: Foreground(
            color: Color(hex: "#a48bbd"),
            font: Font.system(size: 50,
                              weight: .light,
                              design: .default).italic()
        ),
        body: Foreground(
            color: Color(hex: "#FFFFFF"),
            font: Font.system(size: 50,
                              weight: .regular,
                              design: .default)
        ),
        code: Foreground(
            color: Color(hex: "#FFFFFF"),
            font: Font.system(size: 26,
                              weight: .regular,
                              design: .monospaced)
        ),
        codeHighlighted: (Color(hex: "#312952"), Foreground(
            color: Color(hex: "#FFFFFF"),
            font: Font.system(size: 26,
                              weight: .heavy,
                              design: .monospaced)
        ))
    )
}

DeckUI in the real world

  1. FullQueueDeveloper presents "Pushing to the App Store using Swift" with Swish & Sh at GDG Omaha! Watch the YouTube recording of the presentation, and checkout the source code on GitHub.

More Repositories

1

jsonapi-ios

A library for loading data from a JSON API datasource.
Objective-C
182
star
2

Sentry-Android

[Deprecated] Use official "raven-java" library
Java
180
star
3

jenkins-slack-command

Start a build in Jenkins using a Slack Command
Ruby
55
star
4

wassup

Easily scriptable terminal dashboard
Ruby
39
star
5

crunchygif

EZPZ VIDEO TO GIF CREATOR
Swift
34
star
6

fastlane-plugin-github_action

A plugin for setting up fastlane on GitHub Actions
Ruby
33
star
7

CropImageView

Super easy component for Android to crop an image
Java
33
star
8

connectkit-examples

21
star
9

NSDate-MinimalTimeAgo

NSDate category for very minimal style time ago
Objective-C
17
star
10

exportation

CLI tool of easy exporting/encrypting, and decrypting/importing of certificates and private keys
Ruby
17
star
11

ios-promises

[Deprecated] [Super no longer maintained] Objective-C implementation of jQuery-ish promises
Objective-C
17
star
12

LayoutOfRelativity

iOS relative layout rules
Objective-C
9
star
13

Notables-Swift

Protocol extensions for common NSNotifications for the lazy (me)
Swift
9
star
14

fastlane-plugin-queue

Queues for fastlane - with web interface 😱
Ruby
9
star
15

dotenv_to_ci

The laziest way to transfer environment variables from a .env file to a CI provider πŸ‘‹
Ruby
8
star
16

ionic-configurator

Configure Ionic (Cordova) config.xml files for individual environments using Mustache templating
JavaScript
8
star
17

swift-webframeworks-docker

Docker containers used for spinning up different Swift web frameworks
Swift
8
star
18

dotfiles

Vim Script
7
star
19

fastlane-plugin-rename_android_package

Ruby
7
star
20

wassup-swift

Wassup is a flexible and customizable dashboard for showing GitHub data.
Swift
7
star
21

ios-swift-test

Swift
7
star
22

chrome-circle-pr

Send a parameterized build to your CircleCI project from the push of a button while viewing your Pull Request on Github
JavaScript
7
star
23

fastlane-plugin-android_keystore

Generate an Android keystore file
Ruby
6
star
24

CircleShadowImageView

iOS UIImageView subclass for making a circle image with a shadow
Objective-C
6
star
25

ecto-lazy-float

Ecto.LazyFloat - An Ecto.Float that accepts binary and integers
Elixir
6
star
26

jenkins-ironmq

Start a Jenkins job from an IronMQ message
Ruby
5
star
27

Protocol-Android

Java
5
star
28

JHSidebar

Objective-C
5
star
29

JHTableViewPullRefresh

Objective-C
3
star
30

RestCat

A RESTful library for iOS
Objective-C
3
star
31

hubby

Ruby
3
star
32

wassup-swift-releases

3
star
33

grandpa-kennys-fishing-adventure-early-access

3
star
34

raven-rust

Rust
2
star
35

circleci-orbs

CircleCI Orbs that make my life easier 😊
2
star
36

html-pager

HTML Pager
Ruby
2
star
37

fastlane-plugin-revenuecat

A fastlane plugin for interacting with the RevenueCat Developer API
Ruby
2
star
38

PicPick

Java
2
star
39

Trajectory

Android routing library
Java
2
star
40

shift

Application backend
JavaScript
2
star
41

liveedutv-obs-overlay

A LiveEdu.tv overlay for use in OBS (or other streaming application)
HTML
2
star
42

fastlane-plugin-install_android

Ruby
2
star
43

homeboy

JavaScript
1
star
44

joshdholtz

Ruby
1
star
45

slack-receipt-bot

Elixir
1
star
46

SlideyMenuGuy

Objective-C
1
star
47

NProgressIsh-iOS

NProgress like style progress bar for iOS
Objective-C
1
star
48

fastlane-plugin-bomb_emoji

πŸ’£ all the emojis in the fastlane output
Ruby
1
star
49

raycast-revenuecat

TypeScript
1
star
50

climbon-api

Swift
1
star
51

cupcakegram-ios

Swift
1
star
52

Protocol

Protocol
Objective-C
1
star
53

Protocol-iOS

Objective-C
1
star
54

JHAccordion

Objective-C
1
star
55

NavBarSwipeTitle

Objective-C
1
star
56

old_harmonic

A Swift library for loading JSON objects and arrays into Swift objects
Swift
1
star
57

yeah-buddy

JavaScript
1
star
58

ionic-configurator-example

CSS
1
star
59

star-wars-a-new-app

Swift
1
star
60

fastlane-plugin-testfairy

Upload an IPA to TestFairy
Ruby
1
star
61

Rekt-Swift

Functional approach to altering CGRect
Swift
1
star
62

Mockery-iOS

iOS Web Framework?? Not sure what to call this yet
Objective-C
1
star
63

KSCrash-Locking-Up-In-Swift-Example

KSCrash locks up in Swift but not in Objective-C (both example included)
C
1
star
64

storekit-config-file-demo

Demo app on how to use StoreKit Config File with RevenueCat and StoreKit 2
Swift
1
star
65

JustTransloadit-iOS

A simple to use Transloadit library
Objective-C
1
star
66

test-repo-for-fastlane-plugin-github_action

Ruby
1
star
67

CLGeocoder-DoubleLookup

CLGeocoder+DoubleLookup - Give address components, get more address components back (like zip code)
Objective-C
1
star
68

altconf-fastlane-best-practices

AltConf Lab Session Slides - fastlane Best Practices
CSS
1
star