• Stars
    star
    284
  • Rank 145,616 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 11 years ago
  • Updated about 6 years ago

Reviews

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

Repository Details

UIView subclass backed by CAShapeLayer

CKShapeView

CKShapeView is a UIView subclass that is backed by a CAShapeLayer.

In other words, it is a view that is capable of rendering an arbitrary CGPath.

It is completely configurable and animatable, so you can have custom drawn views without needing to subclass.

CKShapeView has all of the properties of CAShapeLayer, with the addition of a hitTestUsingPath property that allows you to hit test using the path instead of the view's bounds.

Example Usage

CKShapeView *pieView = [[CKShapeView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
CGFloat width = CGRectGetWidth(pieView.bounds);
pieView.path = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(pieView.bounds, width/4, width/4)];
pieView.lineWidth = width/2;
pieView.fillColor = nil;
pieView.strokeColor = [UIColor blackColor];
[self.view addSubview:pieView];

UIViewAnimationOptions options = UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat;
[UIView animateWithDuration:1.0f delay:0.0f options:options animations:^{
    pieView.strokeEnd = 0.0f;
} completion:nil];

Example

License

CKShapeView is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

BlockTypeDescription

Show type signatures when logging blocks
Objective-C
255
star
2

CKBlurView

A demo of the private blur APIs in iOS 7
Objective-C
171
star
3

webn.es

An NES emulator for everyone
JavaScript
166
star
4

Open

Open apps from shell on iOS
Objective-C
99
star
5

nes-ios

NES framework for iOS
Objective-C
99
star
6

jetsamctl

Control Jetsam on iOS
C
90
star
7

BTNotificationEnabler

Send all iOS notifications to your Pebble
Shell
50
star
8

Wallet

Kotlin
45
star
9

MotionControl

Leap Motion + Mission Control
Objective-C
40
star
10

Force

An implementation of a force directed graph layout in Swift
Swift
40
star
11

codesign_fix

Objective-C
32
star
12

GoogleCloudPrint

Integrates Google Cloud Print into iOS
Objective-C
31
star
13

Sixpair

Pair a PS3 Sixaxis controller to your iPhone
C
24
star
14

UserAgentFaker

Fake your user agent in iOS
Objective-C
22
star
15

MyoActivator

Use hand gestures to control your iOS device
Objective-C
20
star
16

WWDC2014

WWDC Student Scholarship App
Objective-C
20
star
17

QuickQR

It brings the 'quick' back into 'quick response'!
Objective-C
18
star
18

plist-rs

Property list parser in Rust
Rust
18
star
19

YikYakAPI

Python implementation of the private Yik Yak API
Python
13
star
20

CYContext

Objective-C
11
star
21

NSData-FILE

Open an NSData object as a FILE stream
Objective-C
9
star
22

Gesturizer

Custom gesture recognition for iOS
Objective-C
9
star
23

GamepadBridge

HTML5 Gamepad API support for iOS
Objective-C
8
star
24

JigSolver

HackNY Fall 2013 - A backend to place jigsaw puzzle pieces, given an image of the piece and the board
Python
7
star
25

Tweaks

A collection of small tweaks for iOS
Ruby
6
star
26

mixpanel-simple

Objective-C
5
star
27

AMShortenURL

A URL Shortener for Ryan Petrich's Action Menu.
Objective-C
4
star
28

DCImagePickerController

Multiple-selecting replacement for UIImagePickerController
Objective-C
2
star
29

BonjourToggle

SBSettings toggle to toggle Bonjour broadcasting on iOS
Objective-C
2
star
30

energy-data

A collection of energy data, focused on US solar
Rust
2
star
31

VEXScore

Clean VEX Toss Up scoring application
Objective-C
2
star
32

TrackingNotifier

Get a notification when remote locate is enabled
Objective-C
2
star
33

mission.party

The website for Mission Control
1
star
34

Box2D

An unnoficial git-svn clone of Box2D, updated regularly.
C
1
star
35

MineRCON

A Remote CONsole client for Minecraft servers
Objective-C
1
star