I want to use ADLivelyTableView but it couldn't work well.
https://github.com/applidium/ADLivelyTableView
Here is my code.
◯ViewController.h
#import "ADLivelyTableView.h"
@interface ViewController : GAITrackedViewController<UITableViewDelegate, UITableViewDataSource>
{
ADLivelyTableView * tableView;
}
@property (nonatomic, retain) ADLivelyTableView *tableView;
◯ViewController.m
#import "ViewController.h"
#import "ADLivelyTableView.h"
@implementation ViewController
@synthesize tableView;
----Fixed code----
- (void)viewDidLoad {
tableView = [[ADLivelyTableView alloc]initWithFrame:rect style:UITableViewStylePlain];
//[transitionButton release];
tableView.delegate = self;
tableView.dataSource = self;
tableView = (ADLivelyTableView *)self.tableView;
tableView.initialCellTransformBlock = ADLivelyTransformFan;
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell){// yes
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
[uv addSubview:tableView];
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
//return self.feedManager.feedArray.count;
return [[APP_DELEGATE titlearray] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell){// yes
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
// Update Cell
[self updateCell:cell atIndexPath:indexPath];
return cell;
}
- (void)updateCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
// Update Cells
cell.backgroundColor = [UIColor clearColor];
cell.textLabel.text = [[APP_DELEGATE titlearray] objectAtIndex:indexPath.row];
cell.textLabel.textColor = [UIColor blackColor];
cell.textLabel.font = [UIFont fontWithName:@"HiraKakuProN-W3" size:15];
cell.textLabel.adjustsFontSizeToFitWidth = YES;
cell.textLabel.minimumScaleFactor = 10.0f;
cell.textLabel.numberOfLines = 0;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle != UITableViewCellEditingStyleDelete) {
return;
}
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
[self.tableView reloadRowsAtIndexPaths:[self.tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationAutomatic];
}
and the error of "Cast of block pointer type "ADLivelyTransform" (aka "NSTimerIntercal(^)CALayer *__strong,float)') to C pointer type 'const void *' requires a bridge cast" caused at
if (block != _transformBlock) {
Block_release(transformBlock);
_transformBlock = Block_copy(block);
}
so I comment out this code and build succeeded.
But the tableView cells didn't animate.
what should I do?