Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged all components into repository

  • Loading branch information...
commit 203250ab50dc663ded63555456f5d63bff420a93 1 parent cdcb82c
@keeshux authored
Showing with 12,990 additions and 13 deletions.
  1. +4 −0 .gitignore
  2. +60 −0 Classes/KSAdvancedPicker/KSAdvancedPicker.h
  3. +182 −0 Classes/KSAdvancedPicker/KSAdvancedPicker.m
  4. +2 −5 { → Classes}/KSCheckView/KSCheckView.h
  5. +18 −7 { → Classes}/KSCheckView/KSCheckView.m
  6. +29 −0 Classes/KSEditEnder/KSEditEnder.h
  7. +57 −0 Classes/KSEditEnder/KSEditEnder.m
  8. +44 −0 Classes/KSProgressDownloader/KSProgressDownloader.h
  9. +171 −0 Classes/KSProgressDownloader/KSProgressDownloader.m
  10. +46 −0 Classes/KSSheetView/KSSheetView.h
  11. +115 −0 Classes/KSSheetView/KSSheetView.m
  12. +623 −0 Demo/ComponentsDemo.xcodeproj/project.pbxproj
  13. +16 −0 Demo/ComponentsDemo/AppDelegate.h
  14. +69 −0 Demo/ComponentsDemo/AppDelegate.m
  15. +51 −0 Demo/ComponentsDemo/ComponentsDemo-Info.plist
  16. +14 −0 Demo/ComponentsDemo/ComponentsDemo-Prefix.pch
  17. +16 −0 Demo/ComponentsDemo/Tests/KSAdvancedPicker/VC_KSAdvancedPicker.h
  18. +120 −0 Demo/ComponentsDemo/Tests/KSAdvancedPicker/VC_KSAdvancedPicker.m
  19. +14 −0 Demo/ComponentsDemo/Tests/KSCheckView/VC_KSCheckView.h
  20. +56 −0 Demo/ComponentsDemo/Tests/KSCheckView/VC_KSCheckView.m
  21. +17 −0 Demo/ComponentsDemo/Tests/KSEditEnder/VC_KSEditEnder.h
  22. +90 −0 Demo/ComponentsDemo/Tests/KSEditEnder/VC_KSEditEnder.m
  23. +16 −0 Demo/ComponentsDemo/Tests/KSProgressDownloader/VC_KSProgressDownloader.h
  24. +75 −0 Demo/ComponentsDemo/Tests/KSProgressDownloader/VC_KSProgressDownloader.m
  25. +14 −0 Demo/ComponentsDemo/Tests/KSSheetView/VC_KSSheetView.h
  26. +59 −0 Demo/ComponentsDemo/Tests/KSSheetView/VC_KSSheetView.m
  27. +16 −0 Demo/ComponentsDemo/ViewController.h
  28. +98 −0 Demo/ComponentsDemo/ViewController.m
  29. +2 −0  Demo/ComponentsDemo/en.lproj/InfoPlist.strings
  30. +169 −0 Demo/ComponentsDemo/en.lproj/ViewController_iPad.xib
  31. +168 −0 Demo/ComponentsDemo/en.lproj/ViewController_iPhone.xib
  32. +245 −0 Demo/ComponentsDemo/en.lproj/Window_iPad.xib
  33. +242 −0 Demo/ComponentsDemo/en.lproj/Window_iPhone.xib
  34. +18 −0 Demo/ComponentsDemo/main.m
  35. +194 −0 External/Reachability/Reachability.h
  36. +814 −0 External/Reachability/Reachability.m
  37. +35 −0 External/asi-http-request/ASIAuthenticationDialog.h
  38. +487 −0 External/asi-http-request/ASIAuthenticationDialog.m
  39. +103 −0 External/asi-http-request/ASICacheDelegate.h
  40. +42 −0 External/asi-http-request/ASIDataCompressor.h
  41. +219 −0 External/asi-http-request/ASIDataCompressor.m
  42. +41 −0 External/asi-http-request/ASIDataDecompressor.h
  43. +218 −0 External/asi-http-request/ASIDataDecompressor.m
  44. +46 −0 External/asi-http-request/ASIDownloadCache.h
  45. +514 −0 External/asi-http-request/ASIDownloadCache.m
  46. +76 −0 External/asi-http-request/ASIFormDataRequest.h
  47. +362 −0 External/asi-http-request/ASIFormDataRequest.m
  48. +1,004 −0 External/asi-http-request/ASIHTTPRequest.h
  49. +5,119 −0 External/asi-http-request/ASIHTTPRequest.m
  50. +43 −0 External/asi-http-request/ASIHTTPRequestConfig.h
  51. +35 −0 External/asi-http-request/ASIHTTPRequestDelegate.h
  52. +26 −0 External/asi-http-request/ASIInputStream.h
  53. +138 −0 External/asi-http-request/ASIInputStream.m
  54. +108 −0 External/asi-http-request/ASINetworkQueue.h
  55. +343 −0 External/asi-http-request/ASINetworkQueue.m
  56. +38 −0 External/asi-http-request/ASIProgressDelegate.h
  57. +28 −0 External/asi-http-request/LICENSE
  58. +0 −1  README
  59. +21 −0 README.md
View
4 .gitignore
@@ -1,3 +1,7 @@
.DS_Store
*.swp
*.o
+*.class
+Demo/ComponentsDemo.xcodeproj/project.xcworkspace
+Demo/ComponentsDemo.xcodeproj/xcuserdata
+comment
View
60 Classes/KSAdvancedPicker/KSAdvancedPicker.h
@@ -0,0 +1,60 @@
+/*
+ * KSAdvancedPicker.h
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import <UIKit/UIKit.h>
+
+@protocol KSAdvancedPickerDelegate;
+
+@interface KSAdvancedPicker : UIView<UITableViewDataSource, UITableViewDelegate> {
+}
+
+@property (nonatomic, readonly) UITableView *table;
+@property (nonatomic, readonly) NSInteger selectedRowIndex;
+@property (nonatomic, assign) id<KSAdvancedPickerDelegate> delegate;
+
+- (id) initWithFrame:(CGRect)frame delegate:(id<KSAdvancedPickerDelegate>)aDelegate;
+
+- (void) scrollToRowAtIndex:(NSInteger)rowIndex animated:(BOOL)animated;
+- (void) reloadData;
+
+@end
+
+@protocol KSAdvancedPickerDelegate<NSObject>
+
+// row view
+- (NSInteger) numberOfRowsInAdvancedPicker:(KSAdvancedPicker *)picker;
+- (UITableViewCell *) advancedPicker:(KSAdvancedPicker *)picker tableView:(UITableView *)tableView cellForRowAtIndex:(NSInteger)rowIndex;
+
+@optional
+
+// row height
+- (CGFloat) heightForRowInAdvancedPicker:(KSAdvancedPicker *)picker;
+
+// selected row
+- (void) advancedPicker:(KSAdvancedPicker *)picker didSelectRowAtIndex:(NSInteger)rowIndex;
+
+// table background view (checked in the same order)
+- (UIView *) backgroundViewForAdvancedPicker:(KSAdvancedPicker *)picker;
+- (UIColor *) backgroundColorForAdvancedPicker:(KSAdvancedPicker *)picker;
+
+// selector view (checked in the same order)
+- (UIView *) viewForAdvancedPickerSelector:(KSAdvancedPicker *)picker;
+- (UIColor *) viewColorForAdvancedPickerSelector:(KSAdvancedPicker *)picker;
+
+@end
View
182 Classes/KSAdvancedPicker/KSAdvancedPicker.m
@@ -0,0 +1,182 @@
+/*
+ * KSAdvancedPicker.m
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import "KSAdvancedPicker.h"
+
+@interface KSAdvancedPicker ()
+
+@property (nonatomic, retain) UIView *selector;
+
+- (void) alignToRowBoundary;
+
+@end
+
+@implementation KSAdvancedPicker
+
+// public
+@synthesize table;
+@synthesize selectedRowIndex;
+@synthesize delegate;
+
+// private
+@synthesize selector;
+
+- (id) initWithFrame:(CGRect)frame delegate:(id<KSAdvancedPickerDelegate>)aDelegate
+{
+ if ((self = [super initWithFrame:frame])) {
+ delegate = aDelegate;
+
+ // custom row height?
+ CGFloat rowHeight;
+ if ([delegate respondsToSelector:@selector(heightForRowInAdvancedPicker:)]) {
+ rowHeight = [delegate heightForRowInAdvancedPicker:self];
+ } else {
+ rowHeight = 44;
+ }
+
+ // distance from center
+ const CGFloat centralRowOffset = (frame.size.height - rowHeight) / 2;
+
+ // picker content
+ table = [[UITableView alloc] initWithFrame:self.bounds];
+ table.rowHeight = rowHeight;
+ table.contentInset = UIEdgeInsetsMake(centralRowOffset, 0, centralRowOffset, 0);
+ table.separatorStyle = UITableViewCellSeparatorStyleNone;
+ table.showsVerticalScrollIndicator = NO;
+ table.allowsSelection = NO;
+
+ // custom background?
+ if ([delegate respondsToSelector:@selector(backgroundViewForAdvancedPicker:)]) {
+ table.backgroundView = [delegate backgroundViewForAdvancedPicker:self];
+ } else if ([delegate respondsToSelector:@selector(backgroundColorForAdvancedPicker:)]) {
+ table.backgroundColor = [delegate backgroundColorForAdvancedPicker:self];
+ } else {
+ table.backgroundColor = [UIColor whiteColor];
+ }
+
+ table.dataSource = self;
+ table.delegate = self;
+ [self addSubview:table];
+
+ // custom selector?
+ if ([delegate respondsToSelector:@selector(viewForAdvancedPickerSelector:)]) {
+ self.selector = [delegate viewForAdvancedPickerSelector:self];
+ } else if ([delegate respondsToSelector:@selector(viewColorForAdvancedPickerSelector:)]) {
+ selector = [[UIView alloc] init];
+ selector.backgroundColor = [delegate viewColorForAdvancedPickerSelector:self];
+ } else {
+ selector = [[UIView alloc] init];
+ selector.backgroundColor = [UIColor blueColor];
+ selector.alpha = 0.5;
+ }
+
+ // ignore user input on selector
+ selector.userInteractionEnabled = NO;
+
+ // override selector frame
+ CGRect selectorFrame;
+ selectorFrame.origin.x = 0;
+ selectorFrame.origin.y = centralRowOffset;
+ selectorFrame.size.width = frame.size.width;
+ selectorFrame.size.height = rowHeight;
+ selector.frame = selectorFrame;
+
+ [self addSubview:selector];
+
+// NSLog(@"self.frame = %@", NSStringFromCGRect(self.frame));
+// NSLog(@"table.frame = %@", NSStringFromCGRect(table.frame));
+// NSLog(@"selector.frame = %@", NSStringFromCGRect(selector.frame));
+ }
+ return self;
+}
+
+- (void) dealloc
+{
+ self.delegate = nil;
+ [table release];
+ self.selector = nil;
+
+ [super dealloc];
+}
+
+- (void) scrollToRowAtIndex:(NSInteger)rowIndex animated:(BOOL)animated
+{
+ selectedRowIndex = rowIndex;
+
+ const CGPoint alignedOffset = CGPointMake(0, rowIndex * table.rowHeight - table.contentInset.top);
+ [table setContentOffset:alignedOffset animated:animated];
+
+ if ([delegate respondsToSelector:@selector(advancedPicker:didSelectRowAtIndex:)]) {
+ [delegate advancedPicker:self didSelectRowAtIndex:rowIndex];
+ }
+}
+
+- (void) reloadData
+{
+ [table reloadData];
+}
+
+#pragma mark - UITableViewDataSource
+
+- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return [delegate numberOfRowsInAdvancedPicker:self];
+}
+
+- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ return [delegate advancedPicker:self tableView:tableView cellForRowAtIndex:indexPath.row];
+}
+
+#pragma mark - UIScrollViewDelegate
+
+- (void) scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
+{
+ if (!decelerate) {
+ [self alignToRowBoundary];
+ }
+}
+
+- (void) scrollViewDidEndDecelerating:(UIScrollView *)scrollView
+{
+ [self alignToRowBoundary];
+}
+
+#pragma mark - Private methods
+
+- (void) alignToRowBoundary
+{
+// NSLog(@"contentOffset = %@", NSStringFromCGPoint(table.contentOffset));
+// NSLog(@"rowHeight = %f", table.rowHeight);
+
+ const CGPoint relativeOffset = CGPointMake(0, table.contentOffset.y + table.contentInset.top);
+// NSLog(@"relativeOffset = %@", NSStringFromCGPoint(relativeOffset));
+
+ const NSUInteger rowIndex = round(relativeOffset.y / table.rowHeight);
+// NSLog(@"rowIndex = %d", rowIndex);
+
+ [self scrollToRowAtIndex:rowIndex animated:YES];
+}
+
+@end
View
7 KSCheckView/KSCheckView.h → Classes/KSCheckView/KSCheckView.h
@@ -19,15 +19,12 @@
#import <UIKit/UIKit.h>
-@interface KSCheckView : UIView {
+@interface KSCheckView : UIControl {
CGFloat width;
CGMutablePathRef path;
-
- BOOL enabled;
- UIColor *color;
}
-@property (nonatomic, assign) BOOL enabled;
+@property (nonatomic, assign) BOOL checked;
@property (nonatomic, retain) UIColor *color;
@end
View
25 KSCheckView/KSCheckView.m → Classes/KSCheckView/KSCheckView.m
@@ -21,18 +21,24 @@
@implementation KSCheckView
-@synthesize enabled;
+@synthesize checked;
@synthesize color;
-- (id) initWithCoder:(NSCoder *)aDecoder
+- (id) initWithFrame:(CGRect)frame
{
- if ((self = [super initWithCoder:aDecoder])) {
+ if ((self = [super initWithFrame:frame])) {
width = self.frame.size.width / 8.0;
path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, width, self.frame.size.height / 2);
CGPathAddLineToPoint(path, NULL, self.frame.size.width * 0.4, self.frame.size.height - width);
CGPathAddLineToPoint(path, NULL, self.frame.size.width - width, width);
+
+ self.backgroundColor = [UIColor whiteColor];
+ self.color = [UIColor blackColor];
+
+ // toggle action
+ [self addTarget:self action:@selector(toggle) forControlEvents:UIControlEventTouchUpInside];
}
return self;
}
@@ -40,14 +46,14 @@ - (id) initWithCoder:(NSCoder *)aDecoder
- (void) dealloc
{
CGPathRelease(path);
- [color release];
+ self.color = nil;
[super dealloc];
}
-- (void) setEnabled:(BOOL)aEnabled
+- (void) setChecked:(BOOL)aChecked
{
- enabled = aEnabled;
+ checked = aChecked;
[self setNeedsDisplay];
}
@@ -60,7 +66,7 @@ - (void) drawRect:(CGRect)rect
CGContextFillRect(context, rect);
// check mark
- if (enabled) {
+ if (checked) {
CGContextSetStrokeColorWithColor(context, color.CGColor);
CGContextSetShouldAntialias(context, YES);
CGContextSetLineCap(context, kCGLineCapRound);
@@ -72,4 +78,9 @@ - (void) drawRect:(CGRect)rect
}
}
+- (void) toggle
+{
+ self.checked = !checked;
+}
+
@end
View
29 Classes/KSEditEnder/KSEditEnder.h
@@ -0,0 +1,29 @@
+/*
+ * KSEditEnder.h
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface KSEditEnder : UIControl
+
+@property (nonatomic, assign) BOOL force;
+
++ (id) enderWithView:(UIView *)view;
+- (id) initWithView:(UIView *)view;
+
+@end
View
57 Classes/KSEditEnder/KSEditEnder.m
@@ -0,0 +1,57 @@
+/*
+ * KSEditEnder.m
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import "KSEditEnder.h"
+
+@interface KSEditEnder ()
+
+- (void) endEditingInSuperview;
+
+@end
+
+@implementation KSEditEnder
+
+@synthesize force;
+
++ (id) enderWithView:(UIView *)view
+{
+ return [[[self alloc] initWithView:view] autorelease];
+}
+
+- (id) initWithView:(UIView *)view
+{
+ if ((self = [super initWithFrame:view.frame])) {
+
+ // initially disabled
+ self.userInteractionEnabled = NO;
+ self.opaque = NO;
+
+ // will end editing in future superview (the view parameter)
+ [self addTarget:self action:@selector(endEditingInSuperview) forControlEvents:UIControlEventTouchUpInside];
+ [view addSubview:self];
+ }
+ return self;
+}
+
+- (void) endEditingInSuperview
+{
+ [self.superview endEditing:force];
+}
+
+@end
View
44 Classes/KSProgressDownloader/KSProgressDownloader.h
@@ -0,0 +1,44 @@
+/*
+ * KSProgressDownloader.h
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import <Foundation/Foundation.h>
+#import "ASIHTTPRequest.h"
+
+@protocol KSProgressDownloaderDelegate;
+
+@interface KSProgressDownloader : NSObject<ASIHTTPRequestDelegate, UIAlertViewDelegate> {
+}
+
+@property (nonatomic, copy) NSString *message;
+//@property (nonatomic, copy) NSString *cancelTitle;
+
+@property (nonatomic, assign) id<KSProgressDownloaderDelegate> delegate;
+
++ (KSProgressDownloader *) instance;
+
+- (void) downloadWithRequest:(ASIHTTPRequest *)aRequest;
+
+@end
+
+@protocol KSProgressDownloaderDelegate
+
+- (void) downloader:(KSProgressDownloader *)downloader didDownloadURL:(NSURL *)url toFile:(NSString *)file;
+- (void) downloader:(KSProgressDownloader *)downloader didFailToDownloadURL:(NSURL *)url errorCode:(int)errorCode;
+
+@end
View
171 Classes/KSProgressDownloader/KSProgressDownloader.m
@@ -0,0 +1,171 @@
+/*
+ * KSProgressDownloader.m
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import "KSProgressDownloader.h"
+#import "ASIDownloadCache.h"
+
+@interface KSProgressDownloader ()
+
+@property (nonatomic, retain) ASIHTTPRequest *request;
+@property (nonatomic, retain) NSMutableDictionary *originalHeaders;
+@property (nonatomic, retain) UIAlertView *progressAlert;
+
+- (void) cleanUpRequest;
+
+@end
+
+//
+
+@implementation KSProgressDownloader
+
+@synthesize message;
+//@synthesize cancelTitle;
+
+@synthesize request;
+@synthesize originalHeaders;
+@synthesize progressAlert;
+
+@synthesize delegate;
+
++ (KSProgressDownloader *) instance
+{
+ static KSProgressDownloader *instance = nil;
+ if (!instance) {
+ instance = [[KSProgressDownloader alloc] init];
+ }
+ return instance;
+}
+
+- (id) init
+{
+ if ((self = [super init])) {
+ self.message = @"Downloading";
+// self.cancelTitle = @"Cancel";
+ }
+ return self;
+}
+
+- (void) dealloc
+{
+ self.message = nil;
+// self.cancelTitle = nil;
+
+ request.downloadProgressDelegate = nil;
+ request.delegate = nil;
+ self.request = nil;
+ self.originalHeaders = nil;
+ self.progressAlert = nil;
+
+ [super dealloc];
+}
+
+- (void) downloadWithRequest:(ASIHTTPRequest *)aRequest
+{
+ [request cancel];
+ [self cleanUpRequest];
+
+ // hide and release old alert
+ [progressAlert dismissWithClickedButtonIndex:0 animated:NO];
+ self.progressAlert = nil;
+
+ // create new alert
+ progressAlert = [[UIAlertView alloc] initWithTitle:nil
+ message:message
+ delegate:self
+// cancelButtonTitle:cancelTitle
+ cancelButtonTitle:nil
+ otherButtonTitles:nil];
+
+ // add progress to alert
+ UIProgressView *progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];
+ progressView.frame = CGRectMake(30, 80, 225, 90);
+ [progressAlert addSubview:progressView];
+ [progressView release];
+
+ // show alert
+ [progressAlert show];
+
+ // retain request
+ self.request = aRequest;
+ self.originalHeaders = aRequest.requestHeaders;
+
+ // extend HTTP request
+ request.downloadCache = [ASIDownloadCache sharedCache];
+ request.delegate = self;
+ request.downloadProgressDelegate = progressView;
+ request.willRedirectSelector = @selector(downloadRedirected:toNewURL:);
+ request.didFinishSelector = @selector(downloadDone:);
+ request.didFailSelector = @selector(downloadWrong:);
+ [request startAsynchronous];
+}
+
+#pragma mark - UIAlertViewDelegate
+
+- (void) alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
+{
+// [self cleanUpRequest];
+}
+
+#pragma mark - Custom delegate
+
+- (void) downloadRedirected:(ASIHTTPRequest *)aRequest toNewURL:(NSURL *)newURL
+{
+ NSLog(@"%@ will redirect to %@", request.url, newURL);
+
+ // restore original headers
+ request.requestHeaders = originalHeaders;
+ [request redirectToURL:newURL];
+}
+
+- (void) downloadDone:(ASIHTTPRequest *)aRequest
+{
+ const int statusCode = request.responseStatusCode;
+ NSData *data = request.responseData;
+ NSString *cachedFile = nil;
+
+ if (data || [request didUseCachedResponse]) {
+ cachedFile = [[ASIDownloadCache sharedCache] pathToStoreCachedResponseDataForRequest:request];
+
+ [delegate downloader:self didDownloadURL:request.url toFile:cachedFile];
+ } else {
+ [delegate downloader:self didFailToDownloadURL:request.url errorCode:statusCode];
+ }
+
+ [self cleanUpRequest];
+ [progressAlert dismissWithClickedButtonIndex:0 animated:NO];
+}
+
+- (void) downloadWrong:(ASIHTTPRequest *)aRequest
+{
+ [delegate downloader:self didFailToDownloadURL:request.url errorCode:request.responseStatusCode];
+
+ [self cleanUpRequest];
+ [progressAlert dismissWithClickedButtonIndex:0 animated:NO];
+}
+
+#pragma mark - Private methods
+
+- (void) cleanUpRequest
+{
+ request.downloadProgressDelegate = nil;
+ request.delegate = nil;
+ self.request = nil;
+}
+
+@end
View
46 Classes/KSSheetView/KSSheetView.h
@@ -0,0 +1,46 @@
+/*
+ * KSSheetView.h
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import <UIKit/UIKit.h>
+
+@protocol KSSheetViewDelegate;
+
+@interface KSSheetView : UIView {
+ CGColorRef paperColor;
+ CGColorRef lineColor;
+}
+
+@property (nonatomic, assign) NSUInteger cellSize;
+@property (nonatomic, assign) CGPoint offset;
+@property (nonatomic, assign) CGFloat lineWidth;
+
+// derived from cellSize
+@property (nonatomic, readonly) NSUInteger gridWidth;
+@property (nonatomic, readonly) NSUInteger gridHeight;
+
+// for custom drawing
+@property (nonatomic, assign) id<KSSheetViewDelegate> delegate;
+
+@end
+
+@protocol KSSheetViewDelegate
+
+- (void) drawInSheet:(KSSheetView *)sheetView inContext:(CGContextRef)context inRect:(CGRect)rect;
+
+@end
View
115 Classes/KSSheetView/KSSheetView.m
@@ -0,0 +1,115 @@
+/*
+ * KSSheetView.m
+ *
+ * Copyright 2011 Davide De Rosa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import "KSSheetView.h"
+
+@implementation KSSheetView
+
+@synthesize cellSize;
+@synthesize offset;
+@synthesize lineWidth;
+
+@synthesize gridWidth;
+@synthesize gridHeight;
+
+@synthesize delegate;
+
+#pragma mark - init/dealloc
+
+- (id) initWithFrame:(CGRect)frame
+{
+ if ((self = [super initWithFrame:frame])) {
+ paperColor = CGColorCreateCopy([UIColor colorWithRed:0.93
+ green:0.93
+ blue:0.93
+ alpha:1.0].CGColor);
+ lineColor = CGColorCreateCopy([UIColor colorWithRed:0.48
+ green:0.73
+ blue:0.96
+ alpha:1.0].CGColor);
+
+ // default
+ self.cellSize = frame.size.width / 12;
+ self.offset = CGPointMake((frame.size.width - cellSize * gridWidth) / 2,
+ (frame.size.height - cellSize * gridHeight) / 2);
+ self.lineWidth = ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 2.0 : 1.0);
+ }
+ return self;
+}
+
+- (void) dealloc
+{
+ CGColorRelease(paperColor);
+ CGColorRelease(lineColor);
+
+ [super dealloc];
+}
+
+- (void) setCellSize:(NSUInteger)aCellSize
+{
+ cellSize = aCellSize;
+
+ // dependent ivars
+ gridWidth = self.frame.size.width / cellSize;
+ gridHeight = self.frame.size.height / cellSize;
+}
+
+#pragma mark - Draw loop
+
+- (void) drawRect:(CGRect)rect
+{
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ // paper color
+ CGContextSetFillColorWithColor(context, paperColor);
+ CGContextFillRect(context, rect);
+
+ // grid color
+ CGContextSetStrokeColorWithColor(context, lineColor);
+ CGContextSetLineWidth(context, lineWidth);
+
+ CGPoint delta;
+
+ // horizontal lines
+ delta.y = offset.y;
+ while (delta.y < rect.size.height) {
+ CGContextBeginPath(context);
+ CGContextMoveToPoint(context, rect.origin.x, rect.origin.y + delta.y);
+ CGContextAddLineToPoint(context, rect.origin.x + rect.size.width, rect.origin.y + delta.y);
+ CGContextStrokePath(context);
+
+ delta.y += cellSize;
+ }
+
+ // vertical lines
+ delta.x = offset.x;
+ while (delta.x < rect.size.width) {
+ CGContextBeginPath(context);
+ CGContextMoveToPoint(context, rect.origin.x + delta.x, rect.origin.y);
+ CGContextAddLineToPoint(context, rect.origin.x + delta.x, rect.origin.y + rect.size.height);
+ CGContextStrokePath(context);
+
+ delta.x += cellSize;
+ }
+
+ // delegate custom drawing
+ [delegate drawInSheet:self inContext:context inRect:rect];
+}
+
+@end
View
623 Demo/ComponentsDemo.xcodeproj/project.pbxproj
@@ -0,0 +1,623 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 8C2C55A2146750E70065A877 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C2C55A1146750E70065A877 /* UIKit.framework */; };
+ 8C2C55A4146750E70065A877 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C2C55A3146750E70065A877 /* Foundation.framework */; };
+ 8C2C55A6146750E70065A877 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C2C55A5146750E70065A877 /* CoreGraphics.framework */; };
+ 8C2C55AC146750E70065A877 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8C2C55AA146750E70065A877 /* InfoPlist.strings */; };
+ 8C2C55AE146750E70065A877 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C55AD146750E70065A877 /* main.m */; };
+ 8C2C55B2146750E70065A877 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C55B1146750E70065A877 /* AppDelegate.m */; };
+ 8C4D3D0A1467549D0093F771 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4D3D091467549D0093F771 /* ViewController.m */; };
+ 8C4D3D14146756170093F771 /* ViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8C4D3D0C146756170093F771 /* ViewController_iPad.xib */; };
+ 8C4D3D15146756170093F771 /* ViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8C4D3D0E146756170093F771 /* ViewController_iPhone.xib */; };
+ 8C4D3D16146756170093F771 /* Window_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8C4D3D10146756170093F771 /* Window_iPad.xib */; };
+ 8C4D3D17146756170093F771 /* Window_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8C4D3D12146756170093F771 /* Window_iPhone.xib */; };
+ 8C4D3D19146756A90093F771 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C4D3D18146756A80093F771 /* CFNetwork.framework */; };
+ 8C4D3D1B146756B00093F771 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C4D3D1A146756B00093F771 /* SystemConfiguration.framework */; };
+ 8C4D3D1D146756CD0093F771 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C4D3D1C146756CD0093F771 /* libz.dylib */; };
+ 8C4D3D1F146756E00093F771 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C4D3D1E146756E00093F771 /* MobileCoreServices.framework */; };
+ 8C4D3D271467591A0093F771 /* VC_KSAdvancedPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4D3D221467591A0093F771 /* VC_KSAdvancedPicker.m */; };
+ 8C4D3D2A14675BF40093F771 /* VC_KSEditEnder.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4D3D2914675BF40093F771 /* VC_KSEditEnder.m */; };
+ 8C4D3D2D14675C520093F771 /* VC_KSProgressDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4D3D2C14675C520093F771 /* VC_KSProgressDownloader.m */; };
+ 8C4D3D3014675D930093F771 /* VC_KSSheetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4D3D2F14675D930093F771 /* VC_KSSheetView.m */; };
+ 8C4D3D3314675EEC0093F771 /* VC_KSCheckView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4D3D3214675EEC0093F771 /* VC_KSCheckView.m */; };
+ 8C7126CB1467517100C03BD2 /* KSCheckView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126CA1467517100C03BD2 /* KSCheckView.m */; };
+ 8C7126D8146751A300C03BD2 /* KSAdvancedPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126CE146751A300C03BD2 /* KSAdvancedPicker.m */; };
+ 8C7126D9146751A300C03BD2 /* KSEditEnder.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126D1146751A300C03BD2 /* KSEditEnder.m */; };
+ 8C7126DA146751A300C03BD2 /* KSProgressDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126D4146751A300C03BD2 /* KSProgressDownloader.m */; };
+ 8C7126DB146751A300C03BD2 /* KSSheetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126D7146751A300C03BD2 /* KSSheetView.m */; };
+ 8C7126FF146751DC00C03BD2 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126E3146751DC00C03BD2 /* ASIAuthenticationDialog.m */; };
+ 8C712700146751DC00C03BD2 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126E6146751DC00C03BD2 /* ASIDataCompressor.m */; };
+ 8C712701146751DC00C03BD2 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126E8146751DC00C03BD2 /* ASIDataDecompressor.m */; };
+ 8C712702146751DC00C03BD2 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126EA146751DC00C03BD2 /* ASIDownloadCache.m */; };
+ 8C712703146751DC00C03BD2 /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126EC146751DC00C03BD2 /* ASIFormDataRequest.m */; };
+ 8C712704146751DC00C03BD2 /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126EE146751DC00C03BD2 /* ASIHTTPRequest.m */; };
+ 8C712705146751DC00C03BD2 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126F2146751DC00C03BD2 /* ASIInputStream.m */; };
+ 8C712706146751DC00C03BD2 /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126F4146751DC00C03BD2 /* ASINetworkQueue.m */; };
+ 8C712707146751DC00C03BD2 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 8C7126F8146751DC00C03BD2 /* LICENSE */; };
+ 8C712708146751DC00C03BD2 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7126FE146751DC00C03BD2 /* Reachability.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 8C2C559D146750E70065A877 /* ComponentsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ComponentsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8C2C55A1146750E70065A877 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 8C2C55A3146750E70065A877 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 8C2C55A5146750E70065A877 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 8C2C55A9146750E70065A877 /* ComponentsDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ComponentsDemo-Info.plist"; sourceTree = "<group>"; };
+ 8C2C55AB146750E70065A877 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 8C2C55AD146750E70065A877 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 8C2C55AF146750E70065A877 /* ComponentsDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ComponentsDemo-Prefix.pch"; sourceTree = "<group>"; };
+ 8C2C55B0146750E70065A877 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 8C2C55B1146750E70065A877 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 8C4D3D081467549D0093F771 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ 8C4D3D091467549D0093F771 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+ 8C4D3D0D146756170093F771 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPad.xib; sourceTree = "<group>"; };
+ 8C4D3D0F146756170093F771 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPhone.xib; sourceTree = "<group>"; };
+ 8C4D3D11146756170093F771 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Window_iPad.xib; sourceTree = "<group>"; };
+ 8C4D3D13146756170093F771 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Window_iPhone.xib; sourceTree = "<group>"; };
+ 8C4D3D18146756A80093F771 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ 8C4D3D1A146756B00093F771 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+ 8C4D3D1C146756CD0093F771 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
+ 8C4D3D1E146756E00093F771 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
+ 8C4D3D211467591A0093F771 /* VC_KSAdvancedPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VC_KSAdvancedPicker.h; sourceTree = "<group>"; };
+ 8C4D3D221467591A0093F771 /* VC_KSAdvancedPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VC_KSAdvancedPicker.m; sourceTree = "<group>"; };
+ 8C4D3D2814675BF40093F771 /* VC_KSEditEnder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VC_KSEditEnder.h; sourceTree = "<group>"; };
+ 8C4D3D2914675BF40093F771 /* VC_KSEditEnder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VC_KSEditEnder.m; sourceTree = "<group>"; };
+ 8C4D3D2B14675C520093F771 /* VC_KSProgressDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VC_KSProgressDownloader.h; sourceTree = "<group>"; };
+ 8C4D3D2C14675C520093F771 /* VC_KSProgressDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VC_KSProgressDownloader.m; sourceTree = "<group>"; };
+ 8C4D3D2E14675D930093F771 /* VC_KSSheetView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VC_KSSheetView.h; sourceTree = "<group>"; };
+ 8C4D3D2F14675D930093F771 /* VC_KSSheetView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VC_KSSheetView.m; sourceTree = "<group>"; };
+ 8C4D3D3114675EEC0093F771 /* VC_KSCheckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VC_KSCheckView.h; sourceTree = "<group>"; };
+ 8C4D3D3214675EEC0093F771 /* VC_KSCheckView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VC_KSCheckView.m; sourceTree = "<group>"; };
+ 8C7126C91467517100C03BD2 /* KSCheckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSCheckView.h; sourceTree = "<group>"; };
+ 8C7126CA1467517100C03BD2 /* KSCheckView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSCheckView.m; sourceTree = "<group>"; };
+ 8C7126CD146751A300C03BD2 /* KSAdvancedPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSAdvancedPicker.h; sourceTree = "<group>"; };
+ 8C7126CE146751A300C03BD2 /* KSAdvancedPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSAdvancedPicker.m; sourceTree = "<group>"; };
+ 8C7126D0146751A300C03BD2 /* KSEditEnder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSEditEnder.h; sourceTree = "<group>"; };
+ 8C7126D1146751A300C03BD2 /* KSEditEnder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSEditEnder.m; sourceTree = "<group>"; };
+ 8C7126D3146751A300C03BD2 /* KSProgressDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSProgressDownloader.h; sourceTree = "<group>"; };
+ 8C7126D4146751A300C03BD2 /* KSProgressDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSProgressDownloader.m; sourceTree = "<group>"; };
+ 8C7126D6146751A300C03BD2 /* KSSheetView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSSheetView.h; sourceTree = "<group>"; };
+ 8C7126D7146751A300C03BD2 /* KSSheetView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSSheetView.m; sourceTree = "<group>"; };
+ 8C7126E2146751DC00C03BD2 /* ASIAuthenticationDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIAuthenticationDialog.h; sourceTree = "<group>"; };
+ 8C7126E3146751DC00C03BD2 /* ASIAuthenticationDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIAuthenticationDialog.m; sourceTree = "<group>"; };
+ 8C7126E4146751DC00C03BD2 /* ASICacheDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASICacheDelegate.h; sourceTree = "<group>"; };
+ 8C7126E5146751DC00C03BD2 /* ASIDataCompressor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIDataCompressor.h; sourceTree = "<group>"; };
+ 8C7126E6146751DC00C03BD2 /* ASIDataCompressor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIDataCompressor.m; sourceTree = "<group>"; };
+ 8C7126E7146751DC00C03BD2 /* ASIDataDecompressor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIDataDecompressor.h; sourceTree = "<group>"; };
+ 8C7126E8146751DC00C03BD2 /* ASIDataDecompressor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIDataDecompressor.m; sourceTree = "<group>"; };
+ 8C7126E9146751DC00C03BD2 /* ASIDownloadCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIDownloadCache.h; sourceTree = "<group>"; };
+ 8C7126EA146751DC00C03BD2 /* ASIDownloadCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIDownloadCache.m; sourceTree = "<group>"; };
+ 8C7126EB146751DC00C03BD2 /* ASIFormDataRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIFormDataRequest.h; sourceTree = "<group>"; };
+ 8C7126EC146751DC00C03BD2 /* ASIFormDataRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIFormDataRequest.m; sourceTree = "<group>"; };
+ 8C7126ED146751DC00C03BD2 /* ASIHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIHTTPRequest.h; sourceTree = "<group>"; };
+ 8C7126EE146751DC00C03BD2 /* ASIHTTPRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIHTTPRequest.m; sourceTree = "<group>"; };
+ 8C7126EF146751DC00C03BD2 /* ASIHTTPRequestConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIHTTPRequestConfig.h; sourceTree = "<group>"; };
+ 8C7126F0146751DC00C03BD2 /* ASIHTTPRequestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIHTTPRequestDelegate.h; sourceTree = "<group>"; };
+ 8C7126F1146751DC00C03BD2 /* ASIInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIInputStream.h; sourceTree = "<group>"; };
+ 8C7126F2146751DC00C03BD2 /* ASIInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIInputStream.m; sourceTree = "<group>"; };
+ 8C7126F3146751DC00C03BD2 /* ASINetworkQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASINetworkQueue.h; sourceTree = "<group>"; };
+ 8C7126F4146751DC00C03BD2 /* ASINetworkQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASINetworkQueue.m; sourceTree = "<group>"; };
+ 8C7126F5146751DC00C03BD2 /* ASIProgressDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIProgressDelegate.h; sourceTree = "<group>"; };
+ 8C7126F8146751DC00C03BD2 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
+ 8C7126FD146751DC00C03BD2 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
+ 8C7126FE146751DC00C03BD2 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8C2C559A146750E70065A877 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8C2C55A2146750E70065A877 /* UIKit.framework in Frameworks */,
+ 8C2C55A4146750E70065A877 /* Foundation.framework in Frameworks */,
+ 8C2C55A6146750E70065A877 /* CoreGraphics.framework in Frameworks */,
+ 8C4D3D1B146756B00093F771 /* SystemConfiguration.framework in Frameworks */,
+ 8C4D3D19146756A90093F771 /* CFNetwork.framework in Frameworks */,
+ 8C4D3D1F146756E00093F771 /* MobileCoreServices.framework in Frameworks */,
+ 8C4D3D1D146756CD0093F771 /* libz.dylib in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 8C2C5592146750E70065A877 = {
+ isa = PBXGroup;
+ children = (
+ 8C2C55A7146750E70065A877 /* ComponentsDemo */,
+ 8C2C55A0146750E70065A877 /* Frameworks */,
+ 8C2C559E146750E70065A877 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 8C2C559E146750E70065A877 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8C2C559D146750E70065A877 /* ComponentsDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 8C2C55A0146750E70065A877 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 8C2C55A1146750E70065A877 /* UIKit.framework */,
+ 8C2C55A3146750E70065A877 /* Foundation.framework */,
+ 8C2C55A5146750E70065A877 /* CoreGraphics.framework */,
+ 8C4D3D1A146756B00093F771 /* SystemConfiguration.framework */,
+ 8C4D3D18146756A80093F771 /* CFNetwork.framework */,
+ 8C4D3D1E146756E00093F771 /* MobileCoreServices.framework */,
+ 8C4D3D1C146756CD0093F771 /* libz.dylib */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 8C2C55A7146750E70065A877 /* ComponentsDemo */ = {
+ isa = PBXGroup;
+ children = (
+ 8C2C55B81467510A0065A877 /* Classes */,
+ 8C4D3D06146754690093F771 /* Tests */,
+ 8C7126E0146751DC00C03BD2 /* External */,
+ 8C2C55B0146750E70065A877 /* AppDelegate.h */,
+ 8C2C55B1146750E70065A877 /* AppDelegate.m */,
+ 8C4D3D081467549D0093F771 /* ViewController.h */,
+ 8C4D3D091467549D0093F771 /* ViewController.m */,
+ 8C4D3D0E146756170093F771 /* ViewController_iPhone.xib */,
+ 8C4D3D0C146756170093F771 /* ViewController_iPad.xib */,
+ 8C4D3D12146756170093F771 /* Window_iPhone.xib */,
+ 8C4D3D10146756170093F771 /* Window_iPad.xib */,
+ 8C2C55A8146750E70065A877 /* Supporting Files */,
+ );
+ path = ComponentsDemo;
+ sourceTree = "<group>";
+ };
+ 8C2C55A8146750E70065A877 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 8C2C55A9146750E70065A877 /* ComponentsDemo-Info.plist */,
+ 8C2C55AA146750E70065A877 /* InfoPlist.strings */,
+ 8C2C55AD146750E70065A877 /* main.m */,
+ 8C2C55AF146750E70065A877 /* ComponentsDemo-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 8C2C55B81467510A0065A877 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126CC146751A300C03BD2 /* KSAdvancedPicker */,
+ 8C2C55B91467510A0065A877 /* KSCheckView */,
+ 8C7126CF146751A300C03BD2 /* KSEditEnder */,
+ 8C7126D2146751A300C03BD2 /* KSProgressDownloader */,
+ 8C7126D5146751A300C03BD2 /* KSSheetView */,
+ );
+ name = Classes;
+ path = ../../Classes;
+ sourceTree = "<group>";
+ };
+ 8C2C55B91467510A0065A877 /* KSCheckView */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126C91467517100C03BD2 /* KSCheckView.h */,
+ 8C7126CA1467517100C03BD2 /* KSCheckView.m */,
+ );
+ path = KSCheckView;
+ sourceTree = "<group>";
+ };
+ 8C4D3D06146754690093F771 /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ 8C4D3D201467591A0093F771 /* KSAdvancedPicker */,
+ 8C4D3D231467591A0093F771 /* KSCheckView */,
+ 8C4D3D241467591A0093F771 /* KSEditEnder */,
+ 8C4D3D251467591A0093F771 /* KSProgressDownloader */,
+ 8C4D3D261467591A0093F771 /* KSSheetView */,
+ );
+ path = Tests;
+ sourceTree = "<group>";
+ };
+ 8C4D3D201467591A0093F771 /* KSAdvancedPicker */ = {
+ isa = PBXGroup;
+ children = (
+ 8C4D3D211467591A0093F771 /* VC_KSAdvancedPicker.h */,
+ 8C4D3D221467591A0093F771 /* VC_KSAdvancedPicker.m */,
+ );
+ path = KSAdvancedPicker;
+ sourceTree = "<group>";
+ };
+ 8C4D3D231467591A0093F771 /* KSCheckView */ = {
+ isa = PBXGroup;
+ children = (
+ 8C4D3D3114675EEC0093F771 /* VC_KSCheckView.h */,
+ 8C4D3D3214675EEC0093F771 /* VC_KSCheckView.m */,
+ );
+ path = KSCheckView;
+ sourceTree = "<group>";
+ };
+ 8C4D3D241467591A0093F771 /* KSEditEnder */ = {
+ isa = PBXGroup;
+ children = (
+ 8C4D3D2814675BF40093F771 /* VC_KSEditEnder.h */,
+ 8C4D3D2914675BF40093F771 /* VC_KSEditEnder.m */,
+ );
+ path = KSEditEnder;
+ sourceTree = "<group>";
+ };
+ 8C4D3D251467591A0093F771 /* KSProgressDownloader */ = {
+ isa = PBXGroup;
+ children = (
+ 8C4D3D2B14675C520093F771 /* VC_KSProgressDownloader.h */,
+ 8C4D3D2C14675C520093F771 /* VC_KSProgressDownloader.m */,
+ );
+ path = KSProgressDownloader;
+ sourceTree = "<group>";
+ };
+ 8C4D3D261467591A0093F771 /* KSSheetView */ = {
+ isa = PBXGroup;
+ children = (
+ 8C4D3D2E14675D930093F771 /* VC_KSSheetView.h */,
+ 8C4D3D2F14675D930093F771 /* VC_KSSheetView.m */,
+ );
+ path = KSSheetView;
+ sourceTree = "<group>";
+ };
+ 8C7126CC146751A300C03BD2 /* KSAdvancedPicker */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126CD146751A300C03BD2 /* KSAdvancedPicker.h */,
+ 8C7126CE146751A300C03BD2 /* KSAdvancedPicker.m */,
+ );
+ path = KSAdvancedPicker;
+ sourceTree = "<group>";
+ };
+ 8C7126CF146751A300C03BD2 /* KSEditEnder */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126D0146751A300C03BD2 /* KSEditEnder.h */,
+ 8C7126D1146751A300C03BD2 /* KSEditEnder.m */,
+ );
+ path = KSEditEnder;
+ sourceTree = "<group>";
+ };
+ 8C7126D2146751A300C03BD2 /* KSProgressDownloader */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126D3146751A300C03BD2 /* KSProgressDownloader.h */,
+ 8C7126D4146751A300C03BD2 /* KSProgressDownloader.m */,
+ );
+ path = KSProgressDownloader;
+ sourceTree = "<group>";
+ };
+ 8C7126D5146751A300C03BD2 /* KSSheetView */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126D6146751A300C03BD2 /* KSSheetView.h */,
+ 8C7126D7146751A300C03BD2 /* KSSheetView.m */,
+ );
+ path = KSSheetView;
+ sourceTree = "<group>";
+ };
+ 8C7126E0146751DC00C03BD2 /* External */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126E1146751DC00C03BD2 /* asi-http-request */,
+ 8C7126FB146751DC00C03BD2 /* GHUnit */,
+ 8C7126FC146751DC00C03BD2 /* Reachability */,
+ );
+ name = External;
+ path = ../../External;
+ sourceTree = "<group>";
+ };
+ 8C7126E1146751DC00C03BD2 /* asi-http-request */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126E2146751DC00C03BD2 /* ASIAuthenticationDialog.h */,
+ 8C7126E3146751DC00C03BD2 /* ASIAuthenticationDialog.m */,
+ 8C7126E4146751DC00C03BD2 /* ASICacheDelegate.h */,
+ 8C7126E5146751DC00C03BD2 /* ASIDataCompressor.h */,
+ 8C7126E6146751DC00C03BD2 /* ASIDataCompressor.m */,
+ 8C7126E7146751DC00C03BD2 /* ASIDataDecompressor.h */,
+ 8C7126E8146751DC00C03BD2 /* ASIDataDecompressor.m */,
+ 8C7126E9146751DC00C03BD2 /* ASIDownloadCache.h */,
+ 8C7126EA146751DC00C03BD2 /* ASIDownloadCache.m */,
+ 8C7126EB146751DC00C03BD2 /* ASIFormDataRequest.h */,
+ 8C7126EC146751DC00C03BD2 /* ASIFormDataRequest.m */,
+ 8C7126ED146751DC00C03BD2 /* ASIHTTPRequest.h */,
+ 8C7126EE146751DC00C03BD2 /* ASIHTTPRequest.m */,
+ 8C7126EF146751DC00C03BD2 /* ASIHTTPRequestConfig.h */,
+ 8C7126F0146751DC00C03BD2 /* ASIHTTPRequestDelegate.h */,
+ 8C7126F1146751DC00C03BD2 /* ASIInputStream.h */,
+ 8C7126F2146751DC00C03BD2 /* ASIInputStream.m */,
+ 8C7126F3146751DC00C03BD2 /* ASINetworkQueue.h */,
+ 8C7126F4146751DC00C03BD2 /* ASINetworkQueue.m */,
+ 8C7126F5146751DC00C03BD2 /* ASIProgressDelegate.h */,
+ 8C7126F6146751DC00C03BD2 /* ASIWebPageRequest */,
+ 8C7126F7146751DC00C03BD2 /* CloudFiles */,
+ 8C7126F8146751DC00C03BD2 /* LICENSE */,
+ 8C7126F9146751DC00C03BD2 /* S3 */,
+ 8C7126FA146751DC00C03BD2 /* Tests */,
+ );
+ path = "asi-http-request";
+ sourceTree = "<group>";
+ };
+ 8C7126F6146751DC00C03BD2 /* ASIWebPageRequest */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = ASIWebPageRequest;
+ sourceTree = "<group>";
+ };
+ 8C7126F7146751DC00C03BD2 /* CloudFiles */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = CloudFiles;
+ sourceTree = "<group>";
+ };
+ 8C7126F9146751DC00C03BD2 /* S3 */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = S3;
+ sourceTree = "<group>";
+ };
+ 8C7126FA146751DC00C03BD2 /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = Tests;
+ sourceTree = "<group>";
+ };
+ 8C7126FB146751DC00C03BD2 /* GHUnit */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = GHUnit;
+ sourceTree = "<group>";
+ };
+ 8C7126FC146751DC00C03BD2 /* Reachability */ = {
+ isa = PBXGroup;
+ children = (
+ 8C7126FD146751DC00C03BD2 /* Reachability.h */,
+ 8C7126FE146751DC00C03BD2 /* Reachability.m */,
+ );
+ path = Reachability;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8C2C559C146750E70065A877 /* ComponentsDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8C2C55B5146750E70065A877 /* Build configuration list for PBXNativeTarget "ComponentsDemo" */;
+ buildPhases = (
+ 8C2C5599146750E70065A877 /* Sources */,
+ 8C2C559A146750E70065A877 /* Frameworks */,
+ 8C2C559B146750E70065A877 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = ComponentsDemo;
+ productName = ComponentsDemo;
+ productReference = 8C2C559D146750E70065A877 /* ComponentsDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 8C2C5594146750E70065A877 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ ORGANIZATIONNAME = algoritmico;
+ };
+ buildConfigurationList = 8C2C5597146750E70065A877 /* Build configuration list for PBXProject "ComponentsDemo" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 8C2C5592146750E70065A877;
+ productRefGroup = 8C2C559E146750E70065A877 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8C2C559C146750E70065A877 /* ComponentsDemo */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8C2C559B146750E70065A877 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8C2C55AC146750E70065A877 /* InfoPlist.strings in Resources */,
+ 8C712707146751DC00C03BD2 /* LICENSE in Resources */,
+ 8C4D3D14146756170093F771 /* ViewController_iPad.xib in Resources */,
+ 8C4D3D15146756170093F771 /* ViewController_iPhone.xib in Resources */,
+ 8C4D3D16146756170093F771 /* Window_iPad.xib in Resources */,
+ 8C4D3D17146756170093F771 /* Window_iPhone.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8C2C5599146750E70065A877 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8C2C55AE146750E70065A877 /* main.m in Sources */,
+ 8C2C55B2146750E70065A877 /* AppDelegate.m in Sources */,
+ 8C7126CB1467517100C03BD2 /* KSCheckView.m in Sources */,
+ 8C7126D8146751A300C03BD2 /* KSAdvancedPicker.m in Sources */,
+ 8C7126D9146751A300C03BD2 /* KSEditEnder.m in Sources */,
+ 8C7126DA146751A300C03BD2 /* KSProgressDownloader.m in Sources */,
+ 8C7126DB146751A300C03BD2 /* KSSheetView.m in Sources */,
+ 8C7126FF146751DC00C03BD2 /* ASIAuthenticationDialog.m in Sources */,
+ 8C712700146751DC00C03BD2 /* ASIDataCompressor.m in Sources */,
+ 8C712701146751DC00C03BD2 /* ASIDataDecompressor.m in Sources */,
+ 8C712702146751DC00C03BD2 /* ASIDownloadCache.m in Sources */,
+ 8C712703146751DC00C03BD2 /* ASIFormDataRequest.m in Sources */,
+ 8C712704146751DC00C03BD2 /* ASIHTTPRequest.m in Sources */,
+ 8C712705146751DC00C03BD2 /* ASIInputStream.m in Sources */,
+ 8C712706146751DC00C03BD2 /* ASINetworkQueue.m in Sources */,
+ 8C712708146751DC00C03BD2 /* Reachability.m in Sources */,
+ 8C4D3D0A1467549D0093F771 /* ViewController.m in Sources */,
+ 8C4D3D271467591A0093F771 /* VC_KSAdvancedPicker.m in Sources */,
+ 8C4D3D2A14675BF40093F771 /* VC_KSEditEnder.m in Sources */,
+ 8C4D3D2D14675C520093F771 /* VC_KSProgressDownloader.m in Sources */,
+ 8C4D3D3014675D930093F771 /* VC_KSSheetView.m in Sources */,
+ 8C4D3D3314675EEC0093F771 /* VC_KSCheckView.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 8C2C55AA146750E70065A877 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8C2C55AB146750E70065A877 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 8C4D3D0C146756170093F771 /* ViewController_iPad.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8C4D3D0D146756170093F771 /* en */,
+ );
+ name = ViewController_iPad.xib;
+ sourceTree = "<group>";
+ };
+ 8C4D3D0E146756170093F771 /* ViewController_iPhone.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8C4D3D0F146756170093F771 /* en */,
+ );
+ name = ViewController_iPhone.xib;
+ sourceTree = "<group>";
+ };
+ 8C4D3D10146756170093F771 /* Window_iPad.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8C4D3D11146756170093F771 /* en */,
+ );
+ name = Window_iPad.xib;
+ sourceTree = "<group>";
+ };
+ 8C4D3D12146756170093F771 /* Window_iPhone.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8C4D3D13146756170093F771 /* en */,
+ );
+ name = Window_iPhone.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 8C2C55B3146750E70065A877 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.2;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 8C2C55B4146750E70065A877 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.2;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 8C2C55B6146750E70065A877 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ComponentsDemo/ComponentsDemo-Prefix.pch";
+ INFOPLIST_FILE = "ComponentsDemo/ComponentsDemo-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 8C2C55B7146750E70065A877 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ComponentsDemo/ComponentsDemo-Prefix.pch";
+ INFOPLIST_FILE = "ComponentsDemo/ComponentsDemo-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 8C2C5597146750E70065A877 /* Build configuration list for PBXProject "ComponentsDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8C2C55B3146750E70065A877 /* Debug */,
+ 8C2C55B4146750E70065A877 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8C2C55B5146750E70065A877 /* Build configuration list for PBXNativeTarget "ComponentsDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8C2C55B6146750E70065A877 /* Debug */,
+ 8C2C55B7146750E70065A877 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 8C2C5594146750E70065A877 /* Project object */;
+}
View
16 Demo/ComponentsDemo/AppDelegate.h
@@ -0,0 +1,16 @@
+//
+// AppDelegate.h
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 11/7/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) IBOutlet UIWindow *window;
+@property (strong, nonatomic) IBOutlet UINavigationController *navigationController;
+
+@end
View
69 Demo/ComponentsDemo/AppDelegate.m
@@ -0,0 +1,69 @@
+//
+// AppDelegate.m
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 11/7/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+@synthesize navigationController;
+
+- (void)dealloc
+{
+ [_window release];
+ [super dealloc];
+}
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ [self.window addSubview:navigationController.view];
+ [self.window makeKeyAndVisible];
+
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ /*
+ Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+ */
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ /*
+ Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ */
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ /*
+ Called when the application is about to terminate.
+ Save data if appropriate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+@end
View
51 Demo/ComponentsDemo/ComponentsDemo-Info.plist
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFiles</key>
+ <array/>
+ <key>CFBundleIdentifier</key>
+ <string>com.algoritmico.ios.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>Window_iPhone</string>
+ <key>NSMainNibFile~ipad</key>
+ <string>Window_iPad</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
14 Demo/ComponentsDemo/ComponentsDemo-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'ComponentsDemo' target in the 'ComponentsDemo' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
View
16 Demo/ComponentsDemo/Tests/KSAdvancedPicker/VC_KSAdvancedPicker.h
@@ -0,0 +1,16 @@
+//
+// VC_KSAdvancedPicker.h
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/17/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "KSAdvancedPicker.h"
+
+@interface VC_KSAdvancedPicker : UIViewController <KSAdvancedPickerDelegate> {
+ NSMutableArray *data;
+}
+
+@end
View
120 Demo/ComponentsDemo/Tests/KSAdvancedPicker/VC_KSAdvancedPicker.m
@@ -0,0 +1,120 @@
+//
+// VC_KSAdvancedPicker.m
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/17/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import "VC_KSAdvancedPicker.h"
+
+@implementation VC_KSAdvancedPicker
+
+- (void) dealloc
+{
+ [data release];
+
+ [super dealloc];
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.title = @"KSAdvancedPicker";
+
+ //
+
+ data = [[NSMutableArray alloc] init];
+ for (NSUInteger i = 0; i < 20; ++i) {
+ [data addObject:[NSString stringWithFormat:@"Row %d", i]];
+ }
+
+ CGRect frame;
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ frame = CGRectMake(20, 20, 728, 350);
+ } else {
+ frame = CGRectMake(20, 20, 280, 200);
+ }
+
+ KSAdvancedPicker *ap = [[KSAdvancedPicker alloc] initWithFrame:frame delegate:self];
+ [ap reloadData];
+ [ap scrollToRowAtIndex:4 animated:YES];
+ [self.view addSubview:ap];
+ [ap release];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ [data release];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return NO;
+}
+
+#pragma mark - KSAdvancedPickerDelegate
+
+- (CGFloat) heightForRowInAdvancedPicker:(KSAdvancedPicker *)picker
+{
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ return 80;
+ } else {
+ return 50;
+ }
+}
+
+- (NSInteger) numberOfRowsInAdvancedPicker:(KSAdvancedPicker *)picker
+{
+ return [data count];
+}
+
+- (UITableViewCell *) advancedPicker:(KSAdvancedPicker *)picker tableView:(UITableView *)tableView cellForRowAtIndex:(NSInteger)rowIndex
+{
+ static NSString *identifier = @"CellIdentifier";
+
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
+ if (!cell) {
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
+ reuseIdentifier:identifier];
+ [cell autorelease];
+ }
+
+ cell.textLabel.textColor = [UIColor blueColor];
+ cell.textLabel.text = [data objectAtIndex:rowIndex];
+
+ return cell;
+}
+
+//- (UIView *) backgroundViewForAdvancedPicker:(KSAdvancedPicker *)picker
+//{
+// return nil;
+//}
+
+- (UIColor *) backgroundColorForAdvancedPicker:(KSAdvancedPicker *)picker
+{
+ return [UIColor lightGrayColor];
+}
+
+//- (UIView *) viewForAdvancedPickerSelector:(KSAdvancedPicker *)picker
+//{
+// return nil;
+//}
+
+- (UIColor *) viewColorForAdvancedPickerSelector:(KSAdvancedPicker *)picker
+{
+ return [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:0.3];
+}
+
+@end
View
14 Demo/ComponentsDemo/Tests/KSCheckView/VC_KSCheckView.h
@@ -0,0 +1,14 @@
+//
+// VC_KSCheckView.h
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/23/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "KSCheckView.h"
+
+@interface VC_KSCheckView : UIViewController
+
+@end
View
56 Demo/ComponentsDemo/Tests/KSCheckView/VC_KSCheckView.m
@@ -0,0 +1,56 @@
+//
+// VC_KSCheckView.m
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/23/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import "VC_KSCheckView.h"
+
+@implementation VC_KSCheckView
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.title = @"KSCheckView";
+
+ //
+
+ KSCheckView *onCheck = [[KSCheckView alloc] initWithFrame:CGRectMake(20, 20, 50, 50)];
+ onCheck.backgroundColor = [UIColor blueColor];
+ onCheck.color = [UIColor whiteColor];
+ onCheck.checked = YES;
+ [self.view addSubview:onCheck];
+ [onCheck release];
+
+ KSCheckView *offCheck = [[KSCheckView alloc] initWithFrame:CGRectMake(100, 20, 50, 50)];
+ offCheck.backgroundColor = [UIColor blueColor];
+ offCheck.color = [UIColor whiteColor];
+ offCheck.checked = NO;
+ [self.view addSubview:offCheck];
+ [offCheck release];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return NO;
+}
+
+@end
View
17 Demo/ComponentsDemo/Tests/KSEditEnder/VC_KSEditEnder.h
@@ -0,0 +1,17 @@
+//
+// VC_KSEditEnder.h
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 11/6/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "KSEditEnder.h"
+
+@interface VC_KSEditEnder : UIViewController <UITextFieldDelegate>
+
+@property (nonatomic, retain) NSMutableArray *fields; // of UITextField
+@property (nonatomic, retain) KSEditEnder *editEnder;
+
+@end
View
90 Demo/ComponentsDemo/Tests/KSEditEnder/VC_KSEditEnder.m
@@ -0,0 +1,90 @@
+//
+// VC_KSEditEnder.m
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 11/6/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import "VC_KSEditEnder.h"
+
+@implementation VC_KSEditEnder
+
+@synthesize fields;
+@synthesize editEnder;
+
+- (void) dealloc
+{
+ self.fields = nil;
+ self.editEnder = nil;
+
+ [super dealloc];
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.title = @"KSEditEnder";
+
+ //
+
+ self.fields = [NSMutableArray array];
+
+ const CGFloat width = self.view.frame.size.width - 40;
+ CGRect fieldFrame = CGRectMake(20, 20, width, 30);
+ for (NSUInteger i = 0; i < 5; ++i) {
+ UITextField *field = [[UITextField alloc] initWithFrame:fieldFrame];
+ field.borderStyle = UITextBorderStyleRoundedRect;
+ field.delegate = self;
+ [self.view addSubview:field];
+
+ [fields addObject:field];
+ [field release];
+
+ fieldFrame.origin.y += 40;
+ }
+
+ // automatically added to the view
+ self.editEnder = [KSEditEnder enderWithView:self.view];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ self.fields = nil;
+ self.editEnder = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return NO;
+}
+
+#pragma mark - UITextFieldDelegate
+
+// choose when to intercept outside touches
+
+- (void) textFieldDidBeginEditing:(UITextField *)textField
+{
+ editEnder.userInteractionEnabled = YES;
+
+ // keep keyboard visible on touch within currently edited text field
+ [self.view bringSubviewToFront:textField];
+}
+
+- (void) textFieldDidEndEditing:(UITextField *)textField
+{
+ editEnder.userInteractionEnabled = NO;
+}
+
+@end
View
16 Demo/ComponentsDemo/Tests/KSProgressDownloader/VC_KSProgressDownloader.h
@@ -0,0 +1,16 @@
+//
+// VC_KSProgressDownloader.h
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/23/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "KSProgressDownloader.h"
+
+@interface VC_KSProgressDownloader : UIViewController <KSProgressDownloaderDelegate>
+
+@property (nonatomic, retain) UITextView *fileInfo;
+
+@end
View
75 Demo/ComponentsDemo/Tests/KSProgressDownloader/VC_KSProgressDownloader.m
@@ -0,0 +1,75 @@
+//
+// VC_KSProgressDownloader.m
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/23/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import "VC_KSProgressDownloader.h"
+
+@implementation VC_KSProgressDownloader
+
+@synthesize fileInfo;
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.title = @"KSProgressDownloader";
+
+ //
+
+ self.fileInfo = [[UITextView alloc] initWithFrame:self.view.frame];
+ [self.view addSubview:fileInfo];
+ [fileInfo release];
+
+ KSProgressDownloader *downloader = [KSProgressDownloader instance];
+ downloader.message = @"Downloading a PDF";
+ downloader.delegate = self;
+
+ NSURL *url = [NSURL URLWithString:@"http://algoritmico.com/files/crucio.pdf"];
+ ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
+ [downloader downloadWithRequest:request];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ self.fileInfo = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return NO;
+}
+
+#pragma mark - KSProgressDownloaderDelegate
+
+- (void) downloader:(KSProgressDownloader *)downloader didDownloadURL:(NSURL *)url toFile:(NSString *)file
+{
+ NSLog(@"didDownloadURL:%@ toFile:%@", url, file);
+
+ NSError *error = nil;
+ NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:file error:&error];
+ if (!error) {
+ NSLog(@"file attributes = %@", attributes);
+ fileInfo.text = [attributes description];
+ }
+}
+
+- (void) downloader:(KSProgressDownloader *)downloader didFailToDownloadURL:(NSURL *)url errorCode:(int)errorCode
+{
+ NSLog(@"didFailToDownloadURL:%@ (code %d)", url, errorCode);
+}
+
+@end
View
14 Demo/ComponentsDemo/Tests/KSSheetView/VC_KSSheetView.h
@@ -0,0 +1,14 @@
+//
+// VC_KSSheetView.h
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/23/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "KSSheetView.h"
+
+@interface VC_KSSheetView : UIViewController <KSSheetViewDelegate>
+
+@end
View
59 Demo/ComponentsDemo/Tests/KSSheetView/VC_KSSheetView.m
@@ -0,0 +1,59 @@
+//
+// VC_KSSheetView.m
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 10/23/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import "VC_KSSheetView.h"
+
+@implementation VC_KSSheetView
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.title = @"KSSheetView";
+
+ //
+
+ KSSheetView *sheet = [[KSSheetView alloc] initWithFrame:self.view.bounds];
+ sheet.cellSize = 20;
+ sheet.lineWidth = 1.0;
+ sheet.delegate = self;
+ [self.view addSubview:sheet];
+ [sheet release];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return NO;
+}
+
+#pragma mark - KSSheetViewDelegate
+
+- (void) drawInSheet:(KSSheetView *)sheetView inContext:(CGContextRef)context inRect:(CGRect)rect
+{
+ CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
+ CGContextFillRect(context, CGRectMake(100, 100, 80, 120));
+ CGContextSetFillColorWithColor(context, [UIColor blueColor].CGColor);
+ CGContextFillRect(context, CGRectMake(200, 200, 100, 70));
+}
+
+@end
View
16 Demo/ComponentsDemo/ViewController.h
@@ -0,0 +1,16 @@
+//
+// ViewController.h
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 11/7/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ViewController : UIViewController<UITableViewDataSource, UITableViewDelegate> {
+}
+
+@property (nonatomic, retain) NSMutableArray *menu;
+
+@end
View
98 Demo/ComponentsDemo/ViewController.m
@@ -0,0 +1,98 @@
+//
+// ViewController.m
+// ComponentsDemo
+//
+// Created by Davide De Rosa on 11/7/11.
+// Copyright (c) 2011 algoritmico. All rights reserved.
+//
+
+#import "ViewController.h"
+
+//#import "VC_KSAdvancedPicker.h"
+//#import "VC_KSCheckView.h"
+//#import "VC_KSEditEnder.h"
+//#import "VC_KSProgressDownloader.h"
+//#import "VC_KSSheetView.h"
+
+@implementation ViewController
+
+@synthesize menu;
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.menu = [NSMutableArray array];
+
+ [menu addObject:@"KSAdvancedPicker"];
+ [menu addObject:@"KSCheckView"];
+ [menu addObject:@"KSEditEnder"];
+ [menu addObject:@"KSProgressDownloader"];
+ [menu addObject:@"KSSheetView"];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ self.menu = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
+ } else {
+ return YES;
+ }
+}
+
+#pragma mark - UITableViewDataSource
+
+- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return [menu count];
+}
+
+- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ static NSString *identifier = @"CellIdentifier";
+
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
+ if (!cell) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
+ reuseIdentifier:identifier] autorelease];
+ }
+
+ cell.textLabel.text = [menu objectAtIndex:indexPath.row];
+
+ return cell;
+}
+
+#pragma mark - UITableViewDelegate
+
+- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ NSString *menuName = [menu objectAtIndex:indexPath.row];
+ NSString *vcName = [NSString stringWithFormat:@"VC_%@", menuName];
+
+ UIViewController *vc = [[NSClassFromString(vcName) alloc] init];
+ [self.navigationController pushViewController:vc animated:YES];
+ [vc release];
+}
+
+@end
View
2  Demo/ComponentsDemo/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
169 Demo/ComponentsDemo/en.lproj/ViewController_iPad.xib
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">933</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ <string>IBUITableView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="841351856">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBProxyObject" id="606714003">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBUIView" id="766721923">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUITableView" id="19633178">
+ <reference key="NSNextResponder" ref="766721923"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{768, 1004}</string>
+ <reference key="NSSuperview" ref="766721923"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:408</string>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ <bool key="IBUIAlwaysBounceVertical">YES</bool>
+ <int key="IBUISeparatorStyle">1</int>
+ <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
+ <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
+ <float key="IBUIRowHeight">44</float>
+ <float key="IBUISectionHeaderHeight">22</float>
+ <float key="IBUISectionFooterHeight">22</float>
+ </object>
+ </array>
+ <string key="NSFrame">{{0, 20}, {768, 1004}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
+ <int key="IBUIStatusBarStyle">2</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="841351856"/>
+ <reference key="destination" ref="766721923"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="19633178"/>
+ <reference key="destination" ref="841351856"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="19633178"/>
+ <reference key="destination" ref="841351856"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="841351856"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="606714003"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="766721923"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="19633178"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="19633178"/>
+ <reference key="parent" ref="766721923"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">ViewController</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">6</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">ViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ViewController.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">933</string>
+ </data>
+</archive>
View
168 Demo/ComponentsDemo/en.lproj/ViewController_iPhone.xib
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">933</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ <string>IBUITableView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="843779117">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="774585933">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUITableView" id="532664903">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{320, 460}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:418</string>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIAlwaysBounceVertical">YES</bool>
+ <int key="IBUISeparatorStyle">1</int>
+ <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
+ <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
+ <float key="IBUIRowHeight">44</float>
+ <float key="IBUISectionHeaderHeight">22</float>
+ <float key="IBUISectionFooterHeight">22</float>
+ </object>
+ </array>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC43NQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="774585933"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="532664903"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">9</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">dataSource</string>