Giter Site home page Giter Site logo

mrsunx / gradient-view Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matvdg/gradient-view

0.0 1.0 0.0 186 KB

A Swift 4 UIView class with a gradient rendered and customizable in the storyboard (colors, direction, shadows, cornerRadius...)

License: Apache License 2.0

Swift 100.00%

gradient-view's Introduction

Gradient-View

A Swift 4 UIView class with a gradient customizable in the storyboard (colors, direction, shadows, cornerRadius...)

GradientView: UIView is a @IBDesignable class so that it's rendered in your storyboard, and all its properties are @IBInspectable so that you can customize your gradient view inside the storyboard in the Attributes inspector.

Quick install:

  • Just drag this class into your project
  • In your storyboard, select a UIView
  • Go the the identity inspector and in the class field, type GradientView instead of UIView
  • Play with the attributes inspector with real-times results!
    • you can select two colors for the gradient
    • and one color for the shadow
    • you can choose the shadow position (x/y) and its blur
    • the direction of the gradient (top left is 0,0 and bottom right is 1,1) from the start point to the end point
    • the corner radius of your view
    • you can animate the gradient to another one by calling the animate(duration: TimeInterval, newTopColor: UIColor, newBottomColor: UIColor)method

Image of Gradient View

gradient-view's People

Contributors

matvdg avatar

Watchers

mrxuan avatar

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.