Coder Social home page Coder Social logo

lcslidetounlock's Introduction

LCSlideToUnlock is a simple slide to unlock iOS UI component.

language swift version xcode version CocoaPods compatible build state GitHub top language https://github.com/DevLiuSir/LCSlideToUnlock/blob/master/LICENSE platform GitHub code size in bytes commits count GitHub last commit GitHub commit activity Github Star GitHub forks GitHub watchers Twitter Follow


Requirements

  • iOS 13+
  • Xcode 11+
  • Swift 5.1+

Screencast

Effect of collection

  • Using enumerations to define LCSlideToUnlock animation types
/// 动画方向
///
/// - horizontal: 水平
/// - vertical: 垂直
/// - diagonalUp: 对角线往上
/// - diagonalDown: 对角线往下
public enum AnimationDirection {
    case horizontal
    case vertical
    case diagonalUp
    case diagonalDown
}

Design

horizontal vertical diagonalUp diagonalDown

Attribute

Attribute name Specific introduction of attributes
textStr LCSlideToUnlock of text
textColor LCSlideToUnlock text color
isEnableAutoreverses Whether to turn on and back animation
shimmerImage Gradient picture (You can only set one with shimmerColors)
shimmerColors The gradient color group (at least two elements, only one with shimmerImage)

Installation

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

Just add the LCSlideToUnlock folder to your project.

or use CocoaPods with Podfile:

pod 'LCSlideToUnlock'

You can use CocoaPods to install LCSlideToUnlock by adding it to your Podfile:

platform :ios, '12.0'
target '<Your Target Name>' do
use_frameworks!
pod 'LCSlideToUnlock'
end

Then, run the following command:

$ pod install

Example:

import UIKit
import LCSlideToUnlock

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        /******* LCSlideToUnlockView *******/
        let slideToUnlockView = LCSlideToUnlockView(frame: CGRect(x: 0, y: view.bounds.height - 100, width: view.bounds.width, height: 40))
        slideToUnlockView.textStr = "> Slide To Unlock "
        slideToUnlockView.textColor = .black
        slideToUnlockView.shimmerColors = [.white, .white]
        //slideToUnlockView.shimmerImage = UIImage(named: "gradient")
        slideToUnlockView.font = UIFont.systemFont(ofSize: 20)
        slideToUnlockView.animationDirection = .horizontal
        slideToUnlockView.isEnableAutoreverses = false
        slideToUnlockView.showFadeWithDuration(4)
        view.addSubview(slideToUnlockView)
    }
}

lcslidetounlock's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lcslidetounlock's Issues

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.