This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

ARC support added

  • Loading branch information...
stkim1 committed Jan 22, 2013
1 parent c731278 commit 3e2fb6ea287e4e5ee0dca7d4c0e16f2e4d94c28e
Showing with 1,624 additions and 220 deletions.
  1. +338 −0 Image Map (ARC)/Image Map (ARC).xcodeproj/project.pbxproj
  2. +7 −0 Image Map (ARC)/Image Map (ARC).xcodeproj/project.xcworkspace/contents.xcworkspacedata
  3. BIN ...).xcodeproj/project.xcworkspace/xcuserdata/almightykim.xcuserdatad/UserInterfaceState.xcuserstate
  4. +86 −0 ...)/Image Map (ARC).xcodeproj/xcuserdata/almightykim.xcuserdatad/xcschemes/Image Map (ARC).xcscheme
  5. +22 −0 ...)/Image Map (ARC).xcodeproj/xcuserdata/almightykim.xcuserdatad/xcschemes/xcschememanagement.plist
  6. +38 −0 Image Map (ARC)/Image Map (ARC)/AppDelegate.h
  7. +45 −0 Image Map (ARC)/Image Map (ARC)/AppDelegate.m
  8. BIN {ImageMap → Image Map (ARC)/Image Map (ARC)}/Default-568h@2x.png
  9. BIN {ImageMap → Image Map (ARC)/Image Map (ARC)}/Default.png
  10. BIN {ImageMap → Image Map (ARC)/Image Map (ARC)}/Default@2x.png
  11. 0 ImageMap/ImageMap-Info.plist → Image Map (ARC)/Image Map (ARC)/Image Map (ARC)-Info.plist
  12. +14 −0 Image Map (ARC)/Image Map (ARC)/Image Map (ARC)-Prefix.pch
  13. +40 −0 Image Map (ARC)/Image Map (ARC)/ViewController.h
  14. +103 −0 Image Map (ARC)/Image Map (ARC)/ViewController.m
  15. 0 {ImageMap → Image Map (ARC)/Image Map (ARC)}/en.lproj/InfoPlist.strings
  16. +40 −0 Image Map (ARC)/Image Map (ARC)/main.m
  17. +335 −0 Image Map (MRC)/Image Map (MRC).xcodeproj/project.pbxproj
  18. +7 −0 Image Map (MRC)/Image Map (MRC).xcodeproj/project.xcworkspace/contents.xcworkspacedata
  19. BIN ...).xcodeproj/project.xcworkspace/xcuserdata/almightykim.xcuserdatad/UserInterfaceState.xcuserstate
  20. +86 −0 ...)/Image Map (MRC).xcodeproj/xcuserdata/almightykim.xcuserdatad/xcschemes/Image Map (MRC).xcscheme
  21. +22 −0 ...)/Image Map (MRC).xcodeproj/xcuserdata/almightykim.xcuserdatad/xcschemes/xcschememanagement.plist
  22. +39 −0 Image Map (MRC)/Image Map (MRC)/AppDelegate.h
  23. +52 −0 Image Map (MRC)/Image Map (MRC)/AppDelegate.m
  24. BIN Image Map (MRC)/Image Map (MRC)/Default-568h@2x.png
  25. BIN Image Map (MRC)/Image Map (MRC)/Default.png
  26. BIN Image Map (MRC)/Image Map (MRC)/Default@2x.png
  27. +36 −0 Image Map (MRC)/Image Map (MRC)/Image Map (MRC)-Info.plist
  28. +14 −0 Image Map (MRC)/Image Map (MRC)/Image Map (MRC)-Prefix.pch
  29. +39 −0 Image Map (MRC)/Image Map (MRC)/ViewController.h
  30. +29 −9 {ImageMap → Image Map (MRC)/Image Map (MRC)}/ViewController.m
  31. +2 −0 Image Map (MRC)/Image Map (MRC)/en.lproj/InfoPlist.strings
  32. +40 −0 Image Map (MRC)/Image Map (MRC)/main.m
  33. BIN ...p.xcodeproj/project.xcworkspace/xcuserdata/almightykim.xcuserdatad/UserInterfaceState.xcuserstate
  34. BIN ImageMap/.DS_Store
  35. +0 −19 ImageMap/AppDelegate.h
  36. +0 −59 ImageMap/AppDelegate.m
  37. +0 −14 ImageMap/ImageMap-Prefix.pch
  38. +0 −17 ImageMap/ViewController.h
  39. +0 −18 ImageMap/main.m
  40. BIN ImageMapView/.DS_Store
  41. +0 −27 ImageMapView/MTImageMapView.h
  42. +23 −5 LICENSE
  43. +10 −0 MTImageMapView.xcworkspace/contents.xcworkspacedata
  44. BIN MTImageMapView.xcworkspace/xcuserdata/almightykim.xcuserdatad/UserInterfaceState.xcuserstate
  45. +49 −0 MTImageMapView/MTImageMapView.h
  46. +63 −19 {ImageMapView → MTImageMapView}/MTImageMapView.m
  47. +30 −15 README.markdown
  48. BIN { → Resource}/US_States.gif
  49. +6 −7 {ImageMap → Resource}/ViewController-iPad.xib
  50. +5 −7 {ImageMap/en.lproj → Resource}/ViewController-iPhone5.xib
  51. +4 −4 {ImageMap/en.lproj → Resource}/ViewController.xib
  52. 0 { → Resource}/states_coord.plist
  53. 0 { → Resource}/states_name.plist

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0450"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "042C52BB16AE782900839277"
+ BuildableName = "Image Map (ARC).app"
+ BlueprintName = "Image Map (ARC)"
+ ReferencedContainer = "container:Image Map (ARC).xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "042C52BB16AE782900839277"
+ BuildableName = "Image Map (ARC).app"
+ BlueprintName = "Image Map (ARC)"
+ ReferencedContainer = "container:Image Map (ARC).xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "042C52BB16AE782900839277"
+ BuildableName = "Image Map (ARC).app"
+ BlueprintName = "Image Map (ARC)"
+ ReferencedContainer = "container:Image Map (ARC).xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "042C52BB16AE782900839277"
+ BuildableName = "Image Map (ARC).app"
+ BlueprintName = "Image Map (ARC)"
+ ReferencedContainer = "container:Image Map (ARC).xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>Image Map (ARC).xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>042C52BB16AE782900839277</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
@@ -0,0 +1,38 @@
+/*
+ *
+ * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Copyright (c) 2012-2013 Sung-Taek, Kim <stkim1@colorfulglue.com> All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer. Redistributions in
+ * binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution. Neither the name of Sung-Ta
+ * ek kim nor the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#import <UIKit/UIKit.h>
+
+@class ViewController;
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+@property (strong, nonatomic) UIWindow *window;
+@property (strong, nonatomic) ViewController *viewController;
+@end
@@ -0,0 +1,45 @@
+/*
+ *
+ * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Copyright (c) 2012-2013 Sung-Taek, Kim <stkim1@colorfulglue.com> All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer. Redistributions in
+ * binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution. Neither the name of Sung-Ta
+ * ek kim nor the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#import "AppDelegate.h"
+#import "ViewController.h"
+
+@implementation AppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ self.viewController = [[ViewController alloc] init];
+ self.window.rootViewController = self.viewController;
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+@end
File renamed without changes
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'Image Map (ARC)' target in the 'Image Map (ARC)' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_4_0
+#warning "This project uses features only available in iOS SDK 4.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
@@ -0,0 +1,40 @@
+/*
+ *
+ * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Copyright (c) 2012-2013 Sung-Taek, Kim <stkim1@colorfulglue.com> All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer. Redistributions in
+ * binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution. Neither the name of Sung-Ta
+ * ek kim nor the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#import <UIKit/UIKit.h>
+#import "MTImageMapView.h"
+
+@interface ViewController : UIViewController
+<MTImageMapDelegate>
+@property (nonatomic, assign) IBOutlet UIScrollView *viewScrollStub;
+@property (nonatomic, assign) IBOutlet MTImageMapView *viewImageMap;
+@property (nonatomic, strong) NSArray *stateNames;
+@end
@@ -0,0 +1,103 @@
+/*
+ *
+ * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Copyright (c) 2012-2013 Sung-Taek, Kim <stkim1@colorfulglue.com> All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer. Redistributions in
+ * binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution. Neither the name of Sung-Ta
+ * ek kim nor the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#import "ViewController.h"
+
+
+@implementation ViewController
+{
+ __unsafe_unretained UIScrollView *_viewScrollStub;
+ __unsafe_unretained MTImageMapView *_viewImageMap;
+ __strong NSArray *_stateNames;
+}
+@synthesize viewScrollStub = _viewScrollStub;
+@synthesize viewImageMap = _viewImageMap;
+@synthesize stateNames = _stateNames;
+
+-(NSString *)nibName
+{
+ if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
+ {
+ CGSize result = [[UIScreen mainScreen] bounds].size;
+
+ if(result.height == 480.f)
+ {
+ return @"ViewController";
+ }
+ else
+ {
+ return @"ViewController-iPhone5";
+ }
+ }
+
+ return @"ViewController-iPad";
+}
+
+- (void)loadView
+{
+ [super loadView];
+ // Do any additional setup after loading the view, typically from a nib.
+
+ self.stateNames = \
+ [NSArray arrayWithContentsOfFile:
+ [[NSBundle mainBundle]
+ pathForResource:@"states_name"
+ ofType:@"plist"]];
+
+ [_viewScrollStub addSubview:_viewImageMap];
+ [_viewScrollStub setContentSize:
+ [_viewImageMap sizeThatFits:CGSizeZero]
+ ];
+
+ NSArray *arrStates = \
+ [NSArray arrayWithContentsOfFile:
+ [[NSBundle mainBundle]
+ pathForResource:@"states_coord"
+ ofType:@"plist"]];
+
+ [_viewImageMap
+ setMapping:arrStates
+ doneBlock:^(MTImageMapView *imageMapView) {
+ NSLog(@"Areas are all mapped");
+ }];
+}
+
+-(void)imageMapView:(MTImageMapView *)inImageMapView
+ didSelectMapArea:(NSUInteger)inIndexSelected
+{
+ [[[UIAlertView alloc]
+ initWithTitle:@"*** State Name ***"
+ message:[_stateNames objectAtIndex:inIndexSelected]
+ delegate:nil
+ cancelButtonTitle:@"Ok"
+ otherButtonTitles:nil] show];
+}
+
+@end
Oops, something went wrong.

0 comments on commit 3e2fb6e

Please sign in to comment.