|
@@ -172,6 +172,7 @@
|
|
switch (indexPath.row) {
|
|
switch (indexPath.row) {
|
|
case 0:
|
|
case 0:
|
|
[cell setCellStyle:CInsertBlankPageCellSize label:self.dataArray[indexPath.row]];
|
|
[cell setCellStyle:CInsertBlankPageCellSize label:self.dataArray[indexPath.row]];
|
|
|
|
+ cell.buttonSelectedStatus = self.isSelect;
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
{
|
|
{
|
|
@@ -214,6 +215,66 @@
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
|
|
+ {
|
|
|
|
+ if(self.isSelect){
|
|
|
|
+ [cell setCellStyle:CInsertBlankPageCellDirection label:self.dataArray[indexPath.row]];
|
|
|
|
+ cell.verticalPageBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
|
|
|
|
+ }else{
|
|
|
|
+ [cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
|
|
+ if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
|
|
+ [self.pageLoactionBtns addObject:cell.locationSelectBtn];
|
|
|
|
+ }
|
|
|
|
+ cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 5:
|
|
|
|
+ {
|
|
|
|
+ if(self.isSelect) {
|
|
|
|
+ [cell setCellStyle:CInsertBlankPageCellLocation label:self.dataArray[indexPath.row]];
|
|
|
|
+ }else{
|
|
|
|
+ [cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
|
|
+ if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
|
|
+ [self.pageLoactionBtns addObject:cell.locationSelectBtn];
|
|
|
|
+ }
|
|
|
|
+ if (self.currentPageIndex) {
|
|
|
|
+ self.preCell = cell;
|
|
|
|
+ cell.locationSelectBtn.selected = !cell.locationSelectBtn.selected;
|
|
|
|
+ cell.locationSelectLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
|
|
|
|
+ }
|
|
|
|
+ cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 6:
|
|
|
|
+ {
|
|
|
|
+ if(self.isSelect) {
|
|
|
|
+ [cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
|
|
+ if (!self.currentPageIndex) {
|
|
|
|
+ self.preCell = cell;
|
|
|
|
+ cell.locationSelectBtn.selected = !cell.locationSelectBtn.selected;
|
|
|
|
+ cell.locationSelectLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
|
|
+ [self.pageLoactionBtns addObject:cell.locationSelectBtn];
|
|
|
|
+ }
|
|
|
|
+ cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
|
|
+ }else{
|
|
|
|
+ [cell setCellStyle:CInsertBlankPageCellLocationTextFiled label:self.dataArray[indexPath.row]];
|
|
|
|
+ if (self.currentPageIndex) {
|
|
|
|
+ cell.locationTextField.text = [NSString stringWithFormat:@"%lu", self.currentPageIndex];
|
|
|
|
+ self.pageModel.pageIndex = self.currentPageIndex-1;
|
|
|
|
+ }
|
|
|
|
+ self.locationTextField = cell.locationTextField;
|
|
|
|
+ cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 7:
|
|
{
|
|
{
|
|
[cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
[cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
@@ -222,7 +283,8 @@
|
|
cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case 5:
|
|
|
|
|
|
+
|
|
|
|
+ case 8:
|
|
{
|
|
{
|
|
[cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
[cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
@@ -236,7 +298,8 @@
|
|
cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case 6:
|
|
|
|
|
|
+
|
|
|
|
+ case 9:
|
|
{
|
|
{
|
|
[cell setCellStyle:CInsertBlankPageCellLocationTextFiled label:self.dataArray[indexPath.row]];
|
|
[cell setCellStyle:CInsertBlankPageCellLocationTextFiled label:self.dataArray[indexPath.row]];
|
|
if (self.currentPageIndex) {
|
|
if (self.currentPageIndex) {
|
|
@@ -247,7 +310,8 @@
|
|
cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case 7:
|
|
|
|
|
|
+
|
|
|
|
+ case 10:
|
|
{
|
|
{
|
|
[cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
[cell setCellStyle:CInsertBlankPageCellLocationSelect label:self.dataArray[indexPath.row]];
|
|
if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
|
|
@@ -311,37 +375,37 @@
|
|
|
|
|
|
if (isSelect) {
|
|
if (isSelect) {
|
|
NSInteger t = indexPath.row;
|
|
NSInteger t = indexPath.row;
|
|
|
|
+ NSLog(@"t is %zd",t);
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
NSMutableArray *data = [NSMutableArray arrayWithArray:self.dataArray];
|
|
NSMutableArray *data = [NSMutableArray arrayWithArray:self.dataArray];
|
|
for (NSString *str in szieArray) {
|
|
for (NSString *str in szieArray) {
|
|
t++;
|
|
t++;
|
|
- NSIndexPath* path = [NSIndexPath indexPathForRow:t inSection:0];
|
|
|
|
- [array addObject:path];
|
|
|
|
|
|
+ if([self.dataArray containsObject:str]){
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ [data insertObject:str atIndex:t];
|
|
|
|
+ }
|
|
|
|
|
|
- [data insertObject:str atIndex:t];
|
|
|
|
}
|
|
}
|
|
self.dataArray = (NSArray *)data;
|
|
self.dataArray = (NSArray *)data;
|
|
- [self.tableView insertRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationFade];
|
|
|
|
-// [self.tableView reloadData];
|
|
|
|
-// NSIndexPath* path = [NSIndexPath indexPathForRow:0 inSection:0];
|
|
|
|
-// CInsertBlankPageCell *cell = [self.tableView cellForRowAtIndexPath:path];
|
|
|
|
-//
|
|
|
|
-// NSInteger sizeIndex = [szieArray indexOfObject:cell.sizeLabel.text];
|
|
|
|
-// NSIndexPath *index = [NSIndexPath indexPathForItem:sizeIndex+1 inSection:0];
|
|
|
|
-// [self.tableView selectRowAtIndexPath:index animated:NO scrollPosition:UITableViewScrollPositionMiddle];
|
|
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
NSInteger t = indexPath.row;
|
|
NSInteger t = indexPath.row;
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
NSMutableArray *data = [NSMutableArray arrayWithArray:self.dataArray];
|
|
NSMutableArray *data = [NSMutableArray arrayWithArray:self.dataArray];
|
|
for (int i = 0; i < szieArray.count; i++) {
|
|
for (int i = 0; i < szieArray.count; i++) {
|
|
t++;
|
|
t++;
|
|
- NSIndexPath* path = [NSIndexPath indexPathForRow:t inSection:0];
|
|
|
|
- [array addObject:path];
|
|
|
|
- [data removeObjectAtIndex:t];
|
|
|
|
|
|
+ NSString * str = szieArray[i];
|
|
|
|
+ if([data containsObject:str]) {
|
|
|
|
+ [data removeObject:str];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
self.dataArray = (NSArray *)data;
|
|
self.dataArray = (NSArray *)data;
|
|
- [self.tableView deleteRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationFade];
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ NSLog(@"dataArray %@",self.dataArray);
|
|
|
|
+
|
|
|
|
+ [self.tableView reloadData];
|
|
}
|
|
}
|
|
|
|
|
|
- (void)insertBlankPageCellLocation:(CInsertBlankPageCell *)insertBlankPageCell button:(nonnull UIButton *)buttom {
|
|
- (void)insertBlankPageCellLocation:(CInsertBlankPageCell *)insertBlankPageCell button:(nonnull UIButton *)buttom {
|