Giter Site home page Giter Site logo

nangdv-info / ppmusicimageshadow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pierreperrin/ppmusicimageshadow

0.0 1.0 0.0 3.08 MB

PPMusicImageShadow is a view that imitates in real time the shadow blurred effect of iOS Music App.

Home Page: https://github.com/PierrePerrin/ShadowView

License: MIT License

Ruby 4.12% Objective-C 3.44% Swift 92.43%

ppmusicimageshadow's Introduction

Check my new repo for impoved performances and compatibility of this effect (Now compatible for all UIVIews) https://github.com/PierrePerrin/ShadowView

PPMusicImageShadow

Synopsis

PPMusicImageShadow is a view that imitates in real time the shadow blurred effect of iOS Music App.

alt tag alt tag alt tag

Installation

CocoaPods

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

$ gem install cocoapods

To integrate PPMusicImageShadow into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
pod 'PPMusicImageShadow'
end

Manually

If you prefer you can clone the project, release the framework or use the view swift file directly.

Code Example

Storyboard Example

Insert a normal UIView in your viewController.

alt tag alt tag

Change it class with "PPMusicImageShadow". Now you can set an image like an imageView, a blur radius, and a corner radius.

Programing Example

import PPMusicImageShadow

class ProgramingExampleViewController: UIViewController {

    var exampleView : PPMusicImageShadow!


    override func viewDidLoad() {
        super.viewDidLoad()

        self.addEffectView()
        self.prepareExampleView()
        self.setImageToExampleView()
    }

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()

        self.exampleView.center = self.view.center
    }

    //MARK: Example
    func addEffectView(){

        self.exampleView = PPMusicImageShadow(frame: CGRect.init(x: 0, y: 0, width: 300, height: 300))
        self.view.addSubview(self.exampleView)
    }

    func setImageToExampleView(){

        let image = UIImage(named: "prairie-679016_1920.jpg")
        self.exampleView.image = image
    }

    func prepareExampleView(){

        self.exampleView.cornerRaduis = 10
        self.exampleView.blurRadius = 5
    }
}

ppmusicimageshadow's People

Contributors

basthomas avatar pierreperrin avatar

Watchers

 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.