Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011 Luke Redpath
Copyright (c) 2011–2012 Luke Redpath and Alexsander Akers

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
14 changes: 14 additions & 0 deletions LRSlidingTableViewCell.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Pod::Spec.new do |s|
s.name = 'LRSlidingTableViewCell'
s.version = '1.0'
s.license = 'MIT'
s.summary = 'A simple implementation of sliding table cells, first seen in Tweetie for iPhone.'
s.homepage = 'https://github.com/pandamonia/LRSlidingTableViewCell'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Luke Redpath' => 'luke@lukeredpath.co.uk' }
s.source = { :git => 'https://github.com/pandamonia/LRSlidingTableViewCell.git', :tag => 'v1.0' }
s.platform = :ios
s.source_files = 'SlidingTableCell/LRSlidingTableViewCell.{h,m}'
s.clean_paths = 'SlidingTableCell.xcodeproj/', 'SlidingTableCell/Sample/'
s.requires_arc = true
end
13 changes: 8 additions & 5 deletions SlidingTableCell.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
A3D9A34A138EA2D100AFBA90 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A3D9A348138EA2D100AFBA90 /* MainWindow.xib */; };
A3D9A34D138EA2D100AFBA90 /* SlidingTableCellViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D9A34C138EA2D100AFBA90 /* SlidingTableCellViewController.m */; };
A3D9A350138EA2D100AFBA90 /* SlidingTableCellViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A3D9A34E138EA2D100AFBA90 /* SlidingTableCellViewController.xib */; };
A3D9A358138EA40900AFBA90 /* LRSlidingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D9A357138EA40900AFBA90 /* LRSlidingTableViewCell.m */; };
A3D9A358138EA40900AFBA90 /* LRSlidingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D9A357138EA40900AFBA90 /* LRSlidingTableViewCell.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -43,9 +43,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A3D9A337138EA2D100AFBA90 /* UIKit.framework in Frameworks */,
A3D9A339138EA2D100AFBA90 /* Foundation.framework in Frameworks */,
A3D9A33B138EA2D100AFBA90 /* CoreGraphics.framework in Frameworks */,
A3D9A339138EA2D100AFBA90 /* Foundation.framework in Frameworks */,
A3D9A337138EA2D100AFBA90 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -141,6 +141,7 @@
A3D9A329138EA2D100AFBA90 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
ORGANIZATIONNAME = "LJR Software Limited";
};
buildConfigurationList = A3D9A32C138EA2D100AFBA90 /* Build configuration list for PBXProject "SlidingTableCell" */;
Expand Down Expand Up @@ -227,7 +228,7 @@
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
SDKROOT = iphoneos;
};
name = Debug;
Expand All @@ -241,7 +242,7 @@
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
};
Expand All @@ -255,6 +256,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SlidingTableCell/Sample/SlidingTableCell-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "SlidingTableCell/Sample/SlidingTableCell-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
Expand All @@ -268,6 +270,7 @@
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SlidingTableCell/Sample/SlidingTableCell-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "SlidingTableCell/Sample/SlidingTableCell-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
VALIDATE_PRODUCT = YES;
Expand Down
47 changes: 31 additions & 16 deletions SlidingTableCell/LRSlidingTableViewCell.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//
// SlidingTableCell.h
// SlidingTableCell
// LRSlidingTableViewCell.h
// LRSlidingTableViewCell
//
// Created by Luke Redpath on 5/26/2011.
// Modified by Alexsander Akers on 1/20/2012.
//
// Created by Luke Redpath on 26/05/2011.
// Copyright 2011 LJR Software Limited. All rights reserved.
//

Expand All @@ -11,26 +13,39 @@
@class LRSlidingTableViewCell;

typedef enum {
LRSlidingTableViewCellSwipeDirectionRight = 0,
LRSlidingTableViewCellSwipeDirectionLeft,
LRSlidingTableViewCellSwipeDirectionBoth,
LRSlidingTableViewCellSwipeDirectionNone,
LRSlidingTableViewCellSwipeDirectionNone = 0,
LRSlidingTableViewCellSwipeDirectionRight = UISwipeGestureRecognizerDirectionRight,
LRSlidingTableViewCellSwipeDirectionLeft = UISwipeGestureRecognizerDirectionLeft,
LRSlidingTableViewCellSwipeDirectionBoth = LRSlidingTableViewCellSwipeDirectionRight | LRSlidingTableViewCellSwipeDirectionLeft
} LRSlidingTableViewCellSwipeDirection;

@protocol LRSlidingTableViewCellDelegate <NSObject>
- (void)cellDidReceiveSwipe:(LRSlidingTableViewCell *)cell;

- (void) slidingTableViewCellDidReceiveSwipe: (LRSlidingTableViewCell *) cell;

@optional
- (BOOL) slidingTableViewCellShouldSwipe: (LRSlidingTableViewCell *) cell;

@end

@interface LRSlidingTableViewCell : UITableViewCell {
id <LRSlidingTableViewCellDelegate> delegate;
@interface LRSlidingTableViewCell : UITableViewCell
{
__weak id <LRSlidingTableViewCellDelegate> _delegate;
BOOL _backgroundViewVisible;
LRSlidingTableViewCellSwipeDirection _swipeDirection;
UISwipeGestureRecognizerDirection _lastRecognizedDirection;
}
@property (nonatomic, assign) id <LRSlidingTableViewCellDelegate> delegate;
@property (nonatomic, assign) LRSlidingTableViewCellSwipeDirection swipeDirection;
@property (nonatomic, retain) UISwipeGestureRecognizer *lastGestureRecognized;

/** Slides the content view out to the right to reveal the background view. */
- (void)slideOutContentView;
@property (nonatomic) LRSlidingTableViewCellSwipeDirection swipeDirection;
@property (nonatomic, weak) id <LRSlidingTableViewCellDelegate> delegate;

/** A Boolean indicator of whether the background view is visible. */
- (BOOL) isBackgroundViewVisible;

/** Slides the content view out to the right or left to reveal the background view. */
- (void) slideOutContentView: (UISwipeGestureRecognizerDirection) direction;

/** Slides the content view back in to cover the background view. */
- (void)slideInContentView;
- (void) slideInContentView;

@end
Loading