├── RNRippleTableView
├── en.lproj
│ ├── InfoPlist.strings
│ └── MainStoryboard.storyboard
├── Default.png
├── Default@2x.png
├── Default-568h@2x.png
├── RNAppDelegate.h
├── RNViewController.h
├── RNRippleTableView-Prefix.pch
├── main.m
├── RNSampleCell.h
├── RNSampleCell.m
├── RNRippleTableView-Info.plist
├── RNViewController.m
└── RNAppDelegate.m
├── images
├── still.png
└── animated.gif
├── RNRippleTableView.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── curiosity.xcuserdatad
│ │ └── WorkspaceSettings.xcsettings
├── xcuserdata
│ └── curiosity.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── RNRipplingTableView.xcscheme
└── project.pbxproj
├── .gitignore
├── RNRippleTableView.podspec
├── LICENSE
├── RNRippleTableView.h
├── README.md
└── RNRippleTableView.m
/RNRippleTableView/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/images/still.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rnystrom/RNRippleTableView/HEAD/images/still.png
--------------------------------------------------------------------------------
/images/animated.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rnystrom/RNRippleTableView/HEAD/images/animated.gif
--------------------------------------------------------------------------------
/RNRippleTableView/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rnystrom/RNRippleTableView/HEAD/RNRippleTableView/Default.png
--------------------------------------------------------------------------------
/RNRippleTableView/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rnystrom/RNRippleTableView/HEAD/RNRippleTableView/Default@2x.png
--------------------------------------------------------------------------------
/RNRippleTableView/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rnystrom/RNRippleTableView/HEAD/RNRippleTableView/Default-568h@2x.png
--------------------------------------------------------------------------------
/RNRippleTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | *.xcworkspace
13 | !default.xcworkspace
14 | xcuserdata
15 | profile
16 | *.moved-aside
17 | DerivedData
18 | .idea/
19 |
--------------------------------------------------------------------------------
/RNRippleTableView/RNAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // RNAppDelegate.h
3 | // RNRipplingTableView
4 | //
5 | // Created by Ryan Nystrom on 5/20/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface RNAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/RNRippleTableView/RNViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // RNViewController.h
3 | // RNRipplingTableView
4 | //
5 | // Created by Ryan Nystrom on 5/20/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "RNRippleTableView.h"
11 |
12 | @interface RNViewController : UIViewController
13 |
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/RNRippleTableView/RNRippleTableView-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'RNRipplingTableView' target in the 'RNRipplingTableView' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_5_0
8 | #warning "This project uses features only available in iOS SDK 5.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/RNRippleTableView/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // RNRipplingTableView
4 | //
5 | // Created by Ryan Nystrom on 5/20/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "RNAppDelegate.h"
12 |
13 | int main(int argc, char *argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([RNAppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/RNRippleTableView/RNSampleCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // RNRippleCell.h
3 | // RNRipplingTableView
4 | //
5 | // Created by Ryan Nystrom on 5/20/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface RNSampleCell : UIView
13 | @property (nonatomic, strong, readonly) UILabel *titleLabel;
14 | @property (nonatomic, strong, readonly) CALayer *dividerLayer;
15 | @end
16 |
--------------------------------------------------------------------------------
/RNRippleTableView.xcodeproj/project.xcworkspace/xcuserdata/curiosity.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
6 |
7 | SnapshotAutomaticallyBeforeSignificantChanges
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/RNRippleTableView.xcodeproj/xcuserdata/curiosity.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/RNRippleTableView.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "RNRippleTableView"
3 | s.version = "0.1.5"
4 | s.summary = "A custom table view with highly detailed ripple animations."
5 | s.homepage = "https://github.com/rnystrom/RNRippleTableView"
6 | s.license = 'MIT'
7 | s.author = { "Ryan Nystrom" => "rnystrom@whoisryannystrom.com" }
8 | s.source = { :git => "https://github.com/rnystrom/RNRippleTableView.git", :tag => "0.1.5" }
9 | s.source_files = 'RNRippleTableView.{h,m}'
10 | s.platform = :ios
11 | s.ios.deployment_target = '6.0'
12 | s.requires_arc = true
13 | s.frameworks = 'QuartzCore'
14 | end
15 |
--------------------------------------------------------------------------------
/RNRippleTableView.xcodeproj/xcuserdata/curiosity.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | RNRipplingTableView.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 86799457174A9328008D1D4C
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Ryan Nystrom (http://whoisryannystrom.com)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/RNRippleTableView/RNSampleCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // RNRippleCell.m
3 | // RNRipplingTableView
4 | //
5 | // Created by Ryan Nystrom on 5/20/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import "RNSampleCell.h"
10 |
11 | @implementation RNSampleCell
12 |
13 | - (id)initWithFrame:(CGRect)frame {
14 | if (self = [super initWithFrame:frame]) {
15 | [self _init];
16 | }
17 | return self;
18 | }
19 |
20 | - (id)initWithCoder:(NSCoder *)aDecoder {
21 | if (self = [super initWithCoder:aDecoder]) {
22 | [self _init];
23 | }
24 | return self;
25 | }
26 |
27 | - (void)_init {
28 | _titleLabel = [[UILabel alloc] init];
29 | _titleLabel.backgroundColor = [UIColor clearColor];
30 | _titleLabel.textAlignment = NSTextAlignmentCenter;
31 | [self addSubview:_titleLabel];
32 |
33 | _dividerLayer = [CALayer layer];
34 | _dividerLayer.backgroundColor = [UIColor whiteColor].CGColor;
35 | [self.layer addSublayer:_dividerLayer];
36 | }
37 |
38 | - (void)layoutSubviews {
39 | [super layoutSubviews];
40 | self.titleLabel.frame = self.bounds;
41 | CGFloat dividerWidth = self.bounds.size.width / 2;
42 | self.dividerLayer.frame = CGRectMake(dividerWidth / 2, 0, dividerWidth, 1);
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/RNRippleTableView/RNRippleTableView-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | Ryan-Nystrom.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | MainStoryboard
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UIViewEdgeAntialiasing
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/RNRippleTableView/RNViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // RNViewController.m
3 | // RNRipplingTableView
4 | //
5 | // Created by Ryan Nystrom on 5/20/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import "RNViewController.h"
10 | #import
11 | #import "RNSampleCell.h"
12 |
13 | @interface RNViewController ()
14 | @property (weak, nonatomic) IBOutlet RNRippleTableView *rippleView;
15 | @end
16 |
17 | @implementation RNViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | self.view.backgroundColor = [UIColor colorWithRed:117/255.f green:184/255.f blue:174/255.f alpha:1];
22 | self.rippleView.ripplesOnShake = YES;
23 | [self.rippleView registerContentViewClass:[RNSampleCell class]];
24 | self.rippleView.delegate = self;
25 | self.rippleView.dataSource = self;
26 | }
27 |
28 | - (void)viewDidAppear:(BOOL)animated {
29 | [super viewDidAppear:animated];
30 | [self.rippleView becomeFirstResponder];
31 | }
32 |
33 | #pragma mark - Tableview datasource
34 |
35 | - (NSInteger)numberOfItemsInTableView:(RNRippleTableView *)tableView {
36 | return 10;
37 | }
38 |
39 | - (UIView *)viewForTableView:(RNRippleTableView *)tableView atIndex:(NSInteger)index withReuseView:(RNSampleCell *)reuseView {
40 | reuseView.backgroundColor = [UIColor colorWithRed:117/255.f green:184/255.f blue:174/255.f alpha:1];
41 | reuseView.titleLabel.text = [NSString stringWithFormat:@"Cell %i",index+1];
42 | reuseView.titleLabel.textColor = [UIColor whiteColor];
43 | reuseView.titleLabel.font = [UIFont boldSystemFontOfSize:17];
44 | reuseView.titleLabel.shadowColor = [UIColor colorWithWhite:0 alpha:0.1f];
45 | reuseView.titleLabel.shadowOffset = CGSizeMake(0, -1);
46 | reuseView.dividerLayer.backgroundColor = [UIColor whiteColor].CGColor;
47 | return reuseView;
48 | }
49 |
50 | #pragma mark - Tableview delegate
51 |
52 | - (CGFloat)heightForViewInTableView:(RNRippleTableView *)tableView atIndex:(NSInteger)index {
53 | return 55;
54 | }
55 |
56 | - (void)tableView:(RNRippleTableView *)tableView didSelectView:(UIView *)view atIndex:(NSInteger)index {
57 | NSLog(@"Row %i tapped",index);
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/RNRippleTableView/RNAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // RNAppDelegate.m
3 | // RNRipplingTableView
4 | //
5 | // Created by Ryan Nystrom on 5/20/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import "RNAppDelegate.h"
10 |
11 | @implementation RNAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | return YES;
17 | }
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application
20 | {
21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
23 | }
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application
26 | {
27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application
32 | {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application
37 | {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application
42 | {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/RNRippleTableView.h:
--------------------------------------------------------------------------------
1 | //
2 | // RNTableView.h
3 | // TableView
4 | //
5 | // Created by Ryan Nystrom on 5/18/13.
6 | // Copyright (c) 2013 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class RNRippleTableView;
12 |
13 | @protocol RNRippleTableViewDataSource
14 | @required
15 | - (NSInteger)numberOfItemsInTableView:(RNRippleTableView *)tableView;
16 | - (UIView *)viewForTableView:(RNRippleTableView *)tableView atIndex:(NSInteger)index withReuseView:(UIView *)reuseView;
17 | @end
18 |
19 | @protocol RNRippleTableViewDelegate
20 | @optional
21 | - (CGFloat)heightForViewInTableView:(RNRippleTableView *)tableView atIndex:(NSInteger)index;
22 | - (void)tableView:(RNRippleTableView *)tableView didSelectView:(UIView *)view atIndex:(NSInteger)index;
23 | @end
24 |
25 | @interface RNRippleTableView : UIScrollView
26 |
27 | @property (nonatomic, weak) id dataSource;
28 | @property (nonatomic, weak) id delegate;
29 |
30 | @property (nonatomic, assign) BOOL rippleEnabled; // default YES
31 | @property (nonatomic, assign) BOOL isAnchoredLeft; // default YES
32 | @property (nonatomic, assign) NSInteger rippleOffset; // default 3
33 | @property (nonatomic, assign) CGFloat rippleAmplitude; // default 20 (degrees)
34 | @property (nonatomic, assign) CGFloat rippleDuration; // default 0.75 seconds
35 | @property (nonatomic, assign) BOOL ripplesOnShake; // default NO
36 | @property (nonatomic, assign) CGFloat rippleDelay; // default 0.1f
37 | @property (nonatomic, assign) BOOL rippleHasParentShading; // default YES
38 | @property (nonatomic, assign) BOOL rippleHasShading; // default YES
39 |
40 | - (void)registerContentViewClass:(Class)contentViewClass;
41 | - (void)reloadData;
42 | - (NSArray *)visibleViews;
43 | - (UIView *)viewForIndex:(NSInteger)index;
44 |
45 | // animate individual cells
46 | - (void)bounceView:(UIView *)view;
47 | - (void)bounceView:(UIView *)view amplitude:(CGFloat)amplitude;
48 | - (void)bounceView:(UIView *)view amplitude:(CGFloat)amplitude duration:(CGFloat)duration;
49 |
50 | // animate ripple effect
51 | - (void)rippleAtOrigin:(NSInteger)originIndex;
52 | - (void)rippleAtOrigin:(NSInteger)originIndex amplitude:(CGFloat)amplitude;
53 | - (void)rippleAtOrigin:(NSInteger)originIndex amplitude:(CGFloat)amplitude duration:(CGFloat)duration;
54 | @end
55 |
--------------------------------------------------------------------------------
/RNRippleTableView/en.lproj/MainStoryboard.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/RNRippleTableView.xcodeproj/xcuserdata/curiosity.xcuserdatad/xcschemes/RNRipplingTableView.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | RNRippleTableView
2 | ===
3 |
4 | A custom table view with highly detailed ripple animations.
5 |
6 | ## Level of Detail ##
7 |
8 | I created this control from a [couple](http://dribbble.com/shots/1072843-Filp-Menu?list=users) [posts](http://dribbble.com/shots/1072843-Filp-Menu/attachments/132747) on [Dribbble](http://dribbble.com/) by [Boris Valusek](http://dribbble.com/BorisValusek) out of pure curiosity. I really wanted to nail the shadow animations as well as a bounce effect that followed diminishing return rules on amplitude as well as plausible timing. Take a look at some screens and animations.
9 |
10 |
11 |
12 | To enable [Anti-Aliasing](http://en.wikipedia.org/wiki/Spatial_anti-aliasing) you'll need to set the [UIViewEdgeAntialiasing](http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html) key to YES in your Info.plist. Doing so will impact performance, but if you're an optimizer you'll end up with good performance and sweet, sweet line edges like this:
13 |
14 |