Giter Site home page Giter Site logo

sabarics / snshadow Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 446 KB

SNShadow with Neumorphism style design.

License: MIT License

Ruby 13.80% Objective-C 4.44% Swift 81.75%
shadow neomorphism snshadow shadows swift-neomorphism ios-neomorphism neomorphism-ios ios swift

snshadow's Introduction

Version

SNShadow(Neomorphism)

SNShadow with Neumorphism style design. Creating a UIView with shadows , cornered radius and 3D effect(Neomorphism) is a lot more challenging than one may think. Using this helper class you can simply create a view with corner radius, shadows with 3D in no time at all.

Screenshots

SNShadowView file contains the custom helper class. Whenever you want to create a UIView of this kind just make a instance of Class Name class and use the custom initialiser to pass the preferred values for shadowRadius, view's cornerRadius, shadowOffset, shadowOpacity & shadowColor.

Requirements

  • iOS 11.0+
  • Xcode 10.2+
  • Swift 5+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate SNShadowSDK into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SNShadowSDK'

Usage

Shadow in View

Use SNShadowView class as UIView to make this View has shadow.

Use Storyboard

Image of Storyboard

For Right & Bottom Shadow(shadowWidth1,shadowHeight1) - Give positive value. eg: 2

For Left & Top Shadow(shadowWidth1,shadowHeight1) - Give negative value. eg: -2

  • Types of Shadows
    • Outer Shadow - By default shadow will be Outer shadow
    • Inner Shadow - Toggle Inner shadow to Yes

Image of Storyboard

Programmatically

import SNShadowSDK
@IBOutlet weak var viewOne: SNShadowView!

Set Shadow

@IBOutlet weak var viewTwo: SNShadowView!{
        didSet{
            viewTwo.setInnerShadow()
        }
    }
viewOne.setInnerShadow()

Function to set Shadow

  • setInnerShadow()
  • setOuterShadow()

snshadow's People

Contributors

sabarics avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.