GithubHelp home page GithubHelp logo

createwithflow / checkboxes Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 3.0 3.02 MB

A repo of 32 custom UIButtons with Checkbox animations for iOS. Made with Flow.

Home Page: https://createwithflow.com

Swift 100.00%
flow animation button checkbox swift coreanimation

checkboxes's Introduction

Checkboxes

A set of 32 awesome checkbox buttons, FREE to use.

Written in pure Swift, using Core Animation.

Made with Flow.

Story

We created and shipped all 32 of these animations in two days. We drew on inspirations from Dribbble, all designs were created in Figma > here's the file. All code was exported using the iOS Toggle Button option in Flow.

Want to know how we did this so quickly? Check out our article: Animate and Ship 50 iOS Spinners in 48 hours < Different project, but the same process.

Usage

Each class has its own unique initializer. For example:

CheckInButton(frame: frame)

You can also use our convience class, like so:

Checkboxes.create(.checkin)

Structure

We offer a common, basic subclass of UIButton.

ToggleButton: UIButton {
  ...
}

This basic subclass handles the construction of the button, provides the space for common styling additions, and syncs playback of one or more timeliens with native UIButton methods.

Custom Subclasses

Each button is a subclass of ToggleButton.

CheckInButton: ToggleButton {
  ...
}

Native Animation Code

Animations are written in Swift. They require a few lightweight classes that can be found in FlowCommoniOS.

Our animations take full advantage of native Core Animation, most prominently CAKeyFrameAnimation.

Here is a sample of our animation code:

let strokeEndAnimation: CAKeyframeAnimation = {
    let keyframeAnimation = CAKeyframeAnimation()
    keyframeAnimation.keyPath = "strokeEnd"
    keyframeAnimation.values = [0.16, 0.99]
    keyframeAnimation.keyTimes = [0, 1] 
    keyframeAnimation.timingFunctions = [.easeInEaseOut]
    keyframeAnimation.duration = duration
    return keyframeAnimation
}()

Installation

When we ship a cocoapod for this project, we'll update the instructions here.

For now, please download and install manually.

  1. Download the project.
  2. Install FlowCommon into your project (copy the files in this repo, or install via FlowCommoniOS).
  3. Copy ToggleButton.flow
  4. For each checkbox your want to use, copy three files into your project:
<Animation>Button.swift
<Animation>Timeline.swift
<Animation>View.swift

For example, to use the Abbaci checkbox you would copy these files:

AbbaciButton.swift
AbbaciTimeline.swift
AbbaciView.swift

Types & Shots

We love Dribbble and a lot of the animations in this project were originally inspired by other people's great work, which we riffed on and added our own flair and rebounded with links to the original post and designer. Each checkbox is posted to Flow's Official Dribbble Account, and in the writeup for each shot we've referenced the original, and the maker.

Below is the list of all 32, and the names are identical to the enum cases in the project.

type name shot
abbaci
affirm
alarm
allinone
ambiance
bounce
boxed
burst
checkin
dashing
didot
disguise
fluid
grown
guesshow
layers
lovely
mondo
overt
partition
pinkie
pop
prime
simpleton
slices
starburst
tick
tracer
transitive
weebly
windmill
zombo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.