|
|
@@ -16,6 +16,7 @@
|
|
|
#import "CustomImageView.h"
|
|
|
#import "CustomTextField.h"
|
|
|
#import "CustomButton.h"
|
|
|
+#import "CustomLabelButton.h"
|
|
|
#import "JYRefreshController.h"
|
|
|
#import "WYPopoverController.h"
|
|
|
#import "ImageUtil.h"
|
|
|
@@ -90,6 +91,9 @@
|
|
|
|
|
|
@end
|
|
|
|
|
|
+@implementation ThingsAddCollectionCell
|
|
|
+
|
|
|
+@end
|
|
|
|
|
|
@interface ThingsViewController () <UICollectionViewDataSource, UICollectionViewDelegate> {
|
|
|
NSMutableArray *_deviceList;
|
|
|
@@ -548,7 +552,10 @@
|
|
|
#pragma mark - UICollectionView Delegate
|
|
|
|
|
|
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
|
|
- NSInteger count = _deviceList.count;
|
|
|
+// NSInteger count = _deviceList.count;
|
|
|
+ NSInteger auth = [JDFacade facade].loginUser.level == 90 && !_isDeleteMode; //마스터 권한일 경우,
|
|
|
+ NSInteger count = _deviceList.count % _deviceFlag == 0 ? _deviceList.count : _deviceList.count + auth; //홀수일 경우, 장치 추가 버튼
|
|
|
+
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
@@ -638,6 +645,13 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
+ rcell = cell;
|
|
|
+ } else {
|
|
|
+ ThingsAddCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ThingsAddCellIdentifier" forIndexPath:indexPath];
|
|
|
+
|
|
|
+ if (![cell.btnAdd actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
|
|
|
+ [cell.btnAdd addTarget:self action:@selector(addNewDevice) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ }
|
|
|
rcell = cell;
|
|
|
}
|
|
|
|