Init pullView and Drag View

This commit is contained in:
Kyle Fang
2013-02-27 01:21:27 +08:00
parent 8eb704c7bb
commit 5e2ffc80c3
3 changed files with 38 additions and 83 deletions

View File

@@ -6,6 +6,7 @@ platform :ios, '6.0'
pod 'AHAlertView', '~>0.0.2'
pod 'GVUserDefaults', '~>0.9.0'
pod 'SVProgressHUD', '~>0.9'
pod 'ZGPullDragScrollView', '~>0.0.1'
target :ProgressTests, :exclusive => true do
pod 'GVUserDefaults', '~>0.9.0'

View File

@@ -9,9 +9,13 @@
#import "PPRemindersViewController.h"
#import "PPEvenKitManager.h"
#import <SVProgressHUD/SVProgressHUD.h>
#import <UIScrollView+ZGPullDrag.h>
#import <NUI/NUIConverter.h>
#import <NUI/NUIGraphics.h>
#import "ReminderItemCell.h"
@interface PPRemindersViewController () <ReminderItemCellDelegate, UIScrollViewDelegate>
@interface PPRemindersViewController () <ReminderItemCellDelegate, ZGPullDragViewDelegate>
@property (strong, nonatomic) IBOutlet UIView *pullDownView;
@property (nonatomic) NSArray *remindersDatasource;
@end
@@ -19,15 +23,6 @@
static NSString *CellIdentifier = @"ReminderCell";
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
@@ -43,6 +38,16 @@ static NSString *CellIdentifier = @"ReminderCell";
self.remindersDatasource = reminedrItems;
[SVProgressHUD dismiss];
[self.tableView reloadData];
UIView *pullView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.tableView.rowHeight)];
pullView.backgroundColor = [UIColor greenColor];
[self.tableView addZGPullView:pullView];
UIView *dragView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.tableView.rowHeight)];
dragView.backgroundColor = [UIColor greenColor];
[self.tableView addZGDragView:dragView];
self.tableView.pullDragDelegate = self;
}];
}
@@ -80,14 +85,6 @@ static NSString *CellIdentifier = @"ReminderCell";
return cell;
}
//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
// return [[UIView alloc] init];
//}
//
//- (CGFloat )tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
// return 1;
//}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return [[UIView alloc] init];
}
@@ -96,58 +93,6 @@ static NSString *CellIdentifier = @"ReminderCell";
return 1;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
}
#pragma mark - ReminderCell Delegate
- (void)completedByTheUser:(ReminderItemCell *)sender{

View File

@@ -43,10 +43,30 @@
<outlet property="delegate" destination="1MC-Iw-JPa" id="ZyO-r5-k8M"/>
</connections>
</tableView>
<connections>
<outlet property="pullDownView" destination="byd-bd-i3h" id="R1k-sW-e0w"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="UnO-Gb-ptI" userLabel="First Responder" sceneMemberID="firstResponder"/>
<view contentMode="scaleToFill" id="byd-bd-i3h">
<rect key="frame" x="0.0" y="0.0" width="320" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" usesAttributedText="YES" placeholder="#task" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Kup-8V-B1I">
<attributedString key="attributedText"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Kup-8V-B1I" firstAttribute="top" secondItem="byd-bd-i3h" secondAttribute="top" constant="20" symbolic="YES" type="default" id="43M-00-tER"/>
<constraint firstAttribute="bottom" secondItem="Kup-8V-B1I" secondAttribute="bottom" constant="20" symbolic="YES" type="default" id="Gnj-3I-DzP"/>
<constraint firstAttribute="trailing" secondItem="Kup-8V-B1I" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="Iuh-r2-1Ms"/>
<constraint firstItem="Kup-8V-B1I" firstAttribute="leading" secondItem="byd-bd-i3h" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="k6h-8q-kbI"/>
</constraints>
</view>
</objects>
<point key="canvasLocation" x="652" y="122"/>
<point key="canvasLocation" x="-97" y="101"/>
</scene>
<!--View Controller-->
<scene sceneID="sC8-Wa-VaP">
@@ -84,20 +104,9 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="avM-jj-Z7e" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="652" y="726"/>
<point key="canvasLocation" x="-97" y="705"/>
</scene>
</scenes>
<classes>
<class className="NSLayoutConstraint" superclassName="NSObject">
<source key="sourceIdentifier" type="project" relativePath="./Classes/NSLayoutConstraint.h"/>
</class>
<class className="PPRemindersViewController" superclassName="UITableViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/PPRemindersViewController.h"/>
</class>
<class className="ReminderItemCell" superclassName="UITableViewCell">
<source key="sourceIdentifier" type="project" relativePath="./Classes/ReminderItemCell.h"/>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>