Presentation helps you to make tutorials, release notes and animated pages.

Overview

⚠️ DEPRECATED, NO LONGER MAINTAINED

Presentation logo

Version CI Status Carthage Compatible Swift License Platform

Looking for the easiest way of presenting something in your iOS app? Then you are in the right place. Presentation will help you make your tutorials, release notes and any kind of animated pages with the minimum amount of effort.

Presentation includes the following features:

  • Custom positioning: You can use Position for percentage-based position declaration.
  • Content: View model used for custom positioning and animations. It translates your percents to AutoLayout constraints behind the scenes.
  • Slides: You can use any kind of UIViewController as a slide. SlideController is your good friend if you want to use custom positioning and animation features on your pages.
  • Background: You can add views that are visible across all the pages. Also it's possible to animate those views during the transition to the specific page.
  • Animations: You can easily animate the appearance of a view on the specific page.

Presentation works both on the iPhone and the iPad. You can use it with both Swift and Objective-C.

Try one of our demos to see how it works:

pod try Presentation

Table of Contents

Usage

Presentation controller

import Presentation

let viewController1 = UIViewController()
viewController1.title = "Controller A"

let viewController2 = UIViewController()
viewController2.title = "Controller B"

let presentationController = PresentationController(pages: [viewController1, viewController2])

If that's the only thing you need, look into Pages.

Position

Position is percentage-based; you can use left, right, top, bottom to set a position.

let position = Position(left: 0.3, top: 0.4)

Content view model

Content view model is a layer between UIView and Position. The current position is the center of a view by default, but can also be changed to the origin of a view.

let view = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
let position = Position(left: 0.3, top: 0.4)

let centeredContent = Content(view: label, position: position)
let originContent = Content(view: label, position: position, centered: false)

Slides

let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
label.text = "Slide 1"

let position = Position(left: 0.3, top: 0.4)
let content = Content(view: label, position: position)

let controller = SlideController(contents: [content])

presentationController.add([controller])

Page animations

Content in let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 100)) label.text = title let position = Position(left: 0.3, top: 0.4) return Content(view: label, position: position) } var slides = [SlideController]() for index in 0...2 { let content = contents[index] let controller = SlideController(contents: [content]) let animation = TransitionAnimation( content: content, destination: Position(left: 0.5, top: content.initialPosition.top), duration: 2.0, dumping: 0.8, reflective: true) controller.add(animations: [animation]) slides.append(controller) } presentationController.add(slides) ">
let contents = ["Slide 1", "Slide 2", "Slide 3"].map { title -> Content in
  let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
  label.text = title

  let position = Position(left: 0.3, top: 0.4)

  return Content(view: label, position: position)
}

var slides = [SlideController]()

for index in 0...2 {
  let content = contents[index]
  let controller = SlideController(contents: [content])
  let animation = TransitionAnimation(
    content: content,
    destination: Position(left: 0.5, top: content.initialPosition.top),
    duration: 2.0,
    dumping: 0.8,
    reflective: true)
  controller.add(animations: [animation])

  slides.append(controller)
}

presentationController.add(slides)

Background views

let imageView = UIImageView(image: UIImage(named: "image"))
let content = Content(view: imageView, position: Position(left: -0.3, top: 0.2))

presentationController.addToBackground([content])

// Add pages animations
presentationController.add(animations: [
  TransitionAnimation(content: content, destination: Position(left: 0.2, top: 0.2))],
  forPage: 0)

presentationController.add(animations: [
  TransitionAnimation(content: content, destination: Position(left: 0.3, top: 0.2))],
  forPage: 1)

Installation

Presentation is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Presentation'

Presentation is also available through Carthage. To install just write into your Cartfile:

github "hyperoslo/Presentation"

Components

Presentation wouldn’t be possible without the help of these components:

  • Pages: The easiest way of setting up a UIPageViewController

  • Cartography: Helps you set up your Auto Layout constraints declaratively and without any stringly typing!

Contributing

Please see our playbook for guidelines on contributing.

Credits

Hyper made this. We’re a digital communications agency with a passion for good code and delightful user experiences. If you’re using this library we probably want to hire you (we consider remote employees, too; the only requirement is that you’re awesome).

License

Presentation is available under the MIT license. See the LICENSE.

Comments
  • Bug: animation glitch / improper scrolling behavior

    Bug: animation glitch / improper scrolling behavior

    Run a demo, then: steps to reproduce the bug:

    1. Press Next Page or scroll to the next / previous page
    2. While application keeps inertial scrolling (fingers are off the screen), try to touch and scroll text label only. You have to be fast.
    3. After view has scrolled to the other page, try to scroll it again. You'll see the glitch.

    Start: screen shot 2015-06-10 at 10 29 58 Pay attention to the positions of background objects on the screen.

    Before glitch: screen shot 2015-06-10 at 10 30 04

    The positions of the background objects are the same, while label has scrolled to another one. If you try to touch screen and scroll after, you'll see the glitch.

    Issue is reproducible in both of demos.

    opened by richardtop 7
  • Demo with parallax scrolling

    Demo with parallax scrolling

    It's about the demo I've presented today. Have 2 questions to discuss:

    • What is the best name for it - Parallax, ParallaxSlides, MagicMove or something else?
    • Should we add a mark in the name that it's iPad only demo (related to both demos we have)?
    • Do we need to put some text on the each slide or that's enough to have jsut images, animations and so on?
    opened by vadymmarkov 7
  • Tapping on UINavigationController disables swiping

    Tapping on UINavigationController disables swiping

    In both samples, tapping on the UINavigationController's next or previous buttons disables the swiping of the pages.

    The swiping should still be allowed when the user uses one of these nav buttons.

    opened by ghost 6
  • Force to use attributed text

    Force to use attributed text

    While testing I've discovered that setting style attributes via UILabel.appearance() doesn't always work as expected. That's why I've decided to add support of NSAttributedString that makes it even more customisable. Now it's possible to set any attributes you want both for title and text in any model.

    opened by vadymmarkov 6
  • Not compatible with Swift 2.0

    Not compatible with Swift 2.0

    This looks AMAZING. I really want to use it for my latest project but it's got a few issues working with Swift 2.0. I can try to fix it but wondering if you guys are already on it?

    opened by davemen 4
  • Improve: Universal examples

    Improve: Universal examples

    Now both examples are universal apps, so they can be run on both iPhone and iPad. Assets used in Parallax demo are not optimised for iPhone, but I would say it doesn't look that bad 😄

    opened by vadymmarkov 3
  • Button not tappable

    Button not tappable

    I tried adding a tappable UIButton to the example in configureBackground(). It doesn't work as addToBackground is taking the touch events.

    Same issue as in https://stackoverflow.com/questions/24814401/uibutton-targets-not-working-if-a-uiview-is-added-as-a-subview

    opened by ghost 3
  • Add view model to manage positioning, introduce new layers

    Add view model to manage positioning, introduce new layers

    • Add Content - view model to manage positioning.
    • Introduce 2 layers:
      • Scene: everything that is visible across all the pages. Now you can add Content items to the scene and animations to animate views on the specified page.
      • Slides :view controllers for the each page. You can add regular UIViewController or SlideController if you want to use custom positioning and animations of Content view models.
    • Combine appearance and transition animations.
    • Back to autolayout.
    opened by vadymmarkov 3
  • How to dismiss the tutorial ?

    How to dismiss the tutorial ?

    Hi !

    Thanks for this great library ! I'm trying to implement it at the opening of my app but at the end of the tutorial, I want to change the "next" button with a "Close" button or something like that (or putting a big "Start using the app" button in the middle of the screen"...)

    Do you have any hints on how to do that ?

    Thanks !

    opened by Hugoo 2
  • Fix gesture animations

    Fix gesture animations

    Animations on swipe have been broken after this PR https://github.com/hyperoslo/Presentation/pull/102. I think calculations were a bit wrong @chrilith

    opened by vadymmarkov 2
  • Fixed unexpected positioning swiping fast with the finger

    Fixed unexpected positioning swiping fast with the finger

    Hi,

    I found that when swiping with the finger instead of prev/next buttons, the offset may go over the expected bounds and thus, the last position (or alpha value) may ends at an unexpected position.

    Clamping the offset to [0..1] fixed the problem for me, so here is my fix :)

    Thanks!

    opened by chrilith 2
Releases(4.1.2)
Owner
HyperRedink
Connected creativity
HyperRedink
SwiftUI animation tutorials, all of demos are consisted of youtube videos at website of kavsoft

SwiftUI animation tutorials, all of demos are consisted of youtube videos at website of kavsoft

Yonggang Liu 155 Sep 14, 2022
ButtonClickStyle - This is a Customizable/Designable Button View, with 15 animated click styles, that allows you to design your own buttons from subviews, in storyboard and xib right away.

ButtonClickStyle - This is a Customizable/Designable Button View, with 15 animated click styles, that allows you to design your own buttons from subviews, in storyboard and xib right away.

Rustam 24 Sep 15, 2022
Tools for SwiftUI that helps perform Path and Shape animations, such us morphing circle or shape transformations

SwiftUI+PathAnimations ?? Introduction This packages contains SimilarShape and InterpolatedShape, both can be used to achieve shapes animations with S

Alfredo Delli Bovi 173 Sep 16, 2022
Apple's SwiftUI Essentials Series. An iOS app that helps users manage their daily scrums.

Scrumdinger (Work in progress) Apple's SwiftUI Essentials Series An iOS app that helps users manage their daily scrums. To help keep scrums short and

Vinícius Moreira 1 Feb 14, 2022
Simple and powerful animated progress bar with dots

Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 8.0+ Swift 3.0+ Installatio

Nikola Corlija 41 Sep 21, 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 49 Sep 24, 2022
Appstore card animation transition. UICollectionView and UITableView card expand animated transition

Appstore card animation transition. UICollectionView and UITableView card expand animated transition. This library tries to add the appstore transition to your own app. The goal is to be as simple as possible to integrate in an app while keeping the flexibility and customization alive.

appssemble 537 Sep 19, 2022
A simple animated progress bar in Swift

DSGradientProgressView Introduction DSGradientProgressView is a simple and customizable animated progress bar written in Swift. Inspired by GradientPr

Dhol Studio 445 Sep 3, 2022
🚀 It Makes easy to track your task 🔥 Beautiful & Animated UI👨🏻‍💻 . Contributions are always welcome 🤗

Taskey ?? What is Taskey ?? ? Taskey is an application build in SwiftUI to track your task with a beautiful animations and UI . Also used core data to

Mohd Yasir 35 Aug 29, 2022
An animated trophy banner that looks like Xbox achievement 🏆

TrophyKit An animated trophy banner that looks like Xbox achievement. Demo demo.mov Usage Requirements iOS 14.0+ tvOS 14.0+ Swift 5.3+ Installation Tr

Yubo Qin 11 Jul 18, 2022
Colorful - A SwiftUI implementation of AppleCard's animated colorful blur background.

Colorful - A SwiftUI implementation of AppleCard's animated colorful blur background.

Lakr Aream 188 Sep 8, 2022
Simple Animated tabbar with native control

SSCustomTabbar Simple Animated tabbar with native control. Requirements iOS 11.0+ Xcode 10.0+ Installation SSCustomTabbar doesn't contain any external

Simform Solutions 429 Sep 8, 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 Jul 12, 2022
AnimatedWaveform provides the user with an animated version of the waveform.circle SF Symbol in SwiftUI.

AnimatedWaveform AnimatedWaveform is a Swift Package designed for SwiftUI. It provides the user with an animated version of the waveform.circle SF Sym

Kevin 3 Jan 11, 2022
Animated Minimal Podcast App UI using SwiftUi 3.0 🤓

Minimal Podcast App UI Animated Minimal Podcast App UI using SwiftUi 3.0 ?? Video Preview Screenshots Features SwiftUI 3D Card Animation SwiftUI Delay

Shameem Reza 4 Apr 6, 2022
🚀 It Makes easy to track your task 🔥 Beautiful & Animated UI👨🏻‍💻 . Contributions are always welcome 🤗

Taskey ?? What is Taskey ?? ? Taskey is an application build in SwiftUI to track your task with a beautiful animations and UI . Also used core data to

AppLobby 35 Aug 29, 2022
Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle.

Twinkle ✨ Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle. This library creates several CAEmitterLayers and animate

patrick piemonte 599 Aug 11, 2022
LottieUI - A library developed to make Lottie easy to implement. It supports iOS and macOS

LottieUI It is a library developed to make Lottie easy to implement. It supports

jasu 37 Sep 9, 2022
A DSL to make animation easy on iOS with Swift.

This project is highly inspired by JHChainableAnimations, If you project is developed with Objective-C, use JHChainableAnimations instead. With DKChai

Draven 1.9k Sep 14, 2022