-
Description : You Can Give Different Effects To UITableview.
-
Features:
Easy To Give Different Effects To UITableview That Makes It More Effective. Ready for iOS 8!
1) Create New Project
Copy Following Two Files Into Your Project.
1) IndTableEffects.h 2) IndTableEffects.m
Darg And Drop UITableView?s Object To Your ViewControllers?s XIB
File. And Set Its Delegate And Data Source.
Implement UITableview?s Necessory Method In Your ViewController?s .m File.
Create CustomCell. And Set It In Follwing method Accordingly.
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
1.5) Add QuartzCore Framework.
2) Create Anther View Controller And Name It To EffectsViewController That List Out Different Effects Of UITableview
2.1) Create Following Object in EffectsViewController.h File
IBOutlet UITableView *objTableView;
NSMutableArray *mutArrEffects;
2.2) Drag And Drop UITableview?s Object To EffectsViewController.XIB and Set Its Delegate And Data source.
2.3) Write-down Following Code in ViewController.m
mutArrEffects=[[NSMutableArray alloc]initWithObjects:@"IndTableEffect1",@"IndTableEffect2",@"IndTableEffect3",@"IndTableEffect4",@"IndTableEffect5",@"IndTableEffect6",@"IndTableEffect7",@"IndTableEffect8",@"IndTableEffect9",@"IndTableEffect10",@"IndTableEffect11",@"IndTableEffect12",@"IndTableEffect13",@"IndTableEffect14",@"IndTableEffect15",@"IndTableEffect16",@"IndTableEffect17",nil];
gblTableEffectDemoAppDelegateObj=(AppDelegate*)[[UIApplication sharedApplication]delegate];
self.navigationController.navigationItem.rightBarButtonItem=nil;
-
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
gblTableEffectDemoAppDelegateObj.aIntEffectValue=indexPath.row; gblTableEffectDemoAppDelegateObj.boolShowEffects=YES; [self.navigationController popViewControllerAnimated:YES]; }
3) Wirte Down Follwing Code in AppDelegate.h file
@property (nonatomic)int aIntEffectValue; @property (nonatomic,assign )BOOL boolShowEffects;
4) Wirte Down Following Code in .pch File
#ifdef OBJC AppDelegate *gblTableEffectDemoAppDelegateObj; #endif
5) Write-down Following Code In ViewController.m
-(void)viewWillAppear:(BOOL)animated {
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, 35, 35);
[btn setImage:[UIImage imageNamed:@"btn_setting_iPad.png"] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(pushToEffectsView) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *Item = [[UIBarButtonItem alloc] initWithCustomView:btn];
self.navigationItem.rightBarButtonItem = Item;
[Item release];
gblTableEffectDemoAppDelegateObj=(AppDelegate *)[[UIApplication sharedApplication]delegate];
if (gblTableEffectDemoAppDelegateObj.boolShowEffects) {
[self showEffects];
}
}
-(void)pushToEffectsView {
EffectsViewController *objEffectsViewController=[[EffectsViewController alloc]initWithNibName:@"EffectsViewController" bundle:nil];
[self.navigationController pushViewController:objEffectsViewController animated:YES];
[objEffectsViewController release];
}
-(void)showEffects {
IndTableEffects * livelyTableView = (IndTableEffects *)self.objTableView;
NSArray * transforms = [NSArray arrayWithObjects:IndTableEffectsTransformEffect8,IndTableEffectsTransformEffect9,IndTableEffectsTransformEffect10,IndTableEffectsTransformEffect11,IndTableEffectsTransformEffect12,IndTableEffectsTransformEffect13,IndTableEffectsTransformEffect14,IndTableEffectsTransformEffect15,IndTableEffectsTransformEffect16,IndTableEffectsTransformEffect18,IndTableEffectsTransformEffect4,IndTableEffectsTransformEffect5,IndTableEffectsTransformEffect6,IndTableEffectsTransformEffect7,IndTableEffectsTransformEffect1,IndTableEffectsTransformEffect2,IndTableEffectsTransformEffect3,nil];
if (gblTableEffectDemoAppDelegateObj.aIntEffectValue
}
iOS8 Ready!