├── README.markdown ├── Drag ├── build │ └── .gitignore ├── drag_default.png ├── drag_overlay.png ├── DrawerWithPattern.psd ├── Drag_Prefix.pch ├── DragViewController.h ├── iPad │ ├── AppDelegate_Pad.h │ ├── AppDelegate_Pad.m │ └── MainWindow_Pad.xib ├── iPhone │ ├── AppDelegate_Phone.h │ ├── AppDelegate_Phone.m │ └── MainWindow_Phone.xib ├── Shared │ └── main.m ├── DragView.h ├── DragViewController_Phone.h ├── DKApplicationRegistration.h ├── DragView.m ├── Drag-Info.plist ├── DKDragDropServer.h ├── DragViewController_Phone.m ├── DKApplicationRegistration.m ├── DragViewController.m ├── Drag.xcodeproj │ └── project.pbxproj └── DKDragDropServer.m ├── Drop ├── build │ └── .gitignore ├── Drop_Prefix.pch ├── iPad │ ├── AppDelegate_Pad.h │ ├── DropViewController.h │ ├── AppDelegate_Pad.m │ ├── DropViewController.m │ ├── MainWindow_Pad.xib │ └── DropViewController.xib ├── iPhone │ ├── AppDelegate_Phone.h │ ├── AppDelegate_Phone.m │ └── MainWindow_Phone.xib ├── Shared │ └── main.m ├── Drop-Info.plist └── Drop.xcodeproj │ └── project.pbxproj ├── .gitignore └── LICENSE /README.markdown: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Drag/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /Drop/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /Drag/drag_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zac/dragkit/HEAD/Drag/drag_default.png -------------------------------------------------------------------------------- /Drag/drag_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zac/dragkit/HEAD/Drag/drag_overlay.png -------------------------------------------------------------------------------- /Drag/DrawerWithPattern.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zac/dragkit/HEAD/Drag/DrawerWithPattern.psd -------------------------------------------------------------------------------- /Drag/Drag_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Drag' target in the 'Drag' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Drop/Drop_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Drop' target in the 'Drop' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # xcode noise 2 | output/* 3 | *.pbxuser 4 | *.mode1v3 5 | 6 | # hm, what are these... :) 7 | project.xcworkspace/ 8 | xcuserdata/ 9 | 10 | # old skool 11 | .svn 12 | 13 | # osx noise 14 | .DS_Store 15 | profile 16 | -------------------------------------------------------------------------------- /Drag/DragViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DragViewController.h 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "DKDragDropServer.h" 12 | 13 | @interface DragViewController : UIViewController { 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Drag/iPad/AppDelegate_Pad.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Pad.h 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Zac White 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate_Pad : NSObject { 12 | UIWindow *window; 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /Drag/iPhone/AppDelegate_Phone.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Phone.h 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Zac White 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate_Phone : NSObject { 12 | UIWindow *window; 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /Drop/iPad/AppDelegate_Pad.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Pad.h 3 | // Drop 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Gravity Mobile 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate_Pad : NSObject { 12 | UIWindow *window; 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /Drop/iPhone/AppDelegate_Phone.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Phone.h 3 | // Drop 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Gravity Mobile 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate_Phone : NSObject { 12 | UIWindow *window; 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /Drag/Shared/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Zac White 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Drop/Shared/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Drop 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Gravity Mobile 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Drop/iPad/DropViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DropViewController.h 3 | // Drop 4 | // 5 | // Created by Zac White on 8/12/10. 6 | // Copyright 2010 Gravity Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DKDragDropServer.h" 11 | 12 | @interface DropViewController : UIViewController { 13 | IBOutlet UILabel *dropWell; 14 | } 15 | 16 | @property (nonatomic, retain) IBOutlet UILabel *dropWell; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Drag/DragView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DragView.h 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | //DragView 8 | 9 | #import 10 | 11 | @interface DragView : UIView { 12 | UIImageView *thumbnailView; 13 | UILabel *topLabel; 14 | UILabel *bottomLabel; 15 | } 16 | 17 | @property (nonatomic, retain) UIImageView *thumbnailView; 18 | @property (nonatomic, retain) UILabel *topLabel; 19 | @property (nonatomic, retain) UILabel *bottomLabel; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Drop/iPhone/AppDelegate_Phone.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Phone.m 3 | // Drop 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Gravity Mobile 2010. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate_Phone.h" 10 | 11 | @implementation AppDelegate_Phone 12 | 13 | @synthesize window; 14 | 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 17 | 18 | // Override point for customization after application launch 19 | 20 | [window makeKeyAndVisible]; 21 | 22 | return YES; 23 | } 24 | 25 | 26 | - (void)dealloc { 27 | [window release]; 28 | [super dealloc]; 29 | } 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Drag/DragViewController_Phone.h: -------------------------------------------------------------------------------- 1 | // 2 | // DragViewController.h 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "DKDragDropServer.h" 12 | 13 | @interface DragViewController_Phone : UIViewController { 14 | IBOutlet UILabel *top; 15 | IBOutlet UIView *drop; 16 | } 17 | 18 | @property (nonatomic, retain) UILabel *top; 19 | @property (nonatomic, retain) UIView *drop; 20 | 21 | - (IBAction)reset:(id)sender; 22 | - (IBAction)segmentChanged:(id)sender; 23 | - (IBAction)navBar:(id)sender; 24 | - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Drag/iPhone/AppDelegate_Phone.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Phone.m 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Zac White 2010. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate_Phone.h" 10 | 11 | #import "DragViewController_Phone.h" 12 | 13 | @implementation AppDelegate_Phone 14 | 15 | @synthesize window; 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | [window makeKeyAndVisible]; 21 | 22 | [[DKDragDropServer sharedServer] registerApplicationWithTypes:[NSArray arrayWithObject:@"public.text"]]; 23 | 24 | return YES; 25 | } 26 | 27 | 28 | - (void)dealloc { 29 | [window release]; 30 | [super dealloc]; 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Drop/iPad/AppDelegate_Pad.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Pad.m 3 | // Drop 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Gravity Mobile 2010. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate_Pad.h" 10 | 11 | #import "DropViewController.h" 12 | 13 | @implementation AppDelegate_Pad 14 | 15 | @synthesize window; 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | // Override point for customization after application launch 21 | 22 | DropViewController *dropViewController = [[DropViewController alloc] initWithNibName:@"DropViewController" bundle:nil]; 23 | [window addSubview:dropViewController.view]; 24 | 25 | [window makeKeyAndVisible]; 26 | 27 | [[DKDragDropServer sharedServer] registerApplicationWithTypes:[NSArray arrayWithObject:@"public.text"]]; 28 | 29 | return YES; 30 | } 31 | 32 | 33 | - (void)dealloc { 34 | [window release]; 35 | [super dealloc]; 36 | } 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Drag/iPad/AppDelegate_Pad.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate_Pad.m 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright Zac White 2010. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate_Pad.h" 10 | 11 | #import "DragViewController.h" 12 | 13 | @implementation AppDelegate_Pad 14 | 15 | @synthesize window; 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | // Override point for customization after application launch 21 | 22 | DragViewController *dragViewController = [[DragViewController alloc] initWithNibName:nil bundle:nil]; 23 | [window addSubview:dragViewController.view]; 24 | 25 | [window makeKeyAndVisible]; 26 | 27 | // must be done after the window is key. 28 | [[DKDragDropServer sharedServer] registerApplicationWithTypes:[NSArray arrayWithObject:@"public.text"]]; 29 | 30 | return YES; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [super dealloc]; 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Team Gravity 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Drag/DKApplicationRegistration.h: -------------------------------------------------------------------------------- 1 | // 2 | // DKApplicationRegistration.h 3 | // Drag 4 | // 5 | // Created by Zac White on 6/21/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface DKApplicationRegistration : NSObject { 13 | 14 | NSString *applicationName; 15 | NSString *applicationBundleIdentifier; 16 | 17 | // for iPhone 4. 18 | UIImage *icon114; 19 | // for iPad. 20 | UIImage *icon72; 21 | // for iPhone. 22 | UIImage *icon57; 23 | 24 | // version of framework used to register. 25 | NSString *frameworkVersion; 26 | 27 | //true if the icon is pre-rendered. 28 | BOOL iconPrerendered; 29 | 30 | //the url scheme to launch this app. 31 | NSString *urlScheme; 32 | 33 | //an array of supported drag types. 34 | NSArray *supportedDragTypes; 35 | } 36 | 37 | + (DKApplicationRegistration *)registrationWithDragTypes:(NSArray *)dragTypes; 38 | 39 | @property (nonatomic, copy) NSString *applicationName; 40 | @property (nonatomic, copy) NSString *applicationBundleIdentifier; 41 | 42 | @property (nonatomic, retain) UIImage *icon114; 43 | @property (nonatomic, retain) UIImage *icon72; 44 | @property (nonatomic, retain) UIImage *icon57; 45 | @property (nonatomic, copy) NSString *frameworkVersion; 46 | @property (nonatomic) BOOL iconPrerendered; 47 | @property (nonatomic, copy) NSString *urlScheme; 48 | @property (nonatomic, copy) NSArray *supportedDragTypes; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Drop/Drop-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.zacwhite.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow_Phone 29 | NSMainNibFile~ipad 30 | MainWindow_Pad 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Drag/DragView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DragView.m 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import "DragView.h" 10 | 11 | 12 | @implementation DragView 13 | 14 | @synthesize thumbnailView, topLabel, bottomLabel; 15 | 16 | - (id)initWithFrame:(CGRect)theFrame { 17 | if (!(self = [super initWithFrame:theFrame])) return nil; 18 | 19 | self.thumbnailView = [[[UIImageView alloc] initWithFrame:CGRectZero] autorelease]; 20 | self.topLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease]; 21 | self.bottomLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease]; 22 | 23 | self.backgroundColor = [UIColor redColor]; 24 | 25 | [self addSubview:self.thumbnailView]; 26 | [self addSubview:self.topLabel]; 27 | [self addSubview:self.bottomLabel]; 28 | 29 | return self; 30 | } 31 | 32 | #define MARGIN 10 33 | 34 | - (void)layoutSubviews { 35 | [super layoutSubviews]; 36 | 37 | int thumbnailWidth = self.frame.size.height - MARGIN * 2; 38 | 39 | self.thumbnailView.frame = CGRectMake(MARGIN, MARGIN, thumbnailWidth, thumbnailWidth); 40 | 41 | [self.topLabel sizeToFit]; 42 | self.topLabel.frame = CGRectMake(MARGIN + thumbnailWidth, MARGIN, MARGIN * 3 + (self.frame.size.width - thumbnailWidth), self.topLabel.frame.size.height); 43 | 44 | [self.bottomLabel sizeToFit]; 45 | self.bottomLabel.frame = CGRectMake(MARGIN + thumbnailWidth, CGRectGetMaxY(self.topLabel.frame), MARGIN * 3 + (self.frame.size.width - thumbnailWidth), self.bottomLabel.frame.size.height); 46 | } 47 | 48 | /* 49 | // Only override drawRect: if you perform custom drawing. 50 | // An empty implementation adversely affects performance during animation. 51 | - (void)drawRect:(CGRect)rect { 52 | // Drawing code 53 | } 54 | */ 55 | 56 | - (void)dealloc { 57 | 58 | self.thumbnailView = nil; 59 | self.topLabel = nil; 60 | self.bottomLabel = nil; 61 | 62 | [super dealloc]; 63 | } 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Drag/Drag-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleURLTypes 6 | 7 | 8 | CFBundleURLSchemes 9 | 10 | x-drag-com.zacwhite.${PRODUCT_NAME:rfc1034identifier} 11 | 12 | CFBundleURLName 13 | com.zacwhite.${PRODUCT_NAME:rfc1034identifier} 14 | 15 | 16 | CFBundleDevelopmentRegion 17 | English 18 | CFBundleDisplayName 19 | ${PRODUCT_NAME} 20 | CFBundleExecutable 21 | ${EXECUTABLE_NAME} 22 | CFBundleIconFile 23 | Icon.png 24 | CFBundleIconFiles 25 | 26 | Test.png 27 | Test2.png 28 | 29 | CFBundleIdentifier 30 | com.zacwhite.${PRODUCT_NAME:rfc1034identifier} 31 | CFBundleInfoDictionaryVersion 32 | 6.0 33 | CFBundleName 34 | ${PRODUCT_NAME} 35 | CFBundlePackageType 36 | APPL 37 | CFBundleSignature 38 | ???? 39 | CFBundleVersion 40 | 1.0 41 | LSRequiresIPhoneOS 42 | 43 | NSMainNibFile 44 | MainWindow_Phone 45 | NSMainNibFile~ipad 46 | MainWindow_Pad 47 | UISupportedInterfaceOrientations 48 | 49 | UIInterfaceOrientationPortrait 50 | 51 | UISupportedInterfaceOrientations~ipad 52 | 53 | UIInterfaceOrientationPortrait 54 | UIInterfaceOrientationPortraitUpsideDown 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Drop/iPad/DropViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DropViewController.m 3 | // Drop 4 | // 5 | // Created by Zac White on 8/12/10. 6 | // Copyright 2010 Gravity Mobile. All rights reserved. 7 | // 8 | 9 | #import "DropViewController.h" 10 | 11 | @implementation DropViewController 12 | 13 | @synthesize dropWell; 14 | 15 | - (void)viewDidLoad { 16 | [super viewDidLoad]; 17 | 18 | [[DKDragDropServer sharedServer] markViewAsDropTarget:self.dropWell 19 | forTypes:[NSArray arrayWithObject:@"public.text"] 20 | withDelegate:self]; 21 | } 22 | 23 | - (BOOL)targetView:(UIView *)targetView acceptsDropForType:(NSString *)type { 24 | NSLog(@"type: %@", type); 25 | return YES; 26 | } 27 | 28 | - (void)dragDidEnterTargetView:(UIView *)targetView { 29 | 30 | } 31 | 32 | - (void)dragDidLeaveTargetView:(UIView *)targetView { 33 | 34 | } 35 | 36 | - (void)drag:(NSString *)dropID completedOnTargetView:(UIView *)targetView withDragPasteboard:(UIPasteboard *)dragPasteboard context:(void *)context { 37 | // context is always nil on inter-app drags. 38 | 39 | NSData *dragData = [[dragPasteboard dataForPasteboardType:@"public.text" inItemSet:nil] lastObject]; 40 | 41 | self.dropWell.text = [[[NSString alloc] initWithData:dragData encoding:NSUTF8StringEncoding] autorelease]; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 45 | // Overriden to allow any orientation. 46 | return YES; 47 | } 48 | 49 | 50 | - (void)didReceiveMemoryWarning { 51 | // Releases the view if it doesn't have a superview. 52 | [super didReceiveMemoryWarning]; 53 | 54 | // Release any cached data, images, etc that aren't in use. 55 | } 56 | 57 | 58 | - (void)viewDidUnload { 59 | 60 | self.dropWell = nil; 61 | 62 | [super viewDidUnload]; 63 | // Release any retained subviews of the main view. 64 | // e.g. self.myOutlet = nil; 65 | } 66 | 67 | 68 | - (void)dealloc { 69 | 70 | self.dropWell = nil; 71 | 72 | [super dealloc]; 73 | } 74 | 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Drag/DKDragDropServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DKDragServer.h 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | @protocol DKDragDataProvider 14 | 15 | // request the data from the view. 16 | 17 | - (NSArray *)typesSupportedForDrag:(NSString *)dragID forView:(UIView *)dragView context:(void *)context; 18 | - (NSData *)dataForType:(NSString *)type withDrag:(NSString *)dragID forView:(UIView *)dragView context:(void *)context; 19 | 20 | @optional 21 | - (UIImage *)imageForDrag:(NSString *)dragID forView:(UIView *)dragView context:(void *)context; 22 | 23 | @end 24 | 25 | @protocol DKDragDelegate 26 | 27 | // if any of these return YES for the type, the server does its drop drawing. 28 | - (BOOL)targetView:(UIView *)targetView acceptsDropForType:(NSString *)type; 29 | - (void)dragDidEnterTargetView:(UIView *)targetView; 30 | - (void)dragDidLeaveTargetView:(UIView *)targetView; 31 | - (void)drag:(NSString *)dropID completedOnTargetView:(UIView *)targetView withDragPasteboard:(UIPasteboard *)dragPasteboard context:(void *)context; 32 | 33 | @end 34 | 35 | @class DKApplicationRegistration; 36 | 37 | extern NSString *const DKPasteboardNameDrag; 38 | 39 | @interface DKDragDropServer : NSObject { 40 | UIView *draggedView; 41 | UIView *originalView; 42 | 43 | @private 44 | 45 | // UI for the holding area. 46 | UIView *dk_holdingArea; 47 | UILabel *dk_holdingAreaLabel; 48 | 49 | NSArray *dk_currentDragTypes; 50 | 51 | // the drop targets dictionary with associated data. 52 | NSMutableDictionary *dk_dropTargetsDictionary; 53 | 54 | // the pointer to the main app window. 55 | UIWindow *dk_mainAppWindow; 56 | 57 | // the manifest of all apps on the system that support DragKit. 58 | NSMutableArray *dk_manifest; 59 | 60 | // the resolved supported applications. 61 | NSMutableArray *dk_supportedApplications; 62 | 63 | // the application registrations. 64 | DKApplicationRegistration *dk_applicationRegistration; 65 | 66 | // arrays that store the targets and delegates. 67 | NSMutableArray *dk_dropTargets; 68 | 69 | // point to determine how much it has moved 70 | CGPoint lastPoint; 71 | CGPoint pausedPoint; 72 | 73 | // time at point 74 | NSTimer *pausedTimer; 75 | 76 | BOOL inOnePlace; 77 | 78 | UIView *springboard; 79 | 80 | CALayer *theLayer; 81 | 82 | UIImage *background; 83 | } 84 | 85 | + (id)sharedServer; 86 | + (NSString *)versionString; 87 | 88 | // application registration. 89 | - (void)registerApplicationWithTypes:(NSArray *)types; 90 | - (NSArray *)registeredApplications; 91 | 92 | - (void)cancelDrag; 93 | 94 | @property (nonatomic, retain) UIView *draggedView; 95 | @property (nonatomic, retain) UIView *originalView; 96 | @property (nonatomic, retain) NSTimer *pausedTimer; 97 | 98 | - (void)resetRegistrationDatabase; 99 | 100 | // the API for marking a view as draggable or a drop target. 101 | - (void)markViewAsDraggable:(UIView *)draggableView forDrag:(NSString *)dragID withDataSource:(NSObject *)dragDataSource context:(void *)context; 102 | - (void)markViewAsDropTarget:(UIView *)dropView forTypes:(NSArray *)types withDelegate:(NSObject *)dropDelegate; 103 | 104 | // unmarking views 105 | - (void)unmarkViewAsDraggable:(UIView *)draggableView; 106 | - (void)unmarkDropTarget:(UIView *)dropView; 107 | 108 | 109 | - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag; 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /Drag/DragViewController_Phone.m: -------------------------------------------------------------------------------- 1 | // 2 | // DragViewController.m 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import "DragViewController_Phone.h" 10 | 11 | #import "DragView.h" 12 | 13 | @implementation DragViewController_Phone 14 | 15 | @synthesize top, drop; 16 | 17 | 18 | /* 19 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 20 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 21 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 22 | // Custom initialization 23 | } 24 | return self; 25 | } 26 | */ 27 | 28 | #pragma mark - 29 | #pragma mark DKDragDataProvider Methods 30 | 31 | - (NSArray *)typesSupportedForDrag:(NSString *)dragID forView:(UIView *)dragView context:(void *)context { 32 | return [NSArray arrayWithObject:@"public.text"]; 33 | } 34 | 35 | //request the data from the view. 36 | - (NSData *)dataForType:(NSString *)type withDrag:(NSString *)dragID forView:(UIView *)dragView context:(void *)context { 37 | 38 | if ([type isEqualToString:@"public.text"]) { 39 | return [@"Testing 1,2,3" dataUsingEncoding:NSUTF8StringEncoding]; 40 | } 41 | 42 | return nil; 43 | } 44 | 45 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 46 | - (void)viewDidLoad { 47 | [super viewDidLoad]; 48 | 49 | NSLog(@"frame: %@", NSStringFromCGRect(self.view.frame)); 50 | 51 | [[DKDragDropServer sharedServer] markViewAsDraggable:self.top forDrag:@"MainDrag" withDataSource:self context:nil]; 52 | 53 | [[DKDragDropServer sharedServer] markViewAsDropTarget:self.drop forTypes:[NSArray arrayWithObject:@"public.text"] withDelegate:self]; 54 | } 55 | 56 | - (void)reset:(id)sender { 57 | NSLog(@"RESET."); 58 | [[DKDragDropServer sharedServer] resetRegistrationDatabase]; 59 | [sender setBackgroundColor:[UIColor redColor]]; 60 | 61 | } 62 | 63 | - (IBAction)segmentChanged:(id)sender { 64 | NSLog(@"Segment Changed: %d", [sender selectedSegmentIndex]); 65 | } 66 | 67 | - (IBAction)navBar:(id)sender { 68 | NSLog(@"navBar button clicked"); 69 | } 70 | 71 | - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item { 72 | NSLog(@"tabBar item %@ selected", item.title); 73 | } 74 | 75 | - (BOOL)targetView:(UIView *)targetView acceptsDropForType:(NSString *)type { 76 | return YES; 77 | } 78 | 79 | - (void)dragDidEnterTargetView:(UIView *)targetView { 80 | 81 | } 82 | 83 | - (void)dragDidLeaveTargetView:(UIView *)targetView { 84 | 85 | } 86 | 87 | - (void)drag:(NSString *)dropID completedOnTargetView:(UIView *)targetView withDragPasteboard:(UIPasteboard *)dragPasteboard context:(void *)context { 88 | NSLog(@"drag: %@ completedOnTargetView:%@ dragPasteboard:%@ context:%p", dropID, targetView, dragPasteboard, context); 89 | 90 | NSString *text = [[NSString alloc] initWithData:[[dragPasteboard valuesForPasteboardType:@"public.text" inItemSet:nil] lastObject] 91 | encoding:NSUTF8StringEncoding]; 92 | NSLog(@"data: %@", text); 93 | } 94 | 95 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 96 | // Overriden to allow any orientation. 97 | return YES; 98 | } 99 | 100 | 101 | - (void)didReceiveMemoryWarning { 102 | // Releases the view if it doesn't have a superview. 103 | [super didReceiveMemoryWarning]; 104 | 105 | // Release any cached data, images, etc that aren't in use. 106 | } 107 | 108 | 109 | - (void)viewDidUnload { 110 | [super viewDidUnload]; 111 | // Release any retained subviews of the main view. 112 | // e.g. self.myOutlet = nil; 113 | } 114 | 115 | 116 | - (void)dealloc { 117 | [super dealloc]; 118 | 119 | self.top = nil; 120 | self.drop = nil; 121 | } 122 | 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /Drag/DKApplicationRegistration.m: -------------------------------------------------------------------------------- 1 | // 2 | // DKApplicationRegistration.m 3 | // Drag 4 | // 5 | // Created by Zac White on 6/21/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import "DKApplicationRegistration.h" 10 | 11 | #import "DKDragDropServer.h" 12 | 13 | @implementation DKApplicationRegistration 14 | 15 | @synthesize applicationName, applicationBundleIdentifier; 16 | @synthesize icon114, icon72, icon57, iconPrerendered; 17 | @synthesize frameworkVersion; 18 | @synthesize urlScheme, supportedDragTypes; 19 | 20 | + (DKApplicationRegistration *)registrationWithDragTypes:(NSArray *)dragTypes { 21 | 22 | DKApplicationRegistration *appRegistration = [[DKApplicationRegistration alloc] init]; 23 | 24 | NSMutableSet *iconNames = [[NSMutableSet alloc] init]; 25 | 26 | NSArray *allIcons = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFiles"]; 27 | if ([allIcons count]) [iconNames addObjectsFromArray:allIcons]; 28 | 29 | NSString *mainIcon = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFile"]; 30 | 31 | if (mainIcon) [iconNames addObject:mainIcon]; 32 | 33 | for (NSString *iconPath in iconNames) { 34 | //read each icon in and determine the size. 35 | NSString *fullPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:iconPath]; 36 | NSLog(@"full: %@", fullPath); 37 | } 38 | 39 | appRegistration.applicationName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; 40 | appRegistration.applicationBundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; 41 | 42 | appRegistration.iconPrerendered = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIPrerenderedIcon"] boolValue]; 43 | appRegistration.frameworkVersion = [DKDragDropServer versionString]; 44 | appRegistration.supportedDragTypes = dragTypes; 45 | 46 | appRegistration.urlScheme = [NSString stringWithFormat:@"x-drag-%@", [[NSBundle mainBundle] bundleIdentifier]]; 47 | 48 | return [appRegistration autorelease]; 49 | } 50 | 51 | #pragma mark NSCoding 52 | 53 | - (id)initWithCoder:(NSCoder*)coder { 54 | if (!(self = [super init])) return nil; 55 | 56 | self.applicationName = [coder decodeObjectForKey:@"applicationName"]; 57 | self.applicationBundleIdentifier = [coder decodeObjectForKey:@"applicationBundleIdentifier"]; 58 | 59 | self.icon114 = [coder decodeObjectForKey:@"icon114"]; 60 | self.icon72 = [coder decodeObjectForKey:@"icon72"]; 61 | self.icon57 = [coder decodeObjectForKey:@"icon57"]; 62 | 63 | self.iconPrerendered = [[coder decodeObjectForKey:@"iconPrerendered"] boolValue]; 64 | self.frameworkVersion = [coder decodeObjectForKey:@"frameworkVersion"]; 65 | self.supportedDragTypes = [coder decodeObjectForKey:@"supportedDragTypes"]; 66 | self.urlScheme = [coder decodeObjectForKey:@"urlScheme"]; 67 | 68 | return self; 69 | } 70 | 71 | - (void)encodeWithCoder:(NSCoder*)coder { 72 | 73 | [coder encodeObject:self.applicationName forKey:@"applicationName"]; 74 | [coder encodeObject:self.applicationBundleIdentifier forKey:@"applicationBundleIdentifier"]; 75 | 76 | [coder encodeObject:UIImagePNGRepresentation(self.icon114) forKey:@"icon114"]; 77 | [coder encodeObject:UIImagePNGRepresentation(self.icon72) forKey:@"icon72"]; 78 | [coder encodeObject:UIImagePNGRepresentation(self.icon57) forKey:@"icon57"]; 79 | 80 | [coder encodeObject:[NSNumber numberWithBool:self.iconPrerendered] forKey:@"iconPrerendered"]; 81 | [coder encodeObject:self.frameworkVersion forKey:@"frameworkVersion"]; 82 | [coder encodeObject:self.supportedDragTypes forKey:@"supportedDragTypes"]; 83 | [coder encodeObject:self.urlScheme forKey:@"urlScheme"]; 84 | } 85 | 86 | - (NSString *)description { 87 | return [NSString stringWithFormat:@"%@: %@ (%@)", [super description], self.applicationName, self.applicationBundleIdentifier]; 88 | } 89 | 90 | - (void)dealloc { 91 | 92 | self.applicationName = nil; 93 | self.applicationBundleIdentifier = nil; 94 | 95 | self.icon114 = nil; 96 | self.icon72 = nil; 97 | self.icon57 = nil; 98 | 99 | self.frameworkVersion = nil; 100 | 101 | self.supportedDragTypes = nil; 102 | 103 | self.urlScheme = nil; 104 | 105 | [super dealloc]; 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /Drag/DragViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DragViewController.m 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | 9 | #import "DragViewController.h" 10 | 11 | #import "DragView.h" 12 | 13 | @implementation DragViewController 14 | 15 | /* 16 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 18 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 19 | // Custom initialization 20 | } 21 | return self; 22 | } 23 | */ 24 | 25 | #pragma mark - 26 | #pragma mark DKDragDataProvider Methods 27 | 28 | - (NSArray *)typesSupportedForDrag:(NSString *)dragID forView:(UIView *)dragView context:(void *)context { 29 | return [NSArray arrayWithObject:@"public.text"]; 30 | } 31 | 32 | //request the data from the view. 33 | - (NSData *)dataForType:(NSString *)type withDrag:(NSString *)dragID forView:(UIView *)dragView context:(void *)context { 34 | 35 | if ([type isEqualToString:@"public.text"]) { 36 | return [@"Testing 1,2,3" dataUsingEncoding:NSUTF8StringEncoding]; 37 | } 38 | 39 | return nil; 40 | } 41 | 42 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 43 | - (void)viewDidLoad { 44 | [super viewDidLoad]; 45 | 46 | NSLog(@"frame: %@", NSStringFromCGRect(self.view.frame)); 47 | 48 | DragView *dragView = [[DragView alloc] initWithFrame:CGRectMake(100, 100, 400, 100)]; 49 | dragView.topLabel.text = @"Testing!!"; 50 | dragView.bottomLabel.text = @"1.2.3."; 51 | 52 | [[DKDragDropServer sharedServer] markViewAsDraggable:dragView forDrag:@"MainDrag" withDataSource:self context:nil]; 53 | 54 | [self.view addSubview:dragView]; 55 | NSLog(@"dragFrame: %@", NSStringFromCGRect(dragView.frame)); 56 | [dragView release]; 57 | 58 | 59 | UIView *otherView = [[UIView alloc] initWithFrame:CGRectMake(100, 500, 400, 100)]; 60 | otherView.backgroundColor = [UIColor yellowColor]; 61 | 62 | [[DKDragDropServer sharedServer] markViewAsDropTarget:otherView forTypes:[NSArray arrayWithObject:@"public.text"] withDelegate:self]; 63 | 64 | [self.view addSubview:otherView]; 65 | NSLog(@"otherFrame: %@", NSStringFromCGRect(otherView.frame)); 66 | [otherView release]; 67 | 68 | UIButton *resetButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 69 | [resetButton setTitle:@"Reset" forState:UIControlStateNormal]; 70 | [resetButton addTarget:self action:@selector(reset:) forControlEvents:UIControlEventTouchUpInside]; 71 | resetButton.frame = CGRectMake(100, 700, 100, 70); 72 | 73 | [self.view addSubview:resetButton]; 74 | } 75 | 76 | - (void)reset:(id)sender { 77 | [[DKDragDropServer sharedServer] resetRegistrationDatabase]; 78 | } 79 | 80 | - (BOOL)targetView:(UIView *)targetView acceptsDropForType:(NSString *)type { 81 | return YES; 82 | } 83 | 84 | - (void)dragDidEnterTargetView:(UIView *)targetView { 85 | 86 | } 87 | 88 | - (void)dragDidLeaveTargetView:(UIView *)targetView { 89 | 90 | } 91 | 92 | - (void)drag:(NSString *)dropID completedOnTargetView:(UIView *)targetView withDragPasteboard:(UIPasteboard *)dragPasteboard context:(void *)context { 93 | NSLog(@"drag: %@ completedOnTargetView:%@ dragPasteboard:%@ context:%p", dropID, targetView, dragPasteboard, context); 94 | 95 | NSString *text = [[NSString alloc] initWithData:[[dragPasteboard valuesForPasteboardType:@"public.text" inItemSet:nil] lastObject] 96 | encoding:NSUTF8StringEncoding]; 97 | NSLog(@"data: %@", text); 98 | } 99 | 100 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 101 | // Overriden to allow any orientation. 102 | return YES; 103 | } 104 | 105 | 106 | - (void)didReceiveMemoryWarning { 107 | // Releases the view if it doesn't have a superview. 108 | [super didReceiveMemoryWarning]; 109 | 110 | // Release any cached data, images, etc that aren't in use. 111 | } 112 | 113 | 114 | - (void)viewDidUnload { 115 | [super viewDidUnload]; 116 | // Release any retained subviews of the main view. 117 | // e.g. self.myOutlet = nil; 118 | } 119 | 120 | 121 | - (void)dealloc { 122 | [super dealloc]; 123 | } 124 | 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /Drag/iPad/MainWindow_Pad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 800 5 | 10D541 6 | 760 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 81 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | 41 | 292 42 | {768, 1024} 43 | 44 | 1 45 | MSAxIDEAA 46 | 47 | NO 48 | NO 49 | 50 | 2 51 | 52 | IBIPadFramework 53 | YES 54 | 55 | 56 | IBIPadFramework 57 | 58 | 59 | 60 | 61 | YES 62 | 63 | 64 | window 65 | 66 | 67 | 68 | 7 69 | 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 8 77 | 78 | 79 | 80 | 81 | YES 82 | 83 | 0 84 | 85 | 86 | 87 | 88 | 89 | -1 90 | 91 | 92 | File's Owner 93 | 94 | 95 | -2 96 | 97 | 98 | 99 | 100 | 2 101 | 102 | 103 | YES 104 | 105 | 106 | 107 | 108 | 6 109 | 110 | 111 | 112 | 113 | 114 | 115 | YES 116 | 117 | YES 118 | -1.CustomClassName 119 | -2.CustomClassName 120 | 2.IBEditorWindowLastContentRect 121 | 2.IBPluginDependency 122 | 6.CustomClassName 123 | 6.IBPluginDependency 124 | 125 | 126 | YES 127 | UIApplication 128 | UIResponder 129 | {{903, 55}, {768, 1024}} 130 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 131 | AppDelegate_Pad 132 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 133 | 134 | 135 | 136 | YES 137 | 138 | 139 | YES 140 | 141 | 142 | 143 | 144 | YES 145 | 146 | 147 | YES 148 | 149 | 150 | 151 | 9 152 | 153 | 154 | 155 | YES 156 | 157 | AppDelegate_Pad 158 | NSObject 159 | 160 | window 161 | UIWindow 162 | 163 | 164 | IBUserSource 165 | 166 | 167 | 168 | 169 | 170 | YES 171 | 172 | NSObject 173 | 174 | IBFrameworkSource 175 | Foundation.framework/Headers/NSError.h 176 | 177 | 178 | 179 | NSObject 180 | 181 | IBFrameworkSource 182 | Foundation.framework/Headers/NSFileManager.h 183 | 184 | 185 | 186 | NSObject 187 | 188 | IBFrameworkSource 189 | Foundation.framework/Headers/NSKeyValueCoding.h 190 | 191 | 192 | 193 | NSObject 194 | 195 | IBFrameworkSource 196 | Foundation.framework/Headers/NSKeyValueObserving.h 197 | 198 | 199 | 200 | NSObject 201 | 202 | IBFrameworkSource 203 | Foundation.framework/Headers/NSKeyedArchiver.h 204 | 205 | 206 | 207 | NSObject 208 | 209 | IBFrameworkSource 210 | Foundation.framework/Headers/NSNetServices.h 211 | 212 | 213 | 214 | NSObject 215 | 216 | IBFrameworkSource 217 | Foundation.framework/Headers/NSObject.h 218 | 219 | 220 | 221 | NSObject 222 | 223 | IBFrameworkSource 224 | Foundation.framework/Headers/NSPort.h 225 | 226 | 227 | 228 | NSObject 229 | 230 | IBFrameworkSource 231 | Foundation.framework/Headers/NSRunLoop.h 232 | 233 | 234 | 235 | NSObject 236 | 237 | IBFrameworkSource 238 | Foundation.framework/Headers/NSStream.h 239 | 240 | 241 | 242 | NSObject 243 | 244 | IBFrameworkSource 245 | Foundation.framework/Headers/NSThread.h 246 | 247 | 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSURL.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSURLConnection.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSXMLParser.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | UIKit.framework/Headers/UIAccessibility.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | UIKit.framework/Headers/UINibLoading.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | UIKit.framework/Headers/UIResponder.h 288 | 289 | 290 | 291 | UIApplication 292 | UIResponder 293 | 294 | IBFrameworkSource 295 | UIKit.framework/Headers/UIApplication.h 296 | 297 | 298 | 299 | UIResponder 300 | NSObject 301 | 302 | 303 | 304 | UIView 305 | 306 | IBFrameworkSource 307 | UIKit.framework/Headers/UITextField.h 308 | 309 | 310 | 311 | UIView 312 | UIResponder 313 | 314 | IBFrameworkSource 315 | UIKit.framework/Headers/UIView.h 316 | 317 | 318 | 319 | UIWindow 320 | UIView 321 | 322 | IBFrameworkSource 323 | UIKit.framework/Headers/UIWindow.h 324 | 325 | 326 | 327 | 328 | 0 329 | IBIPadFramework 330 | 331 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 332 | 333 | 334 | 335 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 336 | 337 | 338 | YES 339 | ../Drag.xcodeproj 340 | 3 341 | 81 342 | 343 | 344 | -------------------------------------------------------------------------------- /Drop/iPad/MainWindow_Pad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 800 5 | 10D541 6 | 760 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 81 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | 41 | 292 42 | {768, 1024} 43 | 44 | 1 45 | MSAxIDEAA 46 | 47 | NO 48 | NO 49 | 50 | 2 51 | 52 | IBIPadFramework 53 | YES 54 | 55 | 56 | IBIPadFramework 57 | 58 | 59 | 60 | 61 | YES 62 | 63 | 64 | window 65 | 66 | 67 | 68 | 7 69 | 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 8 77 | 78 | 79 | 80 | 81 | YES 82 | 83 | 0 84 | 85 | 86 | 87 | 88 | 89 | -1 90 | 91 | 92 | File's Owner 93 | 94 | 95 | -2 96 | 97 | 98 | 99 | 100 | 2 101 | 102 | 103 | YES 104 | 105 | 106 | 107 | 108 | 6 109 | 110 | 111 | 112 | 113 | 114 | 115 | YES 116 | 117 | YES 118 | -1.CustomClassName 119 | -2.CustomClassName 120 | 2.IBEditorWindowLastContentRect 121 | 2.IBPluginDependency 122 | 6.CustomClassName 123 | 6.IBPluginDependency 124 | 125 | 126 | YES 127 | UIApplication 128 | UIResponder 129 | {{903, 55}, {768, 1024}} 130 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 131 | AppDelegate_Pad 132 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 133 | 134 | 135 | 136 | YES 137 | 138 | 139 | YES 140 | 141 | 142 | 143 | 144 | YES 145 | 146 | 147 | YES 148 | 149 | 150 | 151 | 9 152 | 153 | 154 | 155 | YES 156 | 157 | AppDelegate_Pad 158 | NSObject 159 | 160 | window 161 | UIWindow 162 | 163 | 164 | IBUserSource 165 | 166 | 167 | 168 | 169 | 170 | YES 171 | 172 | NSObject 173 | 174 | IBFrameworkSource 175 | Foundation.framework/Headers/NSError.h 176 | 177 | 178 | 179 | NSObject 180 | 181 | IBFrameworkSource 182 | Foundation.framework/Headers/NSFileManager.h 183 | 184 | 185 | 186 | NSObject 187 | 188 | IBFrameworkSource 189 | Foundation.framework/Headers/NSKeyValueCoding.h 190 | 191 | 192 | 193 | NSObject 194 | 195 | IBFrameworkSource 196 | Foundation.framework/Headers/NSKeyValueObserving.h 197 | 198 | 199 | 200 | NSObject 201 | 202 | IBFrameworkSource 203 | Foundation.framework/Headers/NSKeyedArchiver.h 204 | 205 | 206 | 207 | NSObject 208 | 209 | IBFrameworkSource 210 | Foundation.framework/Headers/NSNetServices.h 211 | 212 | 213 | 214 | NSObject 215 | 216 | IBFrameworkSource 217 | Foundation.framework/Headers/NSObject.h 218 | 219 | 220 | 221 | NSObject 222 | 223 | IBFrameworkSource 224 | Foundation.framework/Headers/NSPort.h 225 | 226 | 227 | 228 | NSObject 229 | 230 | IBFrameworkSource 231 | Foundation.framework/Headers/NSRunLoop.h 232 | 233 | 234 | 235 | NSObject 236 | 237 | IBFrameworkSource 238 | Foundation.framework/Headers/NSStream.h 239 | 240 | 241 | 242 | NSObject 243 | 244 | IBFrameworkSource 245 | Foundation.framework/Headers/NSThread.h 246 | 247 | 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSURL.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSURLConnection.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSXMLParser.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | UIKit.framework/Headers/UIAccessibility.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | UIKit.framework/Headers/UINibLoading.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | UIKit.framework/Headers/UIResponder.h 288 | 289 | 290 | 291 | UIApplication 292 | UIResponder 293 | 294 | IBFrameworkSource 295 | UIKit.framework/Headers/UIApplication.h 296 | 297 | 298 | 299 | UIResponder 300 | NSObject 301 | 302 | 303 | 304 | UIView 305 | 306 | IBFrameworkSource 307 | UIKit.framework/Headers/UITextField.h 308 | 309 | 310 | 311 | UIView 312 | UIResponder 313 | 314 | IBFrameworkSource 315 | UIKit.framework/Headers/UIView.h 316 | 317 | 318 | 319 | UIWindow 320 | UIView 321 | 322 | IBFrameworkSource 323 | UIKit.framework/Headers/UIWindow.h 324 | 325 | 326 | 327 | 328 | 0 329 | IBIPadFramework 330 | 331 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 332 | 333 | 334 | 335 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 336 | 337 | 338 | YES 339 | ../Drop.xcodeproj 340 | 3 341 | 81 342 | 343 | 344 | -------------------------------------------------------------------------------- /Drop/Drop.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 112285501214E9D7007165D3 /* DKApplicationRegistration.m in Sources */ = {isa = PBXBuildFile; fileRef = 112285411214E9D7007165D3 /* DKApplicationRegistration.m */; }; 11 | 112285511214E9D7007165D3 /* DKDragDropServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 112285431214E9D7007165D3 /* DKDragDropServer.m */; }; 12 | 1122857F1214E9F9007165D3 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1122857E1214E9F9007165D3 /* QuartzCore.framework */; }; 13 | 112285881214EA1E007165D3 /* DropViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 112285861214EA1E007165D3 /* DropViewController.m */; }; 14 | 112285891214EA1E007165D3 /* DropViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 112285871214EA1E007165D3 /* DropViewController.xib */; }; 15 | 113F299E121F84220073645E /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 113F299D121F84220073645E /* MobileCoreServices.framework */; }; 16 | 1144A15D1220DDB600FDEAE6 /* drag_default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1144A15B1220DDB600FDEAE6 /* drag_default.png */; }; 17 | 1144A15E1220DDB600FDEAE6 /* drag_overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 1144A15C1220DDB600FDEAE6 /* drag_overlay.png */; }; 18 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 19 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 20 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 21 | 2860E328111B887F00E27156 /* AppDelegate_Phone.m in Sources */ = {isa = PBXBuildFile; fileRef = 2860E326111B887F00E27156 /* AppDelegate_Phone.m */; }; 22 | 2860E329111B887F00E27156 /* MainWindow_Phone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860E327111B887F00E27156 /* MainWindow_Phone.xib */; }; 23 | 2860E32E111B888700E27156 /* AppDelegate_Pad.m in Sources */ = {isa = PBXBuildFile; fileRef = 2860E32C111B888700E27156 /* AppDelegate_Pad.m */; }; 24 | 2860E32F111B888700E27156 /* MainWindow_Pad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860E32D111B888700E27156 /* MainWindow_Pad.xib */; }; 25 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 112285401214E9D7007165D3 /* DKApplicationRegistration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DKApplicationRegistration.h; path = ../Drag/DKApplicationRegistration.h; sourceTree = SOURCE_ROOT; }; 30 | 112285411214E9D7007165D3 /* DKApplicationRegistration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DKApplicationRegistration.m; path = ../Drag/DKApplicationRegistration.m; sourceTree = SOURCE_ROOT; }; 31 | 112285421214E9D7007165D3 /* DKDragDropServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DKDragDropServer.h; path = ../Drag/DKDragDropServer.h; sourceTree = SOURCE_ROOT; }; 32 | 112285431214E9D7007165D3 /* DKDragDropServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DKDragDropServer.m; path = ../Drag/DKDragDropServer.m; sourceTree = SOURCE_ROOT; }; 33 | 1122857E1214E9F9007165D3 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 34 | 112285851214EA1E007165D3 /* DropViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DropViewController.h; sourceTree = ""; }; 35 | 112285861214EA1E007165D3 /* DropViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DropViewController.m; sourceTree = ""; }; 36 | 112285871214EA1E007165D3 /* DropViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DropViewController.xib; sourceTree = ""; }; 37 | 113F299D121F84220073645E /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 38 | 1144A15B1220DDB600FDEAE6 /* drag_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = drag_default.png; path = ../Drag/drag_default.png; sourceTree = SOURCE_ROOT; }; 39 | 1144A15C1220DDB600FDEAE6 /* drag_overlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = drag_overlay.png; path = ../Drag/drag_overlay.png; sourceTree = SOURCE_ROOT; }; 40 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 1D6058910D05DD3D006BFB54 /* Drop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Drop.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 2860E325111B887F00E27156 /* AppDelegate_Phone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate_Phone.h; sourceTree = ""; }; 44 | 2860E326111B887F00E27156 /* AppDelegate_Phone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate_Phone.m; sourceTree = ""; }; 45 | 2860E327111B887F00E27156 /* MainWindow_Phone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_Phone.xib; sourceTree = ""; }; 46 | 2860E32B111B888700E27156 /* AppDelegate_Pad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate_Pad.h; sourceTree = ""; }; 47 | 2860E32C111B888700E27156 /* AppDelegate_Pad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate_Pad.m; sourceTree = ""; }; 48 | 2860E32D111B888700E27156 /* MainWindow_Pad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_Pad.xib; sourceTree = ""; }; 49 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 50 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Shared/main.m; sourceTree = ""; }; 51 | 32CA4F630368D1EE00C91783 /* Drop_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Drop_Prefix.pch; sourceTree = ""; }; 52 | 8D1107310486CEB800E47090 /* Drop-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Drop-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 61 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 62 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */, 63 | 1122857F1214E9F9007165D3 /* QuartzCore.framework in Frameworks */, 64 | 113F299E121F84220073645E /* MobileCoreServices.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 1122853F1214E9D1007165D3 /* DragKit */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 112285421214E9D7007165D3 /* DKDragDropServer.h */, 75 | 112285431214E9D7007165D3 /* DKDragDropServer.m */, 76 | 112285401214E9D7007165D3 /* DKApplicationRegistration.h */, 77 | 112285411214E9D7007165D3 /* DKApplicationRegistration.m */, 78 | 1144A15B1220DDB600FDEAE6 /* drag_default.png */, 79 | 1144A15C1220DDB600FDEAE6 /* drag_overlay.png */, 80 | ); 81 | name = DragKit; 82 | sourceTree = ""; 83 | }; 84 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 1D6058910D05DD3D006BFB54 /* Drop.app */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | 2860E324111B887F00E27156 /* iPhone */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 2860E325111B887F00E27156 /* AppDelegate_Phone.h */, 96 | 2860E326111B887F00E27156 /* AppDelegate_Phone.m */, 97 | 2860E327111B887F00E27156 /* MainWindow_Phone.xib */, 98 | ); 99 | path = iPhone; 100 | sourceTree = ""; 101 | }; 102 | 2860E32A111B888700E27156 /* iPad */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 2860E32B111B888700E27156 /* AppDelegate_Pad.h */, 106 | 2860E32C111B888700E27156 /* AppDelegate_Pad.m */, 107 | 2860E32D111B888700E27156 /* MainWindow_Pad.xib */, 108 | 112285851214EA1E007165D3 /* DropViewController.h */, 109 | 112285861214EA1E007165D3 /* DropViewController.m */, 110 | 112285871214EA1E007165D3 /* DropViewController.xib */, 111 | ); 112 | path = iPad; 113 | sourceTree = ""; 114 | }; 115 | 28EEBF621118D79A00187D67 /* Shared */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 1122853F1214E9D1007165D3 /* DragKit */, 119 | 8D1107310486CEB800E47090 /* Drop-Info.plist */, 120 | ); 121 | name = Shared; 122 | sourceTree = ""; 123 | }; 124 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 2860E32A111B888700E27156 /* iPad */, 128 | 2860E324111B887F00E27156 /* iPhone */, 129 | 28EEBF621118D79A00187D67 /* Shared */, 130 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 131 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 132 | 19C28FACFE9D520D11CA2CBB /* Products */, 133 | ); 134 | name = CustomTemplate; 135 | sourceTree = ""; 136 | }; 137 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 32CA4F630368D1EE00C91783 /* Drop_Prefix.pch */, 141 | 29B97316FDCFA39411CA2CEA /* main.m */, 142 | ); 143 | name = "Other Sources"; 144 | sourceTree = ""; 145 | }; 146 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 150 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 151 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */, 152 | 1122857E1214E9F9007165D3 /* QuartzCore.framework */, 153 | 113F299D121F84220073645E /* MobileCoreServices.framework */, 154 | ); 155 | name = Frameworks; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | 1D6058900D05DD3D006BFB54 /* Drop */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Drop" */; 164 | buildPhases = ( 165 | 1D60588D0D05DD3D006BFB54 /* Resources */, 166 | 1D60588E0D05DD3D006BFB54 /* Sources */, 167 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = Drop; 174 | productName = Drop; 175 | productReference = 1D6058910D05DD3D006BFB54 /* Drop.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | /* End PBXNativeTarget section */ 179 | 180 | /* Begin PBXProject section */ 181 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 182 | isa = PBXProject; 183 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Drop" */; 184 | compatibilityVersion = "Xcode 3.1"; 185 | hasScannedForEncodings = 1; 186 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 187 | projectDirPath = ""; 188 | projectRoot = ""; 189 | targets = ( 190 | 1D6058900D05DD3D006BFB54 /* Drop */, 191 | ); 192 | }; 193 | /* End PBXProject section */ 194 | 195 | /* Begin PBXResourcesBuildPhase section */ 196 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 197 | isa = PBXResourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | 2860E329111B887F00E27156 /* MainWindow_Phone.xib in Resources */, 201 | 2860E32F111B888700E27156 /* MainWindow_Pad.xib in Resources */, 202 | 112285891214EA1E007165D3 /* DropViewController.xib in Resources */, 203 | 1144A15D1220DDB600FDEAE6 /* drag_default.png in Resources */, 204 | 1144A15E1220DDB600FDEAE6 /* drag_overlay.png in Resources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | /* End PBXResourcesBuildPhase section */ 209 | 210 | /* Begin PBXSourcesBuildPhase section */ 211 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 212 | isa = PBXSourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 216 | 2860E328111B887F00E27156 /* AppDelegate_Phone.m in Sources */, 217 | 2860E32E111B888700E27156 /* AppDelegate_Pad.m in Sources */, 218 | 112285501214E9D7007165D3 /* DKApplicationRegistration.m in Sources */, 219 | 112285511214E9D7007165D3 /* DKDragDropServer.m in Sources */, 220 | 112285881214EA1E007165D3 /* DropViewController.m in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXSourcesBuildPhase section */ 225 | 226 | /* Begin XCBuildConfiguration section */ 227 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 228 | isa = XCBuildConfiguration; 229 | buildSettings = { 230 | ALWAYS_SEARCH_USER_PATHS = NO; 231 | COPY_PHASE_STRIP = NO; 232 | GCC_DYNAMIC_NO_PIC = NO; 233 | GCC_OPTIMIZATION_LEVEL = 0; 234 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 235 | GCC_PREFIX_HEADER = Drop_Prefix.pch; 236 | INFOPLIST_FILE = "Drop-Info.plist"; 237 | PRODUCT_NAME = Drop; 238 | }; 239 | name = Debug; 240 | }; 241 | 1D6058950D05DD3E006BFB54 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | COPY_PHASE_STRIP = YES; 246 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 247 | GCC_PREFIX_HEADER = Drop_Prefix.pch; 248 | INFOPLIST_FILE = "Drop-Info.plist"; 249 | PRODUCT_NAME = Drop; 250 | VALIDATE_PRODUCT = YES; 251 | }; 252 | name = Release; 253 | }; 254 | C01FCF4F08A954540054247B /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; 258 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 259 | GCC_C_LANGUAGE_STANDARD = c99; 260 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 261 | GCC_WARN_UNUSED_VARIABLE = YES; 262 | IPHONEOS_DEPLOYMENT_TARGET = 3.1; 263 | PREBINDING = NO; 264 | SDKROOT = iphoneos3.2; 265 | TARGETED_DEVICE_FAMILY = "1,2"; 266 | }; 267 | name = Debug; 268 | }; 269 | C01FCF5008A954540054247B /* Release */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; 273 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 274 | GCC_C_LANGUAGE_STANDARD = c99; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 276 | GCC_WARN_UNUSED_VARIABLE = YES; 277 | IPHONEOS_DEPLOYMENT_TARGET = 3.1; 278 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 279 | PREBINDING = NO; 280 | SDKROOT = iphoneos3.2; 281 | TARGETED_DEVICE_FAMILY = "1,2"; 282 | }; 283 | name = Release; 284 | }; 285 | /* End XCBuildConfiguration section */ 286 | 287 | /* Begin XCConfigurationList section */ 288 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Drop" */ = { 289 | isa = XCConfigurationList; 290 | buildConfigurations = ( 291 | 1D6058940D05DD3E006BFB54 /* Debug */, 292 | 1D6058950D05DD3E006BFB54 /* Release */, 293 | ); 294 | defaultConfigurationIsVisible = 0; 295 | defaultConfigurationName = Release; 296 | }; 297 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Drop" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | C01FCF4F08A954540054247B /* Debug */, 301 | C01FCF5008A954540054247B /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | defaultConfigurationName = Release; 305 | }; 306 | /* End XCConfigurationList section */ 307 | }; 308 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 309 | } 310 | -------------------------------------------------------------------------------- /Drop/iPhone/MainWindow_Phone.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 800 5 | 10D541 6 | 760 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 81 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | 45 | 1316 46 | 47 | {320, 480} 48 | 49 | 50 | 1 51 | MSAxIDEAA 52 | 53 | NO 54 | NO 55 | 56 | IBCocoaTouchFramework 57 | YES 58 | 59 | 60 | 61 | 62 | YES 63 | 64 | 65 | delegate 66 | 67 | 68 | 69 | 5 70 | 71 | 72 | 73 | window 74 | 75 | 76 | 77 | 6 78 | 79 | 80 | 81 | 82 | YES 83 | 84 | 0 85 | 86 | 87 | 88 | 89 | 90 | 2 91 | 92 | 93 | YES 94 | 95 | 96 | 97 | 98 | -1 99 | 100 | 101 | File's Owner 102 | 103 | 104 | 4 105 | 106 | 107 | App Delegate 108 | 109 | 110 | -2 111 | 112 | 113 | 114 | 115 | 116 | 117 | YES 118 | 119 | YES 120 | -1.CustomClassName 121 | -2.CustomClassName 122 | 2.IBAttributePlaceholdersKey 123 | 2.IBEditorWindowLastContentRect 124 | 2.IBPluginDependency 125 | 2.UIWindow.visibleAtLaunch 126 | 4.CustomClassName 127 | 4.IBPluginDependency 128 | 129 | 130 | YES 131 | UIApplication 132 | UIResponder 133 | 134 | YES 135 | 136 | 137 | YES 138 | 139 | 140 | {{520, 800}, {320, 480}} 141 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 142 | 143 | AppDelegate_Phone 144 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 145 | 146 | 147 | 148 | YES 149 | 150 | 151 | YES 152 | 153 | 154 | 155 | 156 | YES 157 | 158 | 159 | YES 160 | 161 | 162 | 163 | 8 164 | 165 | 166 | 167 | YES 168 | 169 | AppDelegate_Phone 170 | NSObject 171 | 172 | window 173 | UIWindow 174 | 175 | 176 | IBProjectSource 177 | iPhone/AppDelegate_Phone.h 178 | 179 | 180 | 181 | AppDelegate_Phone 182 | NSObject 183 | 184 | IBUserSource 185 | 186 | 187 | 188 | 189 | 190 | YES 191 | 192 | NSObject 193 | 194 | IBFrameworkSource 195 | Foundation.framework/Headers/NSError.h 196 | 197 | 198 | 199 | NSObject 200 | 201 | IBFrameworkSource 202 | Foundation.framework/Headers/NSFileManager.h 203 | 204 | 205 | 206 | NSObject 207 | 208 | IBFrameworkSource 209 | Foundation.framework/Headers/NSKeyValueCoding.h 210 | 211 | 212 | 213 | NSObject 214 | 215 | IBFrameworkSource 216 | Foundation.framework/Headers/NSKeyValueObserving.h 217 | 218 | 219 | 220 | NSObject 221 | 222 | IBFrameworkSource 223 | Foundation.framework/Headers/NSKeyedArchiver.h 224 | 225 | 226 | 227 | NSObject 228 | 229 | IBFrameworkSource 230 | Foundation.framework/Headers/NSNetServices.h 231 | 232 | 233 | 234 | NSObject 235 | 236 | IBFrameworkSource 237 | Foundation.framework/Headers/NSObject.h 238 | 239 | 240 | 241 | NSObject 242 | 243 | IBFrameworkSource 244 | Foundation.framework/Headers/NSPort.h 245 | 246 | 247 | 248 | NSObject 249 | 250 | IBFrameworkSource 251 | Foundation.framework/Headers/NSRunLoop.h 252 | 253 | 254 | 255 | NSObject 256 | 257 | IBFrameworkSource 258 | Foundation.framework/Headers/NSStream.h 259 | 260 | 261 | 262 | NSObject 263 | 264 | IBFrameworkSource 265 | Foundation.framework/Headers/NSThread.h 266 | 267 | 268 | 269 | NSObject 270 | 271 | IBFrameworkSource 272 | Foundation.framework/Headers/NSURL.h 273 | 274 | 275 | 276 | NSObject 277 | 278 | IBFrameworkSource 279 | Foundation.framework/Headers/NSURLConnection.h 280 | 281 | 282 | 283 | NSObject 284 | 285 | IBFrameworkSource 286 | Foundation.framework/Headers/NSXMLParser.h 287 | 288 | 289 | 290 | NSObject 291 | 292 | IBFrameworkSource 293 | UIKit.framework/Headers/UIAccessibility.h 294 | 295 | 296 | 297 | NSObject 298 | 299 | IBFrameworkSource 300 | UIKit.framework/Headers/UINibLoading.h 301 | 302 | 303 | 304 | NSObject 305 | 306 | IBFrameworkSource 307 | UIKit.framework/Headers/UIResponder.h 308 | 309 | 310 | 311 | UIApplication 312 | UIResponder 313 | 314 | IBFrameworkSource 315 | UIKit.framework/Headers/UIApplication.h 316 | 317 | 318 | 319 | UIResponder 320 | NSObject 321 | 322 | 323 | 324 | UIView 325 | 326 | IBFrameworkSource 327 | UIKit.framework/Headers/UITextField.h 328 | 329 | 330 | 331 | UIView 332 | UIResponder 333 | 334 | IBFrameworkSource 335 | UIKit.framework/Headers/UIView.h 336 | 337 | 338 | 339 | UIWindow 340 | UIView 341 | 342 | IBFrameworkSource 343 | UIKit.framework/Headers/UIWindow.h 344 | 345 | 346 | 347 | 348 | 0 349 | IBCocoaTouchFramework 350 | 351 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 352 | 353 | 354 | 355 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 356 | 357 | 358 | YES 359 | ../Drop.xcodeproj 360 | 3 361 | 81 362 | 363 | 364 | -------------------------------------------------------------------------------- /Drag/Drag.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 110021D311D053E70046072D /* DKApplicationRegistration.m in Sources */ = {isa = PBXBuildFile; fileRef = 110021D211D053E70046072D /* DKApplicationRegistration.m */; }; 11 | 111F001611CDE11D004AED24 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 111F001511CDE11D004AED24 /* QuartzCore.framework */; }; 12 | 111F3618117E9E2200B72C00 /* DragViewController_Phone.m in Sources */ = {isa = PBXBuildFile; fileRef = 111F3616117E9E2200B72C00 /* DragViewController_Phone.m */; }; 13 | 113F29CE121F87290073645E /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 113F29CD121F87290073645E /* MobileCoreServices.framework */; }; 14 | 1144A1181220D9A500FDEAE6 /* drag_default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1144A1161220D9A500FDEAE6 /* drag_default.png */; }; 15 | 1144A1191220D9A500FDEAE6 /* drag_overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 1144A1171220D9A500FDEAE6 /* drag_overlay.png */; }; 16 | 1150E4B3120E40C6008902F8 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1150E4B2120E40C6008902F8 /* GameKit.framework */; }; 17 | 11DF18E3117EA17B00233A48 /* DragView.m in Sources */ = {isa = PBXBuildFile; fileRef = 11DF18E2117EA17B00233A48 /* DragView.m */; }; 18 | 11DF18ED117EA66E00233A48 /* DKDragDropServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 11DF18EC117EA66E00233A48 /* DKDragDropServer.m */; }; 19 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 20 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 21 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 22 | 2860E328111B887F00E27156 /* AppDelegate_Phone.m in Sources */ = {isa = PBXBuildFile; fileRef = 2860E326111B887F00E27156 /* AppDelegate_Phone.m */; }; 23 | 2860E329111B887F00E27156 /* MainWindow_Phone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860E327111B887F00E27156 /* MainWindow_Phone.xib */; }; 24 | 2860E32E111B888700E27156 /* AppDelegate_Pad.m in Sources */ = {isa = PBXBuildFile; fileRef = 2860E32C111B888700E27156 /* AppDelegate_Pad.m */; }; 25 | 2860E32F111B888700E27156 /* MainWindow_Pad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860E32D111B888700E27156 /* MainWindow_Pad.xib */; }; 26 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; 27 | 972102251220DA1D00470344 /* DragViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 972102241220DA1D00470344 /* DragViewController.m */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 110021D111D053E70046072D /* DKApplicationRegistration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKApplicationRegistration.h; sourceTree = ""; }; 32 | 110021D211D053E70046072D /* DKApplicationRegistration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DKApplicationRegistration.m; sourceTree = ""; }; 33 | 111F001511CDE11D004AED24 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 34 | 111F3615117E9E2200B72C00 /* DragViewController_Phone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DragViewController_Phone.h; path = ../DragViewController_Phone.h; sourceTree = ""; }; 35 | 111F3616117E9E2200B72C00 /* DragViewController_Phone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DragViewController_Phone.m; path = ../DragViewController_Phone.m; sourceTree = ""; }; 36 | 113F29CD121F87290073645E /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 37 | 1144A1161220D9A500FDEAE6 /* drag_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = drag_default.png; sourceTree = ""; }; 38 | 1144A1171220D9A500FDEAE6 /* drag_overlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = drag_overlay.png; sourceTree = ""; }; 39 | 1150E4B2120E40C6008902F8 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; 40 | 11DF18E1117EA17B00233A48 /* DragView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragView.h; sourceTree = ""; }; 41 | 11DF18E2117EA17B00233A48 /* DragView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DragView.m; sourceTree = ""; }; 42 | 11DF18EB117EA66E00233A48 /* DKDragDropServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKDragDropServer.h; sourceTree = ""; }; 43 | 11DF18EC117EA66E00233A48 /* DKDragDropServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DKDragDropServer.m; sourceTree = ""; }; 44 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 45 | 1D6058910D05DD3D006BFB54 /* Drag.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Drag.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 47 | 2860E325111B887F00E27156 /* AppDelegate_Phone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate_Phone.h; sourceTree = ""; }; 48 | 2860E326111B887F00E27156 /* AppDelegate_Phone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate_Phone.m; sourceTree = ""; }; 49 | 2860E327111B887F00E27156 /* MainWindow_Phone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_Phone.xib; sourceTree = ""; }; 50 | 2860E32B111B888700E27156 /* AppDelegate_Pad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate_Pad.h; sourceTree = ""; }; 51 | 2860E32C111B888700E27156 /* AppDelegate_Pad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate_Pad.m; sourceTree = ""; }; 52 | 2860E32D111B888700E27156 /* MainWindow_Pad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_Pad.xib; sourceTree = ""; }; 53 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 54 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Shared/main.m; sourceTree = ""; }; 55 | 32CA4F630368D1EE00C91783 /* Drag_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Drag_Prefix.pch; sourceTree = ""; }; 56 | 8D1107310486CEB800E47090 /* Drag-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Drag-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 57 | 972102241220DA1D00470344 /* DragViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DragViewController.m; sourceTree = ""; }; 58 | 972102261220DB2B00470344 /* DragViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragViewController.h; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 67 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 68 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */, 69 | 111F001611CDE11D004AED24 /* QuartzCore.framework in Frameworks */, 70 | 1150E4B3120E40C6008902F8 /* GameKit.framework in Frameworks */, 71 | 113F29CE121F87290073645E /* MobileCoreServices.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | 1174629E11CD95B700BAD1D9 /* Resources */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | ); 82 | name = Resources; 83 | sourceTree = ""; 84 | }; 85 | 11E6EFD611F6A06A00F1F29C /* DragKit */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 11DF18EB117EA66E00233A48 /* DKDragDropServer.h */, 89 | 11DF18EC117EA66E00233A48 /* DKDragDropServer.m */, 90 | 110021D111D053E70046072D /* DKApplicationRegistration.h */, 91 | 110021D211D053E70046072D /* DKApplicationRegistration.m */, 92 | 1144A1161220D9A500FDEAE6 /* drag_default.png */, 93 | 1144A1171220D9A500FDEAE6 /* drag_overlay.png */, 94 | ); 95 | name = DragKit; 96 | sourceTree = ""; 97 | }; 98 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 1D6058910D05DD3D006BFB54 /* Drag.app */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 2860E324111B887F00E27156 /* iPhone */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 111F3615117E9E2200B72C00 /* DragViewController_Phone.h */, 110 | 111F3616117E9E2200B72C00 /* DragViewController_Phone.m */, 111 | 2860E325111B887F00E27156 /* AppDelegate_Phone.h */, 112 | 2860E326111B887F00E27156 /* AppDelegate_Phone.m */, 113 | 2860E327111B887F00E27156 /* MainWindow_Phone.xib */, 114 | ); 115 | path = iPhone; 116 | sourceTree = ""; 117 | }; 118 | 2860E32A111B888700E27156 /* iPad */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 2860E32B111B888700E27156 /* AppDelegate_Pad.h */, 122 | 2860E32C111B888700E27156 /* AppDelegate_Pad.m */, 123 | 2860E32D111B888700E27156 /* MainWindow_Pad.xib */, 124 | ); 125 | path = iPad; 126 | sourceTree = ""; 127 | }; 128 | 28EEBF621118D79A00187D67 /* Shared */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 1174629E11CD95B700BAD1D9 /* Resources */, 132 | 8D1107310486CEB800E47090 /* Drag-Info.plist */, 133 | ); 134 | name = Shared; 135 | sourceTree = ""; 136 | }; 137 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 972102261220DB2B00470344 /* DragViewController.h */, 141 | 972102241220DA1D00470344 /* DragViewController.m */, 142 | 11DF18E1117EA17B00233A48 /* DragView.h */, 143 | 11DF18E2117EA17B00233A48 /* DragView.m */, 144 | 11E6EFD611F6A06A00F1F29C /* DragKit */, 145 | 2860E32A111B888700E27156 /* iPad */, 146 | 2860E324111B887F00E27156 /* iPhone */, 147 | 28EEBF621118D79A00187D67 /* Shared */, 148 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 149 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 150 | 19C28FACFE9D520D11CA2CBB /* Products */, 151 | ); 152 | name = CustomTemplate; 153 | sourceTree = ""; 154 | }; 155 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 32CA4F630368D1EE00C91783 /* Drag_Prefix.pch */, 159 | 29B97316FDCFA39411CA2CEA /* main.m */, 160 | ); 161 | name = "Other Sources"; 162 | sourceTree = ""; 163 | }; 164 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 168 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 169 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */, 170 | 111F001511CDE11D004AED24 /* QuartzCore.framework */, 171 | 1150E4B2120E40C6008902F8 /* GameKit.framework */, 172 | 113F29CD121F87290073645E /* MobileCoreServices.framework */, 173 | ); 174 | name = Frameworks; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXGroup section */ 178 | 179 | /* Begin PBXNativeTarget section */ 180 | 1D6058900D05DD3D006BFB54 /* Drag */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Drag" */; 183 | buildPhases = ( 184 | 1D60588D0D05DD3D006BFB54 /* Resources */, 185 | 1D60588E0D05DD3D006BFB54 /* Sources */, 186 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | ); 192 | name = Drag; 193 | productName = Drag; 194 | productReference = 1D6058910D05DD3D006BFB54 /* Drag.app */; 195 | productType = "com.apple.product-type.application"; 196 | }; 197 | /* End PBXNativeTarget section */ 198 | 199 | /* Begin PBXProject section */ 200 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 201 | isa = PBXProject; 202 | attributes = { 203 | ORGANIZATIONNAME = "Zac White"; 204 | }; 205 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Drag" */; 206 | compatibilityVersion = "Xcode 3.1"; 207 | hasScannedForEncodings = 1; 208 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 209 | projectDirPath = ""; 210 | projectRoot = ""; 211 | targets = ( 212 | 1D6058900D05DD3D006BFB54 /* Drag */, 213 | ); 214 | }; 215 | /* End PBXProject section */ 216 | 217 | /* Begin PBXResourcesBuildPhase section */ 218 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 2860E329111B887F00E27156 /* MainWindow_Phone.xib in Resources */, 223 | 2860E32F111B888700E27156 /* MainWindow_Pad.xib in Resources */, 224 | 1144A1181220D9A500FDEAE6 /* drag_default.png in Resources */, 225 | 1144A1191220D9A500FDEAE6 /* drag_overlay.png in Resources */, 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | /* End PBXResourcesBuildPhase section */ 230 | 231 | /* Begin PBXSourcesBuildPhase section */ 232 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 233 | isa = PBXSourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 237 | 2860E328111B887F00E27156 /* AppDelegate_Phone.m in Sources */, 238 | 2860E32E111B888700E27156 /* AppDelegate_Pad.m in Sources */, 239 | 111F3618117E9E2200B72C00 /* DragViewController_Phone.m in Sources */, 240 | 11DF18E3117EA17B00233A48 /* DragView.m in Sources */, 241 | 11DF18ED117EA66E00233A48 /* DKDragDropServer.m in Sources */, 242 | 110021D311D053E70046072D /* DKApplicationRegistration.m in Sources */, 243 | 972102251220DA1D00470344 /* DragViewController.m in Sources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | /* End PBXSourcesBuildPhase section */ 248 | 249 | /* Begin XCBuildConfiguration section */ 250 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 251 | isa = XCBuildConfiguration; 252 | buildSettings = { 253 | ALWAYS_SEARCH_USER_PATHS = NO; 254 | COPY_PHASE_STRIP = NO; 255 | GCC_DYNAMIC_NO_PIC = NO; 256 | GCC_OPTIMIZATION_LEVEL = 0; 257 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 258 | GCC_PREFIX_HEADER = Drag_Prefix.pch; 259 | INFOPLIST_FILE = "Drag-Info.plist"; 260 | PRODUCT_NAME = Drag; 261 | }; 262 | name = Debug; 263 | }; 264 | 1D6058950D05DD3E006BFB54 /* Release */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | ALWAYS_SEARCH_USER_PATHS = NO; 268 | COPY_PHASE_STRIP = YES; 269 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 270 | GCC_PREFIX_HEADER = Drag_Prefix.pch; 271 | INFOPLIST_FILE = "Drag-Info.plist"; 272 | PRODUCT_NAME = Drag; 273 | VALIDATE_PRODUCT = YES; 274 | }; 275 | name = Release; 276 | }; 277 | C01FCF4F08A954540054247B /* Debug */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; 281 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 282 | GCC_C_LANGUAGE_STANDARD = c99; 283 | GCC_VERSION = 4.2; 284 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 285 | GCC_WARN_UNUSED_VARIABLE = YES; 286 | IPHONEOS_DEPLOYMENT_TARGET = 3.1; 287 | PREBINDING = NO; 288 | SDKROOT = iphoneos3.2; 289 | TARGETED_DEVICE_FAMILY = "1,2"; 290 | }; 291 | name = Debug; 292 | }; 293 | C01FCF5008A954540054247B /* Release */ = { 294 | isa = XCBuildConfiguration; 295 | buildSettings = { 296 | ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; 297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 298 | GCC_C_LANGUAGE_STANDARD = c99; 299 | GCC_VERSION = 4.2; 300 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 3.1; 303 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 304 | PREBINDING = NO; 305 | SDKROOT = iphoneos3.2; 306 | TARGETED_DEVICE_FAMILY = "1,2"; 307 | }; 308 | name = Release; 309 | }; 310 | /* End XCBuildConfiguration section */ 311 | 312 | /* Begin XCConfigurationList section */ 313 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Drag" */ = { 314 | isa = XCConfigurationList; 315 | buildConfigurations = ( 316 | 1D6058940D05DD3E006BFB54 /* Debug */, 317 | 1D6058950D05DD3E006BFB54 /* Release */, 318 | ); 319 | defaultConfigurationIsVisible = 0; 320 | defaultConfigurationName = Release; 321 | }; 322 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Drag" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | C01FCF4F08A954540054247B /* Debug */, 326 | C01FCF5008A954540054247B /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | /* End XCConfigurationList section */ 332 | }; 333 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 334 | } 335 | -------------------------------------------------------------------------------- /Drop/iPad/DropViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 800 5 | 10F569 6 | 788 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 117 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBIPadFramework 35 | 36 | 37 | IBFirstResponder 38 | IBIPadFramework 39 | 40 | 41 | 42 | 256 43 | 44 | YES 45 | 46 | 47 | 256 48 | {{354, 327}, {316, 94}} 49 | 50 | NO 51 | YES 52 | 7 53 | NO 54 | IBIPadFramework 55 | Drop Text Here 56 | 57 | 1 58 | MCAwIDAAA 59 | 60 | 61 | 1 62 | 10 63 | 1 64 | 65 | 66 | {1024, 748} 67 | 68 | 69 | 3 70 | MQA 71 | 72 | NO 73 | 74 | 2 75 | 76 | 77 | 3 78 | 79 | IBIPadFramework 80 | 81 | 82 | 83 | 84 | YES 85 | 86 | 87 | view 88 | 89 | 90 | 91 | 3 92 | 93 | 94 | 95 | dropWell 96 | 97 | 98 | 99 | 8 100 | 101 | 102 | 103 | 104 | YES 105 | 106 | 0 107 | 108 | 109 | 110 | 111 | 112 | -1 113 | 114 | 115 | File's Owner 116 | 117 | 118 | -2 119 | 120 | 121 | 122 | 123 | 2 124 | 125 | 126 | YES 127 | 128 | 129 | 130 | 131 | 132 | 5 133 | 134 | 135 | 136 | 137 | 138 | 139 | YES 140 | 141 | YES 142 | -1.CustomClassName 143 | -2.CustomClassName 144 | 2.IBEditorWindowLastContentRect 145 | 2.IBPluginDependency 146 | 5.IBPluginDependency 147 | 148 | 149 | YES 150 | DropViewController 151 | UIResponder 152 | {{350, 64}, {1024, 768}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 155 | 156 | 157 | 158 | YES 159 | 160 | 161 | YES 162 | 163 | 164 | 165 | 166 | YES 167 | 168 | 169 | YES 170 | 171 | 172 | 173 | 8 174 | 175 | 176 | 177 | YES 178 | 179 | DropViewController 180 | UIViewController 181 | 182 | dropWell 183 | UILabel 184 | 185 | 186 | dropWell 187 | 188 | dropWell 189 | UILabel 190 | 191 | 192 | 193 | IBProjectSource 194 | iPad/DropViewController.h 195 | 196 | 197 | 198 | 199 | YES 200 | 201 | NSObject 202 | 203 | IBFrameworkSource 204 | Foundation.framework/Headers/NSError.h 205 | 206 | 207 | 208 | NSObject 209 | 210 | IBFrameworkSource 211 | Foundation.framework/Headers/NSFileManager.h 212 | 213 | 214 | 215 | NSObject 216 | 217 | IBFrameworkSource 218 | Foundation.framework/Headers/NSKeyValueCoding.h 219 | 220 | 221 | 222 | NSObject 223 | 224 | IBFrameworkSource 225 | Foundation.framework/Headers/NSKeyValueObserving.h 226 | 227 | 228 | 229 | NSObject 230 | 231 | IBFrameworkSource 232 | Foundation.framework/Headers/NSKeyedArchiver.h 233 | 234 | 235 | 236 | NSObject 237 | 238 | IBFrameworkSource 239 | Foundation.framework/Headers/NSNetServices.h 240 | 241 | 242 | 243 | NSObject 244 | 245 | IBFrameworkSource 246 | Foundation.framework/Headers/NSObject.h 247 | 248 | 249 | 250 | NSObject 251 | 252 | IBFrameworkSource 253 | Foundation.framework/Headers/NSPort.h 254 | 255 | 256 | 257 | NSObject 258 | 259 | IBFrameworkSource 260 | Foundation.framework/Headers/NSRunLoop.h 261 | 262 | 263 | 264 | NSObject 265 | 266 | IBFrameworkSource 267 | Foundation.framework/Headers/NSStream.h 268 | 269 | 270 | 271 | NSObject 272 | 273 | IBFrameworkSource 274 | Foundation.framework/Headers/NSThread.h 275 | 276 | 277 | 278 | NSObject 279 | 280 | IBFrameworkSource 281 | Foundation.framework/Headers/NSURL.h 282 | 283 | 284 | 285 | NSObject 286 | 287 | IBFrameworkSource 288 | Foundation.framework/Headers/NSURLConnection.h 289 | 290 | 291 | 292 | NSObject 293 | 294 | IBFrameworkSource 295 | Foundation.framework/Headers/NSXMLParser.h 296 | 297 | 298 | 299 | NSObject 300 | 301 | IBFrameworkSource 302 | QuartzCore.framework/Headers/CAAnimation.h 303 | 304 | 305 | 306 | NSObject 307 | 308 | IBFrameworkSource 309 | QuartzCore.framework/Headers/CALayer.h 310 | 311 | 312 | 313 | NSObject 314 | 315 | IBFrameworkSource 316 | UIKit.framework/Headers/UIAccessibility.h 317 | 318 | 319 | 320 | NSObject 321 | 322 | IBFrameworkSource 323 | UIKit.framework/Headers/UINibLoading.h 324 | 325 | 326 | 327 | NSObject 328 | 329 | IBFrameworkSource 330 | UIKit.framework/Headers/UIResponder.h 331 | 332 | 333 | 334 | UILabel 335 | UIView 336 | 337 | IBFrameworkSource 338 | UIKit.framework/Headers/UILabel.h 339 | 340 | 341 | 342 | UIResponder 343 | NSObject 344 | 345 | 346 | 347 | UISearchBar 348 | UIView 349 | 350 | IBFrameworkSource 351 | UIKit.framework/Headers/UISearchBar.h 352 | 353 | 354 | 355 | UISearchDisplayController 356 | NSObject 357 | 358 | IBFrameworkSource 359 | UIKit.framework/Headers/UISearchDisplayController.h 360 | 361 | 362 | 363 | UIView 364 | 365 | IBFrameworkSource 366 | UIKit.framework/Headers/UITextField.h 367 | 368 | 369 | 370 | UIView 371 | UIResponder 372 | 373 | IBFrameworkSource 374 | UIKit.framework/Headers/UIView.h 375 | 376 | 377 | 378 | UIViewController 379 | 380 | IBFrameworkSource 381 | UIKit.framework/Headers/UINavigationController.h 382 | 383 | 384 | 385 | UIViewController 386 | 387 | IBFrameworkSource 388 | UIKit.framework/Headers/UIPopoverController.h 389 | 390 | 391 | 392 | UIViewController 393 | 394 | IBFrameworkSource 395 | UIKit.framework/Headers/UISplitViewController.h 396 | 397 | 398 | 399 | UIViewController 400 | 401 | IBFrameworkSource 402 | UIKit.framework/Headers/UITabBarController.h 403 | 404 | 405 | 406 | UIViewController 407 | UIResponder 408 | 409 | IBFrameworkSource 410 | UIKit.framework/Headers/UIViewController.h 411 | 412 | 413 | 414 | 415 | 0 416 | IBIPadFramework 417 | 418 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 419 | 420 | 421 | 422 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 423 | 424 | 425 | YES 426 | ../Drop.xcodeproj 427 | 3 428 | 117 429 | 430 | 431 | -------------------------------------------------------------------------------- /Drag/DKDragDropServer.m: -------------------------------------------------------------------------------- 1 | // 2 | // DKDragServer.m 3 | // Drag 4 | // 5 | // Created by Zac White on 4/20/10. 6 | // Copyright 2010 Zac White. All rights reserved. 7 | // 8 | // Singleton code stolen from: http://boredzo.org/blog/archives/2009-06-17/doing-it-wrong 9 | 10 | #import "DKDragDropServer.h" 11 | #import 12 | 13 | #import "DKApplicationRegistration.h" 14 | 15 | #import 16 | #import 17 | 18 | #import 19 | 20 | static DKDragDropServer *sharedInstance = nil; 21 | 22 | // constants 23 | NSString *const DKPasteboardNameDrag = @"dragkit-drag"; 24 | 25 | @interface DKDragDropServer (DKPrivate) 26 | 27 | - (void)dk_clearDragPasteboard; 28 | - (void)dk_showHoldingAreaForPasteboard:(UIPasteboard *)pasteboard; 29 | - (void)dk_hideHoldingArea; 30 | - (BOOL)dk_dragPasteboard:(UIPasteboard *)pasteboard conformsToTypes:(NSArray *)types; 31 | - (void)dk_handleLongPress:(UIGestureRecognizer *)sender; 32 | - (UIImage *)dk_generateImageFromView:(UIView *)theView; 33 | - (void)dk_displayDragViewForView:(UIView *)draggableView atPoint:(CGPoint)point; 34 | - (void)dk_moveDragViewToPoint:(CGPoint)point; 35 | - (void)dk_createDragPasteboardForView:(UIView *)view; 36 | - (void)dk_messageTargetsHitByPoint:(CGPoint)point; 37 | - (void)dk_setView:(UIView *)view highlighted:(BOOL)highlighted animated:(BOOL)animated; 38 | - (void)dk_handleURL:(NSNotification *)notification; 39 | - (UIWindow *)dk_mainAppWindow; 40 | - (UIView *)dk_viewContainingKey:(void *)key forPoint:(CGPoint)point; 41 | - (UIView *)dk_dragViewUnderPoint:(CGPoint)point; 42 | - (UIView *)dk_dropTargetHitByPoint:(CGPoint)point; 43 | - (void)dk_collapseDragView; 44 | 45 | @end 46 | 47 | @implementation DKDragDropServer 48 | 49 | @synthesize draggedView, originalView, pausedTimer; 50 | 51 | #pragma mark - 52 | #pragma mark Singleton 53 | 54 | + (void)initialize { 55 | if (!sharedInstance) { 56 | //TODO: Check for plist entries for supported types. 57 | [[self alloc] init]; 58 | } 59 | } 60 | 61 | + (id)sharedServer { 62 | //already created by +initialize 63 | return sharedInstance; 64 | } 65 | 66 | + (NSString *)versionString { 67 | return @"1.0"; 68 | } 69 | 70 | + (id)allocWithZone:(NSZone *)zone { 71 | if (sharedInstance) { 72 | //The caller expects to receive a new object, so implicitly retain it to balance out the caller's eventual release message. 73 | return [sharedInstance retain]; 74 | } else { 75 | //When not already set, +initialize is our caller—it's creating the shared instance. Let this go through. 76 | return [super allocWithZone:zone]; 77 | } 78 | } 79 | 80 | - (id) init { 81 | //If sharedInstance is nil, +initialize is our caller, so initialize the instance. 82 | //Conversely, if it is not nil, release this instance (if it isn't the shared instance) and return the shared instance. 83 | if (!sharedInstance) { 84 | if ((self = [super init])) { 85 | //Initialize the instance here. 86 | dk_dropTargets = [[NSMutableArray alloc] init]; 87 | 88 | [[NSNotificationCenter defaultCenter] addObserver:self 89 | selector:@selector(dk_applicationWillTerminate:) 90 | name:UIApplicationWillTerminateNotification 91 | object:nil]; 92 | 93 | [[NSNotificationCenter defaultCenter] addObserver:self 94 | selector:@selector(dk_applicationDidBecomeActive:) 95 | name:UIApplicationDidBecomeActiveNotification 96 | object:nil]; 97 | pausedTimer = nil; 98 | } 99 | 100 | //Assign sharedInstance here so that we don't end up with multiple instances if a caller calls +alloc/-init without going through +sharedInstance. 101 | //This isn't foolproof, however (especially if you involve threads). The only correct way to get an instance of a singleton is through the +sharedInstance method. 102 | sharedInstance = self; 103 | } else if (self != sharedInstance) { 104 | [self release]; 105 | self = sharedInstance; 106 | } 107 | 108 | return self; 109 | } 110 | 111 | - (void)dk_applicationDidBecomeActive:(NSNotification *)notification { 112 | NSLog(@"window: %@", [self dk_mainAppWindow]); 113 | 114 | UILongPressGestureRecognizer *dragRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(dk_handleLongPress:)]; 115 | dragRecognizer.minimumPressDuration = 0.1; 116 | dragRecognizer.numberOfTapsRequired = 1; 117 | 118 | [[self dk_mainAppWindow] addGestureRecognizer:dragRecognizer]; 119 | [dragRecognizer release]; 120 | } 121 | 122 | - (UIWindow *)dk_mainAppWindow { 123 | if (dk_mainAppWindow) return dk_mainAppWindow; 124 | 125 | //TODO: Better logic to determine the app window. 126 | dk_mainAppWindow = [[[UIApplication sharedApplication] keyWindow] retain]; 127 | 128 | if (!dk_mainAppWindow) { 129 | NSLog(@"UH OH! TOO SOON!"); 130 | } 131 | 132 | return dk_mainAppWindow; 133 | } 134 | 135 | - (void)dk_applicationWillTerminate:(NSNotification *)notification { 136 | UIPasteboard *dragPasteboard = [UIPasteboard pasteboardWithName:DKPasteboardNameDrag create:NO]; 137 | if (dragPasteboard) dragPasteboard.persistent = YES; 138 | } 139 | 140 | #define MAX_NUMBER_OF_REGISTERED_APPS 100 141 | 142 | - (BOOL)dk_dragPasteboard:(UIPasteboard *)pasteboard conformsToTypes:(NSArray *)types { 143 | for (NSString *type in types) { 144 | // check to see if any of the types being dragged are ones we support. 145 | 146 | for (NSArray *dragTypes in [pasteboard pasteboardTypesForItemSet:nil]) { 147 | 148 | // ignore if we are dealing with the metadata. 149 | if ([dragTypes containsObject:@"dragkit.metadata"]) continue; 150 | 151 | for (NSArray *individualType in dragTypes) { 152 | if (UTTypeConformsTo((CFStringRef)type, (CFStringRef)individualType)) { 153 | return YES; 154 | } 155 | } 156 | } 157 | } 158 | 159 | return NO; 160 | } 161 | 162 | - (void)registerApplicationWithTypes:(NSArray *)types { 163 | 164 | UIPasteboard *dragPasteboard = [UIPasteboard pasteboardWithName:DKPasteboardNameDrag create:YES]; 165 | NSDictionary *meta = [NSKeyedUnarchiver unarchiveObjectWithData:[[dragPasteboard valuesForPasteboardType:@"dragkit.metadata" inItemSet:nil] lastObject]]; 166 | 167 | if (meta) { 168 | // we have a drag in progress. 169 | 170 | if ([self dk_dragPasteboard:dragPasteboard conformsToTypes:types]) { 171 | // create and show the holding area. 172 | [self dk_showHoldingAreaForPasteboard:dragPasteboard]; 173 | } 174 | } 175 | 176 | if (dk_manifest) { 177 | NSLog(@"dk_buildManifest should only be called once."); 178 | return; 179 | } 180 | 181 | dk_manifest = [[NSMutableArray alloc] init]; 182 | 183 | // check to see if we've already created a pasteboard. this returns a valid pasteboard in the common case. 184 | NSString *pasteboardName = [[NSUserDefaults standardUserDefaults] objectForKey:@"dragkit-pasteboard"]; 185 | 186 | // create our app registration. 187 | DKApplicationRegistration *appRegistration = [DKApplicationRegistration registrationWithDragTypes:types]; 188 | 189 | [dk_applicationRegistration release]; 190 | dk_applicationRegistration = [appRegistration retain]; 191 | 192 | // the original application that created the manifest could have been deleted. 193 | // this would leave UIPasteboards out there without a central manifest. 194 | // we must scan through the possible application registration slots and recreate the manifest. 195 | // of course, we could be the first app. In that case, we'll scan through and just create the manifest 196 | // pointing to just our app's registration data. 197 | 198 | BOOL registrationInserted = NO; 199 | 200 | for (int i = 0; i < MAX_NUMBER_OF_REGISTERED_APPS; i++) { 201 | UIPasteboard *possibleApp = [UIPasteboard pasteboardWithName:[NSString stringWithFormat:@"dragkit-application:%d", i] create:YES]; 202 | if ([possibleApp containsPasteboardTypes:[NSArray arrayWithObject:@"dragkit.registration"]]) { 203 | 204 | // if it is our pasteboard, don't bother. 205 | // pasteboardName could be nil if we haven't been launched. 206 | // in that case, we'll just insert into our registration which happens in the else block. 207 | if ([possibleApp.name isEqualToString:pasteboardName]) continue; 208 | 209 | [dk_manifest addObject:possibleApp.name]; 210 | 211 | } else if (!pasteboardName && !registrationInserted) { 212 | registrationInserted = YES; 213 | 214 | [[NSUserDefaults standardUserDefaults] setObject:[possibleApp name] forKey:@"dragkit-pasteboard"]; 215 | [[NSUserDefaults standardUserDefaults] synchronize]; 216 | 217 | // insert our application registration. 218 | // create a new pasteboard with the name [possibleApp name]. 219 | UIPasteboard *registrationPasteboard = [UIPasteboard pasteboardWithName:[possibleApp name] create:YES]; 220 | registrationPasteboard.persistent = YES; 221 | 222 | NSData *registrationData = [NSKeyedArchiver archivedDataWithRootObject:appRegistration]; 223 | 224 | [registrationPasteboard setData:registrationData forPasteboardType:@"dragkit.registration"]; 225 | } 226 | } 227 | 228 | // we should always have an available slot. 229 | // if we don't, we've run out of slots and probably should have picked a higher number than 100. 230 | if (!pasteboardName && !registrationInserted) { 231 | NSLog(@"ERROR: All available app registration slots are used."); 232 | } 233 | } 234 | 235 | - (NSArray *)registeredApplications { 236 | //returns all registered applications. 237 | 238 | if (dk_supportedApplications) return [[dk_supportedApplications retain] autorelease]; 239 | 240 | NSAssert(dk_manifest, @"Expected a DragKit manifest to already be created."); 241 | 242 | dk_supportedApplications = [[NSMutableArray alloc] init]; 243 | for (NSString *pasteboardName in dk_manifest) { 244 | 245 | UIPasteboard *registrationPasteboard = [UIPasteboard pasteboardWithName:pasteboardName create:YES]; 246 | 247 | NSData *pasteboardData = [registrationPasteboard dataForPasteboardType:@"dragkit.registration"]; 248 | 249 | if (pasteboardData) { 250 | DKApplicationRegistration *appRegistration = [NSKeyedUnarchiver unarchiveObjectWithData:pasteboardData]; 251 | [dk_supportedApplications addObject:appRegistration]; 252 | } 253 | } 254 | 255 | return [[dk_supportedApplications retain] autorelease]; 256 | } 257 | 258 | - (void)resetRegistrationDatabase { 259 | [UIPasteboard removePasteboardWithName:@"dragkit-manifest"]; 260 | 261 | for (int i = 0; i < MAX_NUMBER_OF_REGISTERED_APPS; i++) { 262 | [UIPasteboard removePasteboardWithName:[NSString stringWithFormat:@"dragkit-application:%d", i]]; 263 | } 264 | 265 | [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"dragkit-pasteboard"]; 266 | } 267 | 268 | #pragma mark - 269 | #pragma mark Marking Views 270 | 271 | // the key for our associated object. 272 | static char dragKey; 273 | static char contextKey; 274 | static char dataProviderKey; 275 | 276 | - (void)markViewAsDraggable:(UIView *)draggableView forDrag:(NSString *)dragID withDataSource:(NSObject *)dragDataSource context:(void *)context { 277 | 278 | // use associated objects to attach our drag identifier. 279 | objc_setAssociatedObject(draggableView, &dragKey, dragID, OBJC_ASSOCIATION_COPY_NONATOMIC); 280 | 281 | // use associated objects to attach our context. 282 | objc_setAssociatedObject(draggableView, &contextKey, context, OBJC_ASSOCIATION_ASSIGN); 283 | 284 | // attach the drag delegate. 285 | objc_setAssociatedObject(draggableView, &dataProviderKey, dragDataSource, OBJC_ASSOCIATION_ASSIGN); 286 | } 287 | 288 | static char acceptedTypesKey; 289 | static char dragDelegateKey; 290 | static char containsDragViewKey; 291 | 292 | - (void)markViewAsDropTarget:(UIView *)dropView forTypes:(NSArray *)types withDelegate:(NSObject *)dropDelegate { 293 | 294 | objc_setAssociatedObject(dropView, &containsDragViewKey, [NSNumber numberWithBool:NO], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 295 | 296 | // use associated objects to attach our supported types. 297 | objc_setAssociatedObject(dropView, &acceptedTypesKey, types, OBJC_ASSOCIATION_COPY_NONATOMIC); 298 | 299 | // use associated objects to attach our delegate. 300 | objc_setAssociatedObject(dropView, &dragDelegateKey, dropDelegate, OBJC_ASSOCIATION_ASSIGN); 301 | 302 | [dk_dropTargets addObject:dropView]; 303 | } 304 | 305 | - (void)unmarkViewAsDraggable:(UIView *)draggableView { 306 | // clear our associated objects. 307 | objc_setAssociatedObject(draggableView, &dragKey, nil, OBJC_ASSOCIATION_COPY_NONATOMIC); 308 | objc_setAssociatedObject(draggableView, &contextKey, nil, OBJC_ASSOCIATION_ASSIGN); 309 | objc_setAssociatedObject(draggableView, &dataProviderKey, nil, OBJC_ASSOCIATION_ASSIGN); 310 | } 311 | 312 | - (void)unmarkDropTarget:(UIView *)dropView { 313 | 314 | // clear our associated objects. 315 | objc_setAssociatedObject(dropView, &acceptedTypesKey, nil, OBJC_ASSOCIATION_COPY_NONATOMIC); 316 | objc_setAssociatedObject(dropView, &dragDelegateKey, nil, OBJC_ASSOCIATION_ASSIGN); 317 | objc_setAssociatedObject(dropView, &containsDragViewKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 318 | 319 | [dk_dropTargets removeObject:dropView]; 320 | } 321 | 322 | - (void)dk_createDragPasteboardForView:(UIView *)view { 323 | //grab the associated objects. 324 | NSString *dropIdentifier = objc_getAssociatedObject(view, &dragKey); 325 | void *dropContext = objc_getAssociatedObject(view, &contextKey); 326 | NSObject *dataProvider = objc_getAssociatedObject(view, &dataProviderKey); 327 | 328 | 329 | // if we are the data provider, that means we already have a pasteboard. 330 | if (dataProvider == self) { 331 | // set up our current drag types. 332 | 333 | UIPasteboard *dragPasteboard = [UIPasteboard pasteboardWithName:DKPasteboardNameDrag create:YES]; 334 | [dk_currentDragTypes release]; 335 | 336 | dk_currentDragTypes = [[NSArray alloc] initWithArray:[[dragPasteboard pasteboardTypesForItemSet:nil] lastObject]]; 337 | 338 | return; 339 | } 340 | 341 | // clear the drag pasteboard. 342 | [self dk_clearDragPasteboard]; 343 | 344 | // ask for the data and construct a UIPasteboard. 345 | UIPasteboard *dragPasteboard = [UIPasteboard pasteboardWithName:DKPasteboardNameDrag create:YES]; 346 | dragPasteboard.persistent = YES; 347 | 348 | // associate metadata with the pasteboard. 349 | NSMutableDictionary *metadata = [[NSMutableDictionary alloc] init]; 350 | 351 | // add the drag image. if none is set, we can use default. 352 | [metadata setObject:UIImagePNGRepresentation(background) forKey:@"dragImage"]; 353 | 354 | // add the registration for the application that we're dragging from. 355 | [metadata setObject:dk_applicationRegistration forKey:@"draggingApplication"]; 356 | 357 | // set our metadata on our private metadata type. 358 | [dragPasteboard addItems:[NSArray arrayWithObject:[NSDictionary dictionaryWithObject:[NSKeyedArchiver archivedDataWithRootObject:metadata] 359 | forKey:@"dragkit.metadata"]]]; 360 | [metadata release]; 361 | 362 | // go through each type supported by the drop target 363 | // and request the data for that type from the data source. 364 | 365 | NSArray *advertisedTypes = [dataProvider typesSupportedForDrag:dropIdentifier forView:view context:dropContext]; 366 | NSLog(@"advertisedTypes: %@", advertisedTypes); 367 | NSMutableArray *pasteboardTypes = [NSMutableArray array]; 368 | NSMutableArray *justTypes = [NSMutableArray array]; 369 | for (NSString *type in advertisedTypes) { 370 | NSData *data = [dataProvider dataForType:type withDrag:dropIdentifier forView:view context:dropContext]; 371 | 372 | if (data) { 373 | [justTypes addObject:type]; 374 | [pasteboardTypes addObject:[NSDictionary dictionaryWithObject:data forKey:type]]; 375 | } 376 | } 377 | 378 | [dk_currentDragTypes release]; 379 | dk_currentDragTypes = [[NSArray alloc] initWithArray:justTypes]; 380 | 381 | [dragPasteboard addItems:pasteboardTypes]; 382 | } 383 | 384 | #pragma mark - 385 | #pragma mark Dragging Callback 386 | 387 | #define MARGIN_Y (50) 388 | 389 | CGSize touchOffset; 390 | 391 | - (void)dk_springboardOpenItemFromTimer:(NSTimer*)theTimer { 392 | NSLog(@"Timer Fired"); 393 | [self.draggedView setHidden:YES]; 394 | springboard = [dk_mainAppWindow hitTest:lastPoint withEvent:nil]; 395 | [self.draggedView setHidden:NO]; 396 | if ( springboard != nil && [springboard respondsToSelector:@selector(sendActionsForControlEvents:)] ){ 397 | if ( theLayer ) { 398 | [theLayer removeAllAnimations]; 399 | } 400 | theLayer = springboard.layer; 401 | 402 | // taken from AQGridView. 403 | if ([theLayer respondsToSelector: @selector(setShadowPath:)] && [theLayer respondsToSelector: @selector(shadowPath)]) { 404 | NSLog(@"the flash"); 405 | CGMutablePathRef path = CGPathCreateMutable(); 406 | CGPathAddRect( path, NULL, theLayer.bounds ); 407 | theLayer.shadowPath = path; 408 | CGPathRelease( path ); 409 | // TODO should really save all of these settings before changing them so that they can be restored later 410 | theLayer.shadowOffset = CGSizeZero; 411 | theLayer.shadowColor = [[UIColor blueColor] CGColor]; 412 | theLayer.shadowRadius = 0.0; 413 | theLayer.shadowOpacity = 10.0; 414 | 415 | CABasicAnimation *animator = [CABasicAnimation animationWithKeyPath:@"shadowRadius"]; 416 | animator.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 417 | animator.duration = 0.1; 418 | animator.fromValue = [NSNumber numberWithFloat:0.0]; 419 | animator.toValue = [NSNumber numberWithFloat:12.0]; 420 | animator.delegate = self; 421 | animator.repeatCount = 2; 422 | animator.autoreverses = YES; 423 | 424 | [theLayer addAnimation:animator forKey:@"theFlash"]; 425 | } 426 | 427 | 428 | } 429 | } 430 | 431 | - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag { 432 | theLayer.shadowPath = nil; 433 | theLayer.shadowColor = nil; 434 | if ( flag ) { 435 | NSLog(@"send event to class: %@", NSStringFromClass([springboard class])); 436 | [(UIControl*)springboard sendActionsForControlEvents:(UIControlEventTouchDown | UIControlEventTouchUpInside)]; 437 | } else { 438 | NSLog(@"Animation canceled"); 439 | } 440 | } 441 | 442 | CGPoint lastTouch; 443 | 444 | - (void)dk_handleLongPress:(UIGestureRecognizer *)sender { 445 | // let the drag server know our frame and that we want to start dragging. 446 | 447 | CGPoint touchPoint = [sender locationInView:[self dk_mainAppWindow]]; 448 | CGPoint viewPosition; 449 | CGFloat windowWidth; 450 | UIView *droppedTarget; 451 | UIView *dragView; 452 | 453 | switch ([sender state]) { 454 | case UIGestureRecognizerStateBegan: 455 | 456 | // create the necessary view and animate it. 457 | [self dk_hideHoldingArea]; 458 | 459 | dragView = [self dk_dragViewUnderPoint:touchPoint]; 460 | 461 | if (!dragView) { 462 | [sender setState:UIGestureRecognizerStateFailed]; 463 | return; 464 | } 465 | 466 | self.originalView = dragView; 467 | 468 | // our touch offset is just 0,0, which makes it the center. 469 | touchOffset = CGSizeMake(0,70); 470 | 471 | CGPoint position = CGPointMake(touchPoint.x - touchOffset.width, touchPoint.y - touchOffset.height); 472 | 473 | [self dk_displayDragViewForView:self.originalView atPoint:position]; 474 | 475 | // create our drag pasteboard with the proper types. 476 | [self dk_createDragPasteboardForView:dragView]; 477 | 478 | break; 479 | case UIGestureRecognizerStateChanged: 480 | 481 | // move the view to any point the sender is. 482 | // check for drop zones and light them up if necessary. 483 | 484 | windowWidth = [[self dk_mainAppWindow] frame].size.width; 485 | 486 | [self dk_messageTargetsHitByPoint:touchPoint]; 487 | 488 | viewPosition = CGPointMake(touchPoint.x - touchOffset.width, touchPoint.y - touchOffset.height); 489 | 490 | lastPoint = CGPointMake(touchPoint.x, touchPoint.y); 491 | 492 | if ( !self.pausedTimer || ![self.pausedTimer isValid] ) { 493 | // no timer, update point 494 | if ( (((lastPoint.x - pausedPoint.x) * 495 | (lastPoint.x - pausedPoint.x)) + 496 | ((lastPoint.y - pausedPoint.y) * 497 | (lastPoint.y - pausedPoint.y))) > 200 ) { 498 | // only make a new one if we moved enough 499 | pausedPoint = lastPoint; 500 | self.pausedTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(dk_springboardOpenItemFromTimer:) userInfo:nil repeats:NO]; 501 | } else if ((((lastPoint.x - pausedPoint.x) * 502 | (lastPoint.x - pausedPoint.x)) + 503 | ((lastPoint.y - pausedPoint.y) * 504 | (lastPoint.y - pausedPoint.y))) > 40) { 505 | // moved too much, cancel the animation 506 | if ( theLayer ) { 507 | [theLayer removeAllAnimations]; 508 | } 509 | } 510 | } else if ( (((lastPoint.x - pausedPoint.x) * 511 | (lastPoint.x - pausedPoint.x)) + 512 | ((lastPoint.y - pausedPoint.y) * 513 | (lastPoint.y - pausedPoint.y))) > 20 ) { 514 | // we moved too much, cancel timer 515 | [self.pausedTimer invalidate]; 516 | // now make a new one 517 | pausedPoint = lastPoint; 518 | self.pausedTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(dk_springboardOpenItemFromTimer:) userInfo:nil repeats:NO]; 519 | } 520 | 521 | [self dk_moveDragViewToPoint:viewPosition]; 522 | 523 | break; 524 | case UIGestureRecognizerStateRecognized: 525 | [self.pausedTimer invalidate]; 526 | self.pausedTimer = nil; 527 | if ( theLayer ) { 528 | [theLayer removeAllAnimations]; 529 | } 530 | 531 | droppedTarget = [self dk_dropTargetHitByPoint:lastPoint]; 532 | 533 | NSObject *dragDelegate = objc_getAssociatedObject(droppedTarget, &dragDelegateKey); 534 | 535 | if (droppedTarget) { 536 | 537 | if ([dragDelegate respondsToSelector:@selector(drag:completedOnTargetView:withDragPasteboard:context:)]) { 538 | 539 | //grab the associated objects. 540 | NSString *dropIdentifier = objc_getAssociatedObject(droppedTarget, &dragKey); 541 | void *dropContext = objc_getAssociatedObject(droppedTarget, &contextKey); 542 | 543 | // ask for the data and construct a UIPasteboard. 544 | UIPasteboard *dragPasteboard = [UIPasteboard pasteboardWithName:DKPasteboardNameDrag create:NO]; 545 | 546 | [dragDelegate drag:dropIdentifier completedOnTargetView:droppedTarget withDragPasteboard:dragPasteboard context:dropContext]; 547 | 548 | [dragPasteboard setItems:nil]; 549 | } 550 | 551 | // collapse the drag view into the drop view. 552 | [self dk_collapseDragView]; 553 | 554 | // de-highlight the view. 555 | [self dk_setView:droppedTarget highlighted:NO animated:YES]; 556 | 557 | } else { 558 | [self cancelDrag]; 559 | } 560 | 561 | break; 562 | case UIGestureRecognizerStateCancelled: 563 | [self.pausedTimer invalidate]; 564 | self.pausedTimer = nil; 565 | if ( theLayer ) { 566 | [theLayer removeAllAnimations]; 567 | } 568 | 569 | // something happened and we need to cancel. 570 | [self cancelDrag]; 571 | 572 | break; 573 | default: 574 | break; 575 | } 576 | 577 | lastTouch = [sender locationInView:[self dk_mainAppWindow]]; 578 | } 579 | 580 | - (UIView *)dk_viewContainingKey:(void *)key forPoint:(CGPoint)point { 581 | 582 | UIView *currentView = [[self dk_mainAppWindow] hitTest:point withEvent:nil]; 583 | 584 | id obj = nil; 585 | 586 | while (currentView) { 587 | obj = objc_getAssociatedObject(currentView, key); 588 | 589 | if (obj) return currentView; 590 | currentView = [currentView superview]; 591 | } 592 | 593 | return nil; 594 | } 595 | 596 | - (UIView *)dk_dragViewUnderPoint:(CGPoint)point { 597 | return [self dk_viewContainingKey:&dataProviderKey forPoint:point]; 598 | } 599 | 600 | - (UIView *)dk_dropTargetHitByPoint:(CGPoint)point { 601 | 602 | for (UIView *dropTarget in dk_dropTargets) { 603 | CGRect frameInWindow = [[dropTarget superview] convertRect:dropTarget.frame toView:[self dk_mainAppWindow]]; 604 | if (CGRectContainsPoint(frameInWindow, point)) { 605 | NSArray *acceptedTypes = objc_getAssociatedObject(dropTarget, &acceptedTypesKey); 606 | if ([[NSSet setWithArray:acceptedTypes] intersectsSet:[NSSet setWithArray:dk_currentDragTypes]]) { 607 | return dropTarget; 608 | } 609 | } 610 | } 611 | 612 | return nil; 613 | } 614 | 615 | UIView *lastView = nil; 616 | - (void)dk_messageTargetsHitByPoint:(CGPoint)point { 617 | //go through the drop targets and find out of the point is in any of those rects. 618 | 619 | UIView *dropTarget = [self dk_dropTargetHitByPoint:point]; 620 | 621 | if (!dropTarget && lastView) { 622 | 623 | objc_setAssociatedObject(lastView, &containsDragViewKey, [NSNumber numberWithBool:NO], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 624 | 625 | NSObject *dragDelegate = objc_getAssociatedObject(lastView, &dragDelegateKey); 626 | 627 | if ([dragDelegate respondsToSelector:@selector(dragDidLeaveTargetView:)]) { 628 | [dragDelegate dragDidLeaveTargetView:dropTarget]; 629 | } 630 | 631 | [self dk_setView:lastView highlighted:NO animated:YES]; 632 | 633 | [lastView release]; 634 | lastView = nil; 635 | 636 | return; 637 | } 638 | 639 | NSArray *acceptedTypes = objc_getAssociatedObject(dropTarget, &acceptedTypesKey); 640 | NSObject *dragDelegate = objc_getAssociatedObject(dropTarget, &dragDelegateKey); 641 | BOOL containsDragView = [(NSNumber *)objc_getAssociatedObject(dropTarget, &containsDragViewKey) boolValue]; 642 | 643 | if ([[NSSet setWithArray:acceptedTypes] intersectsSet:[NSSet setWithArray:dk_currentDragTypes]]) { 644 | 645 | [self dk_setView:dropTarget highlighted:YES animated:YES]; 646 | 647 | if (!containsDragView && [dragDelegate respondsToSelector:@selector(dragDidEnterTargetView:)]) { 648 | [dragDelegate dragDidEnterTargetView:dropTarget]; 649 | } 650 | 651 | lastView = [dropTarget retain]; 652 | 653 | objc_setAssociatedObject(dropTarget, &containsDragViewKey, [NSNumber numberWithBool:YES], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 654 | } 655 | } 656 | 657 | - (void)dk_setView:(UIView *)view highlighted:(BOOL)highlighted animated:(BOOL)animated { 658 | 659 | CALayer *dropLayer = view.layer; 660 | 661 | if (animated) { 662 | [UIView beginAnimations: @"HighlightView" context: NULL]; 663 | [UIView setAnimationCurve: UIViewAnimationCurveLinear]; 664 | [UIView setAnimationBeginsFromCurrentState: YES]; 665 | } 666 | 667 | // taken from AQGridView. 668 | if ([dropLayer respondsToSelector: @selector(setShadowPath:)] && [dropLayer respondsToSelector: @selector(shadowPath)]) { 669 | 670 | if (highlighted) { 671 | CGMutablePathRef path = CGPathCreateMutable(); 672 | CGPathAddRect( path, NULL, dropLayer.bounds ); 673 | dropLayer.shadowPath = path; 674 | CGPathRelease( path ); 675 | 676 | dropLayer.shadowOffset = CGSizeZero; 677 | 678 | dropLayer.shadowColor = [[UIColor darkGrayColor] CGColor]; 679 | dropLayer.shadowRadius = 12.0; 680 | 681 | dropLayer.shadowOpacity = 1.0; 682 | 683 | } else { 684 | dropLayer.shadowOpacity = 0.0; 685 | } 686 | } 687 | 688 | if (animated) [UIView commitAnimations]; 689 | } 690 | 691 | // we are going to zoom from this image to the normal view for the content type. 692 | 693 | - (UIImage *)dk_generateImageFromView:(UIView *)theView { 694 | 695 | if (!theView) return nil; 696 | 697 | UIGraphicsBeginImageContext(theView.bounds.size); 698 | 699 | [theView.layer renderInContext:UIGraphicsGetCurrentContext()]; 700 | UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext(); 701 | 702 | UIGraphicsEndImageContext(); 703 | 704 | return resultingImage; 705 | } 706 | 707 | #pragma mark - 708 | #pragma mark Drag View Creation 709 | 710 | - (void)dk_displayDragViewForView:(UIView *)draggableView atPoint:(CGPoint)point { 711 | if (!self.draggedView) { 712 | 713 | // transition from the dragImage to our view. 714 | NSString *dropIdentifier = objc_getAssociatedObject(draggableView, &dragKey); 715 | void *dropContext = objc_getAssociatedObject(draggableView, &contextKey); 716 | NSObject *dataProvider = objc_getAssociatedObject(draggableView, &dataProviderKey); 717 | 718 | UIImage *overlay = [UIImage imageNamed:@"drag_overlay.png"]; 719 | background = nil; 720 | if ([dataProvider respondsToSelector:@selector(imageForDrag:forView:context:)]) { 721 | background = [dataProvider imageForDrag:dropIdentifier forView:draggableView context:dropContext]; 722 | } else { 723 | 724 | UIPasteboard *dragPasteboard = [UIPasteboard pasteboardWithName:DKPasteboardNameDrag create:YES]; 725 | 726 | NSDictionary *metadata = [NSKeyedUnarchiver unarchiveObjectWithData:[[dragPasteboard valuesForPasteboardType:@"dragkit.metadata" inItemSet:nil] lastObject]]; 727 | 728 | NSData *imageData = [metadata objectForKey:@"dragImage"]; 729 | 730 | if (imageData) { 731 | background = [UIImage imageWithData:imageData]; 732 | } 733 | 734 | if (!imageData || !background) { 735 | background = [UIImage imageNamed:@"drag_default.png"]; 736 | } 737 | } 738 | 739 | // create our drag view where we want it. 740 | self.draggedView = [[[UIView alloc] initWithFrame:CGRectMake((int)(point.x - overlay.size.width / 2.0), 741 | (int)(point.y - overlay.size.height / 2.0), 742 | overlay.size.width, 743 | overlay.size.height)] autorelease]; 744 | 745 | UIImageView *backgroundImageView = [[UIImageView alloc] initWithFrame:CGRectMake(8, 4, 108, 108)]; 746 | backgroundImageView.image = background; 747 | backgroundImageView.contentMode = UIViewContentModeScaleAspectFit; 748 | backgroundImageView.layer.cornerRadius = 10; 749 | backgroundImageView.clipsToBounds = YES; 750 | 751 | UIImageView *dragImageView = [[UIImageView alloc] initWithFrame:self.draggedView.bounds]; 752 | dragImageView.image = overlay; 753 | 754 | [self.draggedView addSubview:backgroundImageView]; 755 | [self.draggedView addSubview:dragImageView]; 756 | 757 | [backgroundImageView release]; 758 | [dragImageView release]; 759 | 760 | [[self dk_mainAppWindow] addSubview:self.draggedView]; 761 | 762 | if (draggableView) { 763 | 764 | self.draggedView.transform = CGAffineTransformMakeTranslation(touchOffset.width, touchOffset.height); 765 | self.draggedView.transform = CGAffineTransformScale(self.draggedView.transform, 0.001, 0.001); 766 | self.draggedView.alpha = 0.0; 767 | 768 | [UIView beginAnimations:@"DragExpand" context:NULL]; 769 | [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; 770 | [UIView setAnimationDuration:.3]; 771 | [UIView setAnimationDelegate:self]; 772 | [UIView setAnimationDidStopSelector:@selector(cancelAnimationDidStop:finished:context:)]; 773 | 774 | self.draggedView.transform = CGAffineTransformIdentity; 775 | self.draggedView.alpha = 1.0; 776 | 777 | [UIView commitAnimations]; 778 | } 779 | } 780 | } 781 | 782 | - (void)dk_moveDragViewToPoint:(CGPoint)point { 783 | 784 | if (!self.draggedView) { 785 | NSLog(@"ERROR: No drag view."); 786 | return; 787 | } 788 | 789 | self.draggedView.frame = CGRectMake((int)(point.x - self.draggedView.frame.size.width / 2.0), 790 | (int)(point.y - self.draggedView.frame.size.height / 2.0), 791 | self.draggedView.frame.size.width, 792 | self.draggedView.frame.size.height); 793 | } 794 | 795 | - (void)dk_collapseDragView { 796 | 797 | [UIView beginAnimations:@"DropSuck" context:NULL]; 798 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 799 | [UIView setAnimationDuration:.3]; 800 | [UIView setAnimationDelegate:self]; 801 | [UIView setAnimationDidStopSelector:@selector(cancelAnimationDidStop:finished:context:)]; 802 | 803 | self.draggedView.transform = CGAffineTransformMakeScale(0.001, 0.001); 804 | self.draggedView.alpha = 0.0; 805 | self.draggedView.center = CGPointMake(self.draggedView.center.x + touchOffset.width, self.draggedView.center.y + touchOffset.height); 806 | 807 | [UIView commitAnimations]; 808 | } 809 | 810 | - (void)dk_clearDragPasteboard { 811 | 812 | [dk_currentDragTypes release]; 813 | dk_currentDragTypes = nil; 814 | 815 | UIPasteboard *pasteboard = [UIPasteboard pasteboardWithName:DKPasteboardNameDrag create:YES]; 816 | pasteboard.persistent = NO; 817 | [pasteboard setItems:nil]; 818 | } 819 | 820 | - (void)cancelDrag { 821 | // cancel the window by animating it back to its location. 822 | 823 | [self dk_clearDragPasteboard]; 824 | 825 | CGPoint originalLocation = [[self.originalView superview] convertPoint:self.originalView.center toView:[self dk_mainAppWindow]]; 826 | 827 | [UIView beginAnimations:@"SnapBack" context:nil]; 828 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 829 | [UIView setAnimationDuration:.3]; 830 | [UIView setAnimationDelegate:self]; 831 | [UIView setAnimationDidStopSelector:@selector(cancelAnimationDidStop:finished:context:)]; 832 | 833 | // go back to original size. 834 | 835 | // move back to original location. 836 | self.draggedView.center = originalLocation; 837 | 838 | // fade out. 839 | self.draggedView.alpha = 0.5; 840 | 841 | [UIView commitAnimations]; 842 | } 843 | 844 | - (void)cancelAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { 845 | 846 | if ([animationID isEqualToString:@"SnapBack"] || [animationID isEqualToString:@"DropSuck"]) { 847 | 848 | [self.draggedView removeFromSuperview]; 849 | self.draggedView = nil; 850 | 851 | } 852 | } 853 | 854 | #pragma mark - 855 | #pragma mark Holding Area Drawing 856 | 857 | - (void)dk_showHoldingAreaForPasteboard:(UIPasteboard *)pasteboard { 858 | 859 | UIWindow *mainWindow = [self dk_mainAppWindow]; 860 | 861 | dk_holdingArea = [[UIView alloc] initWithFrame:mainWindow.bounds]; 862 | dk_holdingArea.backgroundColor = [UIColor blackColor]; 863 | dk_holdingArea.alpha = 0.0; 864 | 865 | [mainWindow addSubview:dk_holdingArea]; 866 | 867 | [self dk_displayDragViewForView:nil atPoint:CGPointMake(mainWindow.frame.size.width / 2.0, mainWindow.frame.size.height / 2.0)]; 868 | self.draggedView.alpha = 0.0; 869 | 870 | // use associated objects to attach our drag identifier. 871 | objc_setAssociatedObject(self.draggedView, &dragKey, @"DragKit-Internal", OBJC_ASSOCIATION_COPY_NONATOMIC); 872 | // attach the drag delegate. 873 | objc_setAssociatedObject(self.draggedView, &dataProviderKey, self, OBJC_ASSOCIATION_ASSIGN); 874 | 875 | UIPanGestureRecognizer *dragGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(dk_handleLongPress:)]; 876 | [self.draggedView addGestureRecognizer:dragGesture]; 877 | [dragGesture release]; 878 | 879 | [UIView beginAnimations:@"HoldingAreaShow" context:nil]; 880 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 881 | [UIView setAnimationDuration:0.3]; 882 | 883 | dk_holdingArea.alpha = 0.4; 884 | self.draggedView.alpha = 1.0; 885 | 886 | [UIView commitAnimations]; 887 | } 888 | 889 | - (void)dk_hideHoldingArea { 890 | [UIView beginAnimations:@"HoldingAreaHide" context:nil]; 891 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 892 | [UIView setAnimationDuration:0.3]; 893 | [UIView setAnimationDelegate:self]; 894 | [UIView setAnimationDidStopSelector:@selector(hideAnimationDidStop:finished:context:)]; 895 | 896 | dk_holdingArea.alpha = 0.0; 897 | 898 | [UIView commitAnimations]; 899 | } 900 | 901 | - (void)hideAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { 902 | [dk_holdingArea removeFromSuperview]; 903 | } 904 | 905 | - (void)dealloc { 906 | 907 | [dk_applicationRegistration release]; 908 | [dk_dropTargets release]; 909 | [dk_mainAppWindow release]; 910 | 911 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 912 | 913 | [super dealloc]; 914 | } 915 | 916 | @end 917 | -------------------------------------------------------------------------------- /Drag/iPhone/MainWindow_Phone.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10F569 6 | 788 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 117 12 | 13 | 14 | 15 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 16 | 17 | 18 | 19 | 20 | IBFilesOwner 21 | IBCocoaTouchFramework 22 | 23 | 24 | IBFirstResponder 25 | IBCocoaTouchFramework 26 | 27 | 28 | IBCocoaTouchFramework 29 | 30 | 31 | 32 | 1316 33 | 34 | {320, 480} 35 | 36 | 1 37 | MSAxIDEAA 38 | 39 | NO 40 | NO 41 | 42 | IBCocoaTouchFramework 43 | YES 44 | 45 | 46 | 47 | 48 | 274 49 | 50 | 51 | 52 | 290 53 | {320, 44} 54 | 55 | IBCocoaTouchFramework 56 | 57 | 58 | 59 | Title 60 | 61 | Item 62 | IBCocoaTouchFramework 63 | 1 64 | 65 | 66 | IBCocoaTouchFramework 67 | 68 | 69 | 70 | 71 | 72 | 292 73 | {{126, 57}, {67, 39}} 74 | 75 | 76 | 3 77 | MC44NDMwNjU2OTM0AA 78 | 79 | NO 80 | YES 81 | 7 82 | IBCocoaTouchFramework 83 | Word 84 | 85 | 1 86 | MCAwIDAAA 87 | 88 | 89 | 1 90 | 10 91 | 1 92 | 93 | 94 | 95 | 292 96 | {{9, 184}, {300, 44}} 97 | 98 | NO 99 | IBCocoaTouchFramework 100 | 2 101 | 0 102 | 103 | First 104 | Second 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | {0, 0} 116 | {0, 0} 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 292 126 | {{57, 117}, {206, 37}} 127 | 128 | 129 | 3 130 | MC44NjQ5NjM1MDM2AA 131 | 132 | NO 133 | IBCocoaTouchFramework 134 | 0 135 | 0 136 | 137 | Helvetica-Bold 138 | 15 139 | 16 140 | 141 | Reset 142 | 143 | 3 144 | MQA 145 | 146 | 147 | 1 148 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 149 | 150 | 151 | 3 152 | MC41AA 153 | 154 | 155 | 156 | 157 | 292 158 | {{20, 257}, {280, 124}} 159 | 160 | 161 | 3 162 | MC43NzczNzIyNjI4AA 163 | 164 | IBCocoaTouchFramework 165 | 166 | 167 | 168 | 266 169 | {{0, 411}, {320, 49}} 170 | 171 | 172 | 3 173 | MCAwAA 174 | 175 | IBCocoaTouchFramework 176 | 177 | 178 | IBCocoaTouchFramework 179 | 180 | 1 181 | 182 | 183 | IBCocoaTouchFramework 184 | 185 | 2 186 | 187 | 188 | IBCocoaTouchFramework 189 | 190 | 0 191 | 192 | 193 | 194 | 195 | {320, 460} 196 | 197 | 3 198 | MQA 199 | 200 | 2 201 | 202 | 203 | IBCocoaTouchFramework 204 | 205 | 206 | 207 | 1 208 | 209 | IBCocoaTouchFramework 210 | NO 211 | 212 | 213 | 214 | 215 | 216 | 217 | delegate 218 | 219 | 220 | 221 | 5 222 | 223 | 224 | 225 | window 226 | 227 | 228 | 229 | 6 230 | 231 | 232 | 233 | rootViewController 234 | 235 | 236 | 237 | 15 238 | 239 | 240 | 241 | top 242 | 243 | 244 | 245 | 17 246 | 247 | 248 | 249 | drop 250 | 251 | 252 | 253 | 18 254 | 255 | 256 | 257 | reset: 258 | 259 | 260 | 7 261 | 262 | 20 263 | 264 | 265 | 266 | segmentChanged: 267 | 268 | 269 | 13 270 | 271 | 31 272 | 273 | 274 | 275 | navBar: 276 | 277 | 278 | 279 | 32 280 | 281 | 282 | 283 | delegate 284 | 285 | 286 | 287 | 34 288 | 289 | 290 | 291 | 292 | 293 | 0 294 | 295 | 296 | 297 | 298 | 299 | 2 300 | 301 | 302 | 303 | 304 | 305 | -1 306 | 307 | 308 | File's Owner 309 | 310 | 311 | 4 312 | 313 | 314 | App Delegate 315 | 316 | 317 | -2 318 | 319 | 320 | 321 | 322 | 9 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 13 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 14 344 | 345 | 346 | 347 | 348 | 16 349 | 350 | 351 | 352 | 353 | 19 354 | 355 | 356 | 357 | 358 | 21 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 22 369 | 370 | 371 | 372 | 373 | 23 374 | 375 | 376 | 377 | 378 | 24 379 | 380 | 381 | 382 | 383 | 25 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 28 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 29 400 | 401 | 402 | 403 | 404 | 30 405 | 406 | 407 | 408 | 409 | 410 | 411 | UIApplication 412 | UIResponder 413 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 414 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 415 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 416 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 417 | 418 | {{520, 778}, {0, -22}} 419 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 420 | 421 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 422 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 423 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 424 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 425 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 426 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 427 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 428 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 429 | AppDelegate_Phone 430 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 431 | DragViewController_Phone 432 | {{216, 125}, {320, 480}} 433 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 434 | 435 | 436 | 437 | 438 | 439 | 34 440 | 441 | 442 | 443 | 444 | AppDelegate_Phone 445 | NSObject 446 | 447 | window 448 | UIWindow 449 | 450 | 451 | window 452 | 453 | window 454 | UIWindow 455 | 456 | 457 | 458 | IBProjectSource 459 | iPhone/AppDelegate_Phone.h 460 | 461 | 462 | 463 | AppDelegate_Phone 464 | NSObject 465 | 466 | IBUserSource 467 | 468 | 469 | 470 | 471 | DragViewController_Phone 472 | UIViewController 473 | 474 | id 475 | id 476 | id 477 | id 478 | 479 | 480 | 481 | navBar: 482 | id 483 | 484 | 485 | reset: 486 | id 487 | 488 | 489 | segmentChanged: 490 | id 491 | 492 | 493 | tabBar: 494 | id 495 | 496 | 497 | 498 | UIView 499 | UILabel 500 | 501 | 502 | 503 | drop 504 | UIView 505 | 506 | 507 | top 508 | UILabel 509 | 510 | 511 | 512 | IBUserSource 513 | 514 | 515 | 516 | 517 | 518 | 519 | NSObject 520 | 521 | IBFrameworkSource 522 | Foundation.framework/Headers/NSError.h 523 | 524 | 525 | 526 | NSObject 527 | 528 | IBFrameworkSource 529 | Foundation.framework/Headers/NSFileManager.h 530 | 531 | 532 | 533 | NSObject 534 | 535 | IBFrameworkSource 536 | Foundation.framework/Headers/NSKeyValueCoding.h 537 | 538 | 539 | 540 | NSObject 541 | 542 | IBFrameworkSource 543 | Foundation.framework/Headers/NSKeyValueObserving.h 544 | 545 | 546 | 547 | NSObject 548 | 549 | IBFrameworkSource 550 | Foundation.framework/Headers/NSKeyedArchiver.h 551 | 552 | 553 | 554 | NSObject 555 | 556 | IBFrameworkSource 557 | Foundation.framework/Headers/NSNetServices.h 558 | 559 | 560 | 561 | NSObject 562 | 563 | IBFrameworkSource 564 | Foundation.framework/Headers/NSObject.h 565 | 566 | 567 | 568 | NSObject 569 | 570 | IBFrameworkSource 571 | Foundation.framework/Headers/NSPort.h 572 | 573 | 574 | 575 | NSObject 576 | 577 | IBFrameworkSource 578 | Foundation.framework/Headers/NSRunLoop.h 579 | 580 | 581 | 582 | NSObject 583 | 584 | IBFrameworkSource 585 | Foundation.framework/Headers/NSStream.h 586 | 587 | 588 | 589 | NSObject 590 | 591 | IBFrameworkSource 592 | Foundation.framework/Headers/NSThread.h 593 | 594 | 595 | 596 | NSObject 597 | 598 | IBFrameworkSource 599 | Foundation.framework/Headers/NSURL.h 600 | 601 | 602 | 603 | NSObject 604 | 605 | IBFrameworkSource 606 | Foundation.framework/Headers/NSURLConnection.h 607 | 608 | 609 | 610 | NSObject 611 | 612 | IBFrameworkSource 613 | Foundation.framework/Headers/NSXMLParser.h 614 | 615 | 616 | 617 | NSObject 618 | 619 | IBFrameworkSource 620 | QuartzCore.framework/Headers/CAAnimation.h 621 | 622 | 623 | 624 | NSObject 625 | 626 | IBFrameworkSource 627 | QuartzCore.framework/Headers/CALayer.h 628 | 629 | 630 | 631 | NSObject 632 | 633 | IBFrameworkSource 634 | UIKit.framework/Headers/UIAccessibility.h 635 | 636 | 637 | 638 | NSObject 639 | 640 | IBFrameworkSource 641 | UIKit.framework/Headers/UINibLoading.h 642 | 643 | 644 | 645 | NSObject 646 | 647 | IBFrameworkSource 648 | UIKit.framework/Headers/UIResponder.h 649 | 650 | 651 | 652 | UIApplication 653 | UIResponder 654 | 655 | IBFrameworkSource 656 | UIKit.framework/Headers/UIApplication.h 657 | 658 | 659 | 660 | UIBarButtonItem 661 | UIBarItem 662 | 663 | IBFrameworkSource 664 | UIKit.framework/Headers/UIBarButtonItem.h 665 | 666 | 667 | 668 | UIBarItem 669 | NSObject 670 | 671 | IBFrameworkSource 672 | UIKit.framework/Headers/UIBarItem.h 673 | 674 | 675 | 676 | UIButton 677 | UIControl 678 | 679 | IBFrameworkSource 680 | UIKit.framework/Headers/UIButton.h 681 | 682 | 683 | 684 | UIControl 685 | UIView 686 | 687 | IBFrameworkSource 688 | UIKit.framework/Headers/UIControl.h 689 | 690 | 691 | 692 | UILabel 693 | UIView 694 | 695 | IBFrameworkSource 696 | UIKit.framework/Headers/UILabel.h 697 | 698 | 699 | 700 | UINavigationBar 701 | UIView 702 | 703 | IBFrameworkSource 704 | UIKit.framework/Headers/UINavigationBar.h 705 | 706 | 707 | 708 | UINavigationItem 709 | NSObject 710 | 711 | 712 | 713 | UIResponder 714 | NSObject 715 | 716 | 717 | 718 | UISearchBar 719 | UIView 720 | 721 | IBFrameworkSource 722 | UIKit.framework/Headers/UISearchBar.h 723 | 724 | 725 | 726 | UISearchDisplayController 727 | NSObject 728 | 729 | IBFrameworkSource 730 | UIKit.framework/Headers/UISearchDisplayController.h 731 | 732 | 733 | 734 | UISegmentedControl 735 | UIControl 736 | 737 | IBFrameworkSource 738 | UIKit.framework/Headers/UISegmentedControl.h 739 | 740 | 741 | 742 | UITabBar 743 | UIView 744 | 745 | IBFrameworkSource 746 | UIKit.framework/Headers/UITabBar.h 747 | 748 | 749 | 750 | UITabBarItem 751 | UIBarItem 752 | 753 | IBFrameworkSource 754 | UIKit.framework/Headers/UITabBarItem.h 755 | 756 | 757 | 758 | UIView 759 | 760 | IBFrameworkSource 761 | UIKit.framework/Headers/UITextField.h 762 | 763 | 764 | 765 | UIView 766 | UIResponder 767 | 768 | IBFrameworkSource 769 | UIKit.framework/Headers/UIView.h 770 | 771 | 772 | 773 | UIViewController 774 | 775 | IBFrameworkSource 776 | UIKit.framework/Headers/UINavigationController.h 777 | 778 | 779 | 780 | UIViewController 781 | 782 | IBFrameworkSource 783 | UIKit.framework/Headers/UIPopoverController.h 784 | 785 | 786 | 787 | UIViewController 788 | 789 | IBFrameworkSource 790 | UIKit.framework/Headers/UISplitViewController.h 791 | 792 | 793 | 794 | UIViewController 795 | 796 | IBFrameworkSource 797 | UIKit.framework/Headers/UITabBarController.h 798 | 799 | 800 | 801 | UIViewController 802 | UIResponder 803 | 804 | IBFrameworkSource 805 | UIKit.framework/Headers/UIViewController.h 806 | 807 | 808 | 809 | UIWindow 810 | UIView 811 | 812 | IBFrameworkSource 813 | UIKit.framework/Headers/UIWindow.h 814 | 815 | 816 | 817 | 818 | 0 819 | IBCocoaTouchFramework 820 | 821 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 822 | 823 | 824 | 825 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 826 | 827 | 828 | 829 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 830 | 831 | 832 | YES 833 | ../Drag.xcodeproj 834 | 3 835 | 117 836 | 837 | 838 | --------------------------------------------------------------------------------