|
@@ -19,6 +19,7 @@
|
|
|
#import "DefaultTableHeaderView.h"
|
|
#import "DefaultTableHeaderView.h"
|
|
|
#import "DefaultAppearance.h"
|
|
#import "DefaultAppearance.h"
|
|
|
#import "SortItemViewController.h"
|
|
#import "SortItemViewController.h"
|
|
|
|
|
+#import "SortButton.h"
|
|
|
|
|
|
|
|
#define ALERT_DEL 1025
|
|
#define ALERT_DEL 1025
|
|
|
//#import "PDFViewController.h"
|
|
//#import "PDFViewController.h"
|
|
@@ -26,6 +27,7 @@
|
|
|
|
|
|
|
|
@property (nonatomic,strong) SortItemViewController *sortItemController;
|
|
@property (nonatomic,strong) SortItemViewController *sortItemController;
|
|
|
@property (nonatomic,assign) int sortIndex;
|
|
@property (nonatomic,assign) int sortIndex;
|
|
|
|
|
+@property (nonatomic,strong) SortButton *sortButton;
|
|
|
|
|
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
@@ -674,11 +676,12 @@
|
|
|
|
|
|
|
|
DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 33)];
|
|
DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 33)];
|
|
|
|
|
|
|
|
- UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
- sortButton.frame = CGRectMake(20, 5.5, (33 - 5.5 * 2), (33 - 5.5 * 2));
|
|
|
|
|
- [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
|
|
|
|
|
- [sortButton addTarget:self action:@selector(wishlistSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
- [myView addSubview:sortButton];
|
|
|
|
|
|
|
+// UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
+// sortButton.frame = CGRectMake(20, 5.5, (33 - 5.5 * 2), (33 - 5.5 * 2));
|
|
|
|
|
+// [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
|
|
|
|
|
+// [sortButton addTarget:self action:@selector(wishlistSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
+// [myView addSubview:sortButton];
|
|
|
|
|
+ [myView addSubview:self.sortButton];
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5.5, tableView.bounds.size.width, 22)];
|
|
UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5.5, tableView.bounds.size.width, 22)];
|
|
@@ -1115,17 +1118,6 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-/*
|
|
|
|
|
- #pragma mark - Navigation
|
|
|
|
|
-
|
|
|
|
|
- // In a storyboard-based application, you will often want to do a little preparation before navigation
|
|
|
|
|
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
|
|
|
|
|
- {
|
|
|
|
|
- // Get the new view controller using [segue destinationViewController].
|
|
|
|
|
- // Pass the selected object to the new view controller.
|
|
|
|
|
- }
|
|
|
|
|
- */
|
|
|
|
|
-
|
|
|
|
|
- (SortItemViewController *)sortItemController {
|
|
- (SortItemViewController *)sortItemController {
|
|
|
if (!_sortItemController) {
|
|
if (!_sortItemController) {
|
|
|
_sortItemController = [[SortItemViewController alloc] initWithTableOrigin:CGPointMake(40, 40)];
|
|
_sortItemController = [[SortItemViewController alloc] initWithTableOrigin:CGPointMake(40, 40)];
|
|
@@ -1136,6 +1128,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
weakSelf.sortIndex = sort;
|
|
weakSelf.sortIndex = sort;
|
|
|
|
|
|
|
|
[weakSelf reload_data];
|
|
[weakSelf reload_data];
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1144,4 +1137,49 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
return _sortItemController;
|
|
return _sortItemController;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (SortButton *)sortButton {
|
|
|
|
|
+ if (!_sortButton) {
|
|
|
|
|
+ _sortButton = [SortButton sortButtonWithHeight:33];
|
|
|
|
|
+
|
|
|
|
|
+ [_sortButton addTarget:self action:@selector(wishlistSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
+ }
|
|
|
|
|
+ return _sortButton;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)setSortIndex:(int)sortIndex {
|
|
|
|
|
+ _sortIndex = sortIndex;
|
|
|
|
|
+
|
|
|
|
|
+ NSString *selectedImageName = @"";
|
|
|
|
|
+ switch (sortIndex) {
|
|
|
|
|
+ case 0:{
|
|
|
|
|
+ selectedImageName = @"TX_22";
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:{
|
|
|
|
|
+ selectedImageName = @"TS_22";
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:{
|
|
|
|
|
+ selectedImageName = @"IX_22";
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3:{
|
|
|
|
|
+ selectedImageName = @"IS_22";
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 4:{
|
|
|
|
|
+ selectedImageName = @"DX_22";
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ self.sortButton.imageView.image = [UIImage imageNamed:selectedImageName];
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@end
|
|
@end
|