• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 12 years ago
  • Updated about 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SKInnerShadowLayer is a CAGradientLayer subclass that adds properties to create an inner shadow on a given layer.

#SKInnerShadowLayer

SKInnerShadowLayer is a CAGradientLayer subclass that adds properties to create an inner shadow on a given layer.

Usage

SKInnerShadowLayer takes the graphical properties of a CAGradientLayer that let you set the shadow, gradient, and border of a layer, and adds four properities that let you control the look of an inner shadow for the layer.

These properties are:

@property CGColorRef innerShadowColor;
@property CGSize innerShadowOffset;
@property CGFloat innerShadowRadius;
@property CGFloat innerShadowOpacity;

They behave similarly to their drop shadow counterparts.

Technique

The technique for drawing the inner shadow is simple. The layer:

  1. creates a path for rounded rect of the layer
  2. clips to this rounded rect
  3. creates a larger path around the rounded rect
  4. sets the shadow properties
  5. draws a shadow behind this shape

and this creates the illusion of an inner shadow.

Animations

These properties are all fully animatable. There is an example of a layer with an inner shadow opacity animation in the demo app. Being able to easily create animations is the immediate advantage of using CoreGraphics to draw an inner shadow instead of using an image resource.

More Repositories

1

SKBounceAnimation

A CAKeyframeAnimation subclass that lets you quickly and easily set a number of bounces, and start and end values, and creates an animation for you.
Objective-C
927
star
2

Promise

A Promise library for Swift, based partially on Javascript's A+ spec
Swift
622
star
3

Objective-Shorthand

Objective-Shorthand is a set of categories that make long things in Objective-C short. Additions welcome.
Objective-C
360
star
4

Meridian

Meridian is a web server written in Swift that lets you write your endpoints in a declarative way.
Swift
316
star
5

InstantCocoa

Instant Cocoa is a framework for making iOS apps.
Objective-C
250
star
6

NSArray-LongestCommonSubsequence

This is a category on NSArray that finds the indexes of the longest common subsequence with another array.
Objective-C
73
star
7

swift-sudoku

Swift
40
star
8

NonEmptyArray

An array in Swift that can't be empty
Swift
35
star
9

SchemaSwift

Generate Swift structs from PostgreSQL database schema
Swift
24
star
10

MandrillTransport-CakePHP

This enables using CakeEmail from CakePHP 2.0 with Mandrill.
PHP
19
star
11

SKTabBarController

A clone of UITabBarController to help understand UIViewController containment.
Objective-C
15
star
12

SKNavigationController

A clone of UINavigationController to help understand UIViewController containment.
Objective-C
15
star
13

pepin

JavaScript
12
star
14

SKStateMachine

A simple state machine, written in Objective-C, that uses metaprogramming to define transitions.
Objective-C
12
star
15

ColumnarGroupedTableView

Objective-C
11
star
16

SKReachability

SKReachability is a singleton that gives quick access to information about the connection.
Objective-C
5
star
17

Parser

A small library for parsing JSON in swift
Swift
4
star
18

BigInt

Swift
3
star
19

SwiftgreSQL

A synchronous blocking wrapper around libpq with no dependencies. Forked and modified from `vapor-community/postgresql`.
Swift
3
star
20

FTWStartupLaunch

A drop-in class that lets you set your program to launch at login.
Objective-C
2
star
21

Tablesum

Automatic table footers in pure JavaScript
JavaScript
1
star
22

FTWCache

Dead simple caching for Mac and iOS
Objective-C
1
star