iCuke 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. data/.gitignore +2 -0
  2. data/.gitmodules +3 -0
  3. data/README.rdoc +8 -7
  4. data/Rakefile +10 -30
  5. data/VERSION +1 -1
  6. data/app/.gitignore +3 -0
  7. data/app/LICENSE +20 -0
  8. data/app/Readme.markdown +3 -0
  9. data/app/Shared/AppDelegate_Shared.h +17 -0
  10. data/app/Shared/AppDelegate_Shared.m +25 -0
  11. data/app/{images/yellowslide.png → Shared/Icon.png} +0 -0
  12. data/app/Shared/ModalViewController.h +15 -0
  13. data/app/Shared/ModalViewController.m +96 -0
  14. data/app/Shared/TestViewController_Shared.h +15 -0
  15. data/app/Shared/TestViewController_Shared.m +43 -0
  16. data/app/{Info.plist → Shared/Universal-Info.plist} +17 -4
  17. data/app/Shared/Universal_Prefix.pch +8 -0
  18. data/app/Shared/main.m +14 -0
  19. data/app/Universal.xcodeproj/project.pbxproj +301 -0
  20. data/app/iPad/AppDelegate_Pad.h +15 -0
  21. data/app/iPad/AppDelegate_Pad.m +28 -0
  22. data/app/iPad/Default-Landscape.png +0 -0
  23. data/app/iPad/Default-Portrait.png +0 -0
  24. data/app/iPad/MainWindow_Pad.xib +343 -0
  25. data/app/iPad/TestViewController_Pad.h +15 -0
  26. data/app/iPad/TestViewController_Pad.m +52 -0
  27. data/app/iPhone/AppDelegate_Phone.h +15 -0
  28. data/app/iPhone/AppDelegate_Phone.m +28 -0
  29. data/app/{images/segment_search.png → iPhone/Default.png} +0 -0
  30. data/app/iPhone/MainWindow_Phone.xib +363 -0
  31. data/app/iPhone/TestViewController_Phone.h +15 -0
  32. data/app/iPhone/TestViewController_Phone.m +36 -0
  33. data/bin/.gitignore +1 -0
  34. data/bin/icuke +10 -0
  35. data/bin/icuke-module +17 -0
  36. data/ext/.gitignore +1 -0
  37. data/ext/Rakefile +6 -0
  38. data/ext/WaxSim/Simulator.h +31 -0
  39. data/ext/WaxSim/Simulator.m +131 -0
  40. data/ext/WaxSim/WaxSim.m +110 -0
  41. data/ext/WaxSim/WaxSim.xcodeproj/project.pbxproj +238 -0
  42. data/ext/WaxSim/WaxSim_Prefix.pch +7 -0
  43. data/ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +126 -0
  44. data/ext/iCuke/Rakefile +14 -17
  45. data/ext/iCuke/libicuke-sdk3.1.dylib +0 -0
  46. data/ext/iCuke/libicuke-sdk4.0.dylib +0 -0
  47. data/ext/iCuke/libicuke.dylib +0 -0
  48. data/ext/iCuke/{DefaultsResponse.h → sdk3.1/DefaultsResponse.h} +0 -0
  49. data/ext/iCuke/{DefaultsResponse.m → sdk3.1/DefaultsResponse.m} +0 -0
  50. data/ext/iCuke/{EventResponse.h → sdk3.1/EventResponse.h} +0 -0
  51. data/ext/iCuke/{EventResponse.m → sdk3.1/EventResponse.m} +0 -0
  52. data/ext/iCuke/sdk3.1/ModuleResponse.h +5 -0
  53. data/ext/iCuke/sdk3.1/ModuleResponse.m +76 -0
  54. data/ext/iCuke/sdk3.1/Rakefile +20 -0
  55. data/ext/iCuke/{Recorder.h → sdk3.1/Recorder.h} +0 -0
  56. data/ext/iCuke/{Recorder.m → sdk3.1/Recorder.m} +0 -0
  57. data/ext/iCuke/{RecorderResponse.h → sdk3.1/RecorderResponse.h} +0 -0
  58. data/ext/iCuke/{RecorderResponse.m → sdk3.1/RecorderResponse.m} +0 -0
  59. data/ext/iCuke/{SynthesizeSingleton.h → sdk3.1/SynthesizeSingleton.h} +0 -0
  60. data/ext/iCuke/{ViewResponse.h → sdk3.1/ViewResponse.h} +0 -0
  61. data/ext/iCuke/{ViewResponse.m → sdk3.1/ViewResponse.m} +0 -0
  62. data/ext/iCuke/{Viewer.h → sdk3.1/Viewer.h} +0 -0
  63. data/ext/iCuke/sdk3.1/Viewer.m +203 -0
  64. data/ext/iCuke/{iCukeHTTPResponseHandler.h → sdk3.1/iCukeHTTPResponseHandler.h} +0 -0
  65. data/ext/iCuke/{iCukeHTTPResponseHandler.m → sdk3.1/iCukeHTTPResponseHandler.m} +0 -0
  66. data/ext/iCuke/{iCukeHTTPServer.h → sdk3.1/iCukeHTTPServer.h} +0 -0
  67. data/ext/iCuke/{iCukeHTTPServer.m → sdk3.1/iCukeHTTPServer.m} +0 -0
  68. data/ext/iCuke/{iCukeServer.h → sdk3.1/iCukeServer.h} +0 -2
  69. data/ext/iCuke/{iCukeServer.m → sdk3.1/iCukeServer.m} +22 -20
  70. data/ext/iCuke/{json → sdk3.1/json}/JSON.h +0 -0
  71. data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.h +0 -0
  72. data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.m +0 -0
  73. data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.h +0 -0
  74. data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.m +0 -0
  75. data/ext/iCuke/{json → sdk3.1/json}/SBJSON.h +0 -0
  76. data/ext/iCuke/{json → sdk3.1/json}/SBJSON.m +0 -0
  77. data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.h +0 -0
  78. data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.m +0 -0
  79. data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.h +0 -0
  80. data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.m +0 -0
  81. data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.h +0 -0
  82. data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.m +0 -0
  83. data/ext/iCuke/sdk4.0/DefaultsResponse.h +5 -0
  84. data/ext/iCuke/sdk4.0/DefaultsResponse.m +66 -0
  85. data/ext/iCuke/sdk4.0/EventResponse.h +5 -0
  86. data/ext/iCuke/sdk4.0/EventResponse.m +130 -0
  87. data/ext/iCuke/sdk4.0/ModuleResponse.h +5 -0
  88. data/ext/iCuke/sdk4.0/ModuleResponse.m +76 -0
  89. data/ext/iCuke/sdk4.0/Rakefile +20 -0
  90. data/ext/iCuke/sdk4.0/Recorder.h +17 -0
  91. data/ext/iCuke/sdk4.0/Recorder.m +90 -0
  92. data/ext/iCuke/sdk4.0/RecorderResponse.h +6 -0
  93. data/ext/iCuke/sdk4.0/RecorderResponse.m +68 -0
  94. data/ext/iCuke/sdk4.0/SynthesizeSingleton.h +68 -0
  95. data/ext/iCuke/sdk4.0/ViewResponse.h +5 -0
  96. data/ext/iCuke/sdk4.0/ViewResponse.m +84 -0
  97. data/ext/iCuke/sdk4.0/Viewer.h +8 -0
  98. data/ext/iCuke/{Viewer.m → sdk4.0/Viewer.m} +14 -0
  99. data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.h +50 -0
  100. data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.m +381 -0
  101. data/ext/iCuke/sdk4.0/iCukeHTTPServer.h +53 -0
  102. data/ext/iCuke/sdk4.0/iCukeHTTPServer.m +365 -0
  103. data/ext/iCuke/sdk4.0/iCukeServer.h +14 -0
  104. data/ext/iCuke/sdk4.0/iCukeServer.m +65 -0
  105. data/ext/iCuke/sdk4.0/json/JSON.h +50 -0
  106. data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.h +68 -0
  107. data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.m +53 -0
  108. data/ext/iCuke/sdk4.0/json/NSString+SBJSON.h +58 -0
  109. data/ext/iCuke/sdk4.0/json/NSString+SBJSON.m +55 -0
  110. data/ext/iCuke/sdk4.0/json/SBJSON.h +75 -0
  111. data/ext/iCuke/sdk4.0/json/SBJSON.m +212 -0
  112. data/ext/iCuke/sdk4.0/json/SBJsonBase.h +86 -0
  113. data/ext/iCuke/sdk4.0/json/SBJsonBase.m +78 -0
  114. data/ext/iCuke/sdk4.0/json/SBJsonParser.h +87 -0
  115. data/ext/iCuke/sdk4.0/json/SBJsonParser.m +475 -0
  116. data/ext/iCuke/sdk4.0/json/SBJsonWriter.h +129 -0
  117. data/ext/iCuke/sdk4.0/json/SBJsonWriter.m +228 -0
  118. data/features/iphone.feature +15 -0
  119. data/features/support/env.rb +1 -1
  120. data/iCuke.gemspec +118 -114
  121. data/lib/icuke/cucumber.rb +93 -64
  122. data/lib/icuke/screen.rb +110 -0
  123. data/lib/icuke/sdk.rb +134 -0
  124. data/lib/icuke/simulate.rb +9 -5
  125. data/lib/icuke/simulator.rb +10 -11
  126. data/lib/icuke/waxsim.rb +36 -0
  127. data/lib/icuke.rb +2 -1
  128. metadata +124 -129
  129. data/app/AlertsViewController.h +0 -59
  130. data/app/AlertsViewController.m +0 -341
  131. data/app/AppDelegate.h +0 -60
  132. data/app/AppDelegate.m +0 -101
  133. data/app/ButtonsViewController.h +0 -80
  134. data/app/ButtonsViewController.m +0 -448
  135. data/app/Constants.h +0 -58
  136. data/app/ControlsViewController.h +0 -72
  137. data/app/ControlsViewController.m +0 -379
  138. data/app/ImagesViewController.h +0 -62
  139. data/app/ImagesViewController.m +0 -137
  140. data/app/MainViewController.h +0 -57
  141. data/app/MainViewController.m +0 -262
  142. data/app/Picker/CustomPickerDataSource.h +0 -55
  143. data/app/Picker/CustomPickerDataSource.m +0 -135
  144. data/app/Picker/CustomView.h +0 -62
  145. data/app/Picker/CustomView.m +0 -119
  146. data/app/PickerViewController.h +0 -88
  147. data/app/PickerViewController.m +0 -402
  148. data/app/Prefix.pch +0 -5
  149. data/app/ReadMe.txt +0 -82
  150. data/app/SearchBarController.h +0 -58
  151. data/app/SearchBarController.m +0 -105
  152. data/app/SegmentViewController.h +0 -54
  153. data/app/SegmentViewController.m +0 -195
  154. data/app/TextFieldController.h +0 -67
  155. data/app/TextFieldController.m +0 -342
  156. data/app/TextViewController.h +0 -57
  157. data/app/TextViewController.m +0 -164
  158. data/app/ToolbarViewController.h +0 -74
  159. data/app/ToolbarViewController.m +0 -303
  160. data/app/TransitionViewController.h +0 -64
  161. data/app/TransitionViewController.m +0 -178
  162. data/app/UICatalog.xcodeproj/project.pbxproj +0 -615
  163. data/app/WebViewController.h +0 -57
  164. data/app/WebViewController.m +0 -173
  165. data/app/en.lproj/AlertsViewController.xib +0 -144
  166. data/app/en.lproj/ButtonsViewController.xib +0 -147
  167. data/app/en.lproj/ControlsViewController.xib +0 -147
  168. data/app/en.lproj/ImagesViewController.xib +0 -264
  169. data/app/en.lproj/Localizable.strings +0 -41
  170. data/app/en.lproj/MainWindow.xib +0 -306
  171. data/app/en.lproj/PickerViewController.xib +0 -415
  172. data/app/en.lproj/SearchBarController.xib +0 -142
  173. data/app/en.lproj/SegmentViewController.xib +0 -143
  174. data/app/en.lproj/TextFieldController.xib +0 -167
  175. data/app/en.lproj/TextViewController.xib +0 -149
  176. data/app/en.lproj/ToolbarViewController.xib +0 -491
  177. data/app/en.lproj/TransitionViewController.xib +0 -255
  178. data/app/en.lproj/WebViewController.xib +0 -141
  179. data/app/images/12-6AM.png +0 -0
  180. data/app/images/12-6PM.png +0 -0
  181. data/app/images/6-12AM.png +0 -0
  182. data/app/images/6-12PM.png +0 -0
  183. data/app/images/Default.png +0 -0
  184. data/app/images/Icon.png +0 -0
  185. data/app/images/UIButton_custom.png +0 -0
  186. data/app/images/blueButton.png +0 -0
  187. data/app/images/orangeslide.png +0 -0
  188. data/app/images/scene1.jpg +0 -0
  189. data/app/images/scene2.jpg +0 -0
  190. data/app/images/scene3.jpg +0 -0
  191. data/app/images/scene4.jpg +0 -0
  192. data/app/images/scene5.jpg +0 -0
  193. data/app/images/segment_check.png +0 -0
  194. data/app/images/segment_tools.png +0 -0
  195. data/app/images/slider_ball.png +0 -0
  196. data/app/images/whiteButton.png +0 -0
  197. data/app/main.m +0 -58
  198. data/features/uicatalog.feature +0 -20
  199. data/lib/icuke/com.apple.Accessibility.plist +0 -0
  200. data/lib/icuke/headless.rb +0 -54
  201. data/lib/icuke/xcode.rb +0 -164
data/.gitignore CHANGED
@@ -11,3 +11,5 @@ pkg
11
11
 
12
12
  ## PROJECT::SPECIFIC
13
13
  events.plist
14
+
15
+ bin/waxsim
data/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "ext/WaxSim"]
2
+ path = ext/WaxSim
3
+ url = git://github.com/robholland/WaxSim.git
data/README.rdoc CHANGED
@@ -20,8 +20,8 @@ Write some scenarios like:
20
20
 
21
21
  == How it works
22
22
 
23
- iCuke uses applescript to drive Xcode in order to launch your application into the iPhone Simulator. A preload library
24
- is used to add a HTTP server into your application.
23
+ iCuke launches your application into the iPhone Simulator. A preload library is used to add a HTTP server into your
24
+ application.
25
25
 
26
26
  The HTTP server allows us to see an XML version of the iPhone's screen, and to emulate taps/swipes etc.
27
27
 
@@ -30,19 +30,20 @@ to function sensibly. If your accessibility information is not accurate, iCuke m
30
30
 
31
31
  == Bugs
32
32
 
33
- iCuke does not support testing applications on real devices, because I don't know of a way get a preload library to load
34
- on the device.
33
+ iCuke does not support testing applications on real devices, because I don't know of a way get a preload library to
34
+ load on the device.
35
35
 
36
- iCuke does not support drags or pinches yet. They'll be here soon!
36
+ iCuke does not support pinches yet. They'll be here soon!
37
37
 
38
- iCuke compiles against the 3.1.2 SDK. I'm not sure how to make that configurable as the compilation is done at gem
39
- install time.
38
+ iCuke compiles against the latest 3.1 and 4.0 SDKs it can find. Compiling against 3.2 is not currently supported as Apple have released two versions with different ABIs.
40
39
 
41
40
  == Contributors
42
41
 
43
42
  * Nigel Taylor
44
43
  * Aslak Hellesøy
45
44
  * Dominic Baggott
45
+ * Jeff Morgan
46
+ * Luke Redpath
46
47
 
47
48
  == Thanks
48
49
 
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
+ require 'lib/icuke/sdk'
3
4
 
4
5
  begin
5
6
  require 'jeweler'
@@ -11,21 +12,24 @@ begin
11
12
  gem.homepage = "http://github.com/unboxed/iCuke"
12
13
  gem.authors = ["Rob Holland"]
13
14
  gem.add_dependency "cucumber", ">= 0"
14
- gem.add_dependency "rb-appscript", ">= 0"
15
15
  gem.add_dependency "httparty", ">= 0"
16
16
  gem.add_dependency "nokogiri", ">= 0"
17
- gem.extensions = ['ext/iCuke/Rakefile']
18
- gem.files += ['ext/iCuke/libicuke.dylib']
17
+ gem.extensions = ['ext/Rakefile']
18
+ gem.files += ['ext/bin/waxsim']
19
+ gem.files += ['ext/iCuke/libicuke*.dylib']
20
+ gem.files += ['ext/WaxSim/**/*']
21
+ gem.files -= ['ext/WaxSim/build']
19
22
  end
20
23
  Jeweler::GemcutterTasks.new
21
24
  rescue LoadError
22
25
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
23
26
  end
24
27
 
25
- file 'app/build/Debug-iphonesimulator/UICatalog.app/UICatalog' do
26
- sh 'cd app && xcodebuild -target UICatalog -configuration Debug -sdk iphonesimulator3.1.2'
28
+ file 'app/build/Debug-iphonesimulator/Universal.app/Universal' do
29
+ ICuke::SDK.use_latest
30
+ sh "cd app && xcodebuild -target Universal -configuration Debug -sdk #{ICuke::SDK.fullname}"
27
31
  end
28
- task :app => 'app/build/Debug-iphonesimulator/UICatalog.app/UICatalog'
32
+ task :app => 'app/build/Debug-iphonesimulator/Universal.app/Universal'
29
33
  task :features => :app
30
34
 
31
35
  task :lib do
@@ -55,27 +59,3 @@ Rake::RDocTask.new do |rdoc|
55
59
  rdoc.rdoc_files.include('README*')
56
60
  rdoc.rdoc_files.include('lib/**/*.rb')
57
61
  end
58
-
59
- task :launch => [:app, :lib] do
60
- require 'lib/icuke/simulator'
61
-
62
- simulator = ICuke::Simulator.new
63
- simulator.launch File.expand_path('app/iCuke/build/Debug-iphonesimulator/iCuke.app'),
64
- :env => { 'DYLD_INSERT_LIBRARIES' => File.expand_path(File.dirname(__FILE__) + '/ext/iCuke/libicuke.dylib') }
65
- end
66
-
67
- task :replay => :launch do
68
- simulator = ICuke::Simulator.new
69
- simulator.load(File.expand_path(File.dirname(__FILE__) + '/events.plist'))
70
- simulator.play
71
- end
72
-
73
- task :debug => [:app, :lib] do
74
- require 'lib/icuke/simulator'
75
-
76
- simulator = ICuke::Simulator.new
77
- simulator.launch File.expand_path('app/iCuke/build/Debug-iphonesimulator/iCuke.app'),
78
- :env => { 'DYLD_INSERT_LIBRARIES' => File.expand_path(File.dirname(__FILE__) + '/ext/iCuke/libicuke.dylib') },
79
- :debugger => true
80
- puts `ps aux|grep [i]Cuke.app/iCuke`
81
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.5
1
+ 0.6.0
data/app/.gitignore CHANGED
@@ -1 +1,4 @@
1
+ .DS_Store
1
2
  build
3
+ *.mode1v3
4
+ *.pbxuser
data/app/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Sam Soffes
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
1
+ # Universal iPad/iPhone Example
2
+
3
+ Simple example app that uses 3.2 as the base SDK and 3.1.3 as the iPhone deployment target.
@@ -0,0 +1,17 @@
1
+ //
2
+ // AppDelegate_Shared.h
3
+ // Universal
4
+ //
5
+ // Created by Sam Soffes on 4/12/10.
6
+ // Copyright 2010 Sam Soffes. All rights reserved.
7
+ //
8
+
9
+ @interface AppDelegate_Shared : NSObject <UIApplicationDelegate> {
10
+
11
+ UIWindow *window;
12
+ UINavigationController *navigationController;
13
+ }
14
+
15
+ @property (nonatomic, retain) IBOutlet UIWindow *window;
16
+
17
+ @end
@@ -0,0 +1,25 @@
1
+ //
2
+ // AppDelegate_Shared.m
3
+ // Universal
4
+ //
5
+ // Created by Sam Soffes on 4/12/10.
6
+ // Copyright 2010 Sam Soffes. All rights reserved.
7
+ //
8
+
9
+ #import "AppDelegate_Shared.h"
10
+
11
+ @implementation AppDelegate_Shared
12
+
13
+ @synthesize window;
14
+
15
+ #pragma mark -
16
+ #pragma mark NSObject
17
+ #pragma mark -
18
+
19
+ - (void)dealloc {
20
+ [window release];
21
+ [navigationController release];
22
+ [super dealloc];
23
+ }
24
+
25
+ @end
@@ -0,0 +1,15 @@
1
+ //
2
+ // ModalViewController.h
3
+ // Universal
4
+ //
5
+ // Created by Sam Soffes on 4/12/10.
6
+ // Copyright 2010 Sam Soffes. All rights reserved.
7
+ //
8
+
9
+ @interface ModalViewController : UITableViewController {
10
+
11
+ }
12
+
13
+ - (void)close:(id)sender;
14
+
15
+ @end
@@ -0,0 +1,96 @@
1
+ //
2
+ // ModalViewController.m
3
+ // Universal
4
+ //
5
+ // Created by Sam Soffes on 4/12/10.
6
+ // Copyright 2010 Sam Soffes. All rights reserved.
7
+ //
8
+
9
+ #import "ModalViewController.h"
10
+
11
+ @implementation ModalViewController
12
+
13
+ NSString *lorem[] = {
14
+ @"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
15
+ @"Donec dictum vehicula suscipit.",
16
+ @"Morbi eget mauris vel mauris pellentesque luctus ut sed nulla.",
17
+ @"Aliquam blandit risus ut magna egestas ac commodo lacus sagittis.",
18
+ @"Duis dui nunc, rutrum a tincidunt nec, commodo vitae ante.",
19
+ @"Mauris fringilla est at nibh porta pulvinar.",
20
+ @"Quisque mattis, odio sit amet ultrices elementum, dui libero scelerisque nisl, a bibendum ante orci ut metus.",
21
+ @"Aliquam id lorem arcu.",
22
+ @"Fusce luctus, nibh facilisis sagittis ornare, neque ligula accumsan ipsum, non dignissim sapien nulla et turpis.",
23
+ @"Proin pretium erat nec ipsum fringilla pellentesque.",
24
+ @"Fusce sem nisi, tincidunt in sodales ac, tincidunt non lorem."
25
+ };
26
+
27
+
28
+ #pragma mark -
29
+ #pragma mark UIViewController
30
+ #pragma mark -
31
+
32
+ - (void)viewDidLoad {
33
+ [super viewDidLoad];
34
+
35
+ self.title = @"Shared Modal";
36
+
37
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
38
+ self.contentSizeForViewInPopover = CGSizeMake(320.0, 300.0);
39
+ } else {
40
+ UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(close:)];
41
+ self.navigationItem.rightBarButtonItem = closeButton;
42
+ [closeButton release];
43
+ }
44
+ }
45
+
46
+
47
+ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
48
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
49
+ return YES;
50
+ }
51
+
52
+ return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
53
+ }
54
+
55
+
56
+ #pragma mark -
57
+ #pragma mark Actions
58
+ #pragma mark -
59
+
60
+ - (void)close:(id)sender {
61
+ [self.navigationController dismissModalViewControllerAnimated:YES];
62
+ }
63
+
64
+
65
+ #pragma mark -
66
+ #pragma mark UITableViewDataSource
67
+ #pragma mark -
68
+
69
+ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
70
+ return sizeof(lorem) / sizeof(NSString *);
71
+ }
72
+
73
+
74
+ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
75
+ static NSString *cellIdentifier = @"cellIdentifier";
76
+
77
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
78
+ if (!cell) {
79
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
80
+ }
81
+
82
+ cell.textLabel.text = lorem[indexPath.row];
83
+
84
+ return cell;
85
+ }
86
+
87
+
88
+ #pragma mark -
89
+ #pragma mark UITableViewDelegate
90
+ #pragma mark -
91
+
92
+ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
93
+ [tableView deselectRowAtIndexPath:indexPath animated:YES];
94
+ }
95
+
96
+ @end
@@ -0,0 +1,15 @@
1
+ //
2
+ // TestViewController_Shared.h
3
+ // Universal
4
+ //
5
+ // Created by Sam Soffes on 4/12/10.
6
+ // Copyright 2010 Sam Soffes. All rights reserved.
7
+ //
8
+
9
+ @interface TestViewController_Shared : UIViewController {
10
+
11
+ }
12
+
13
+ - (void)test:(id)sender;
14
+
15
+ @end
@@ -0,0 +1,43 @@
1
+ //
2
+ // TestViewController_Shared.m
3
+ // Universal
4
+ //
5
+ // Created by Sam Soffes on 4/12/10.
6
+ // Copyright 2010 Sam Soffes. All rights reserved.
7
+ //
8
+
9
+ #import "TestViewController_Shared.h"
10
+
11
+ @implementation TestViewController_Shared
12
+
13
+ #pragma mark -
14
+ #pragma mark UIViewController
15
+ #pragma mark -
16
+
17
+ - (void)viewDidLoad {
18
+ UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
19
+ button.frame = CGRectMake(20.0, 20.0, 280.0, 44.0);
20
+ [button setTitle:@"Show Test Modal" forState:UIControlStateNormal];
21
+ [button addTarget:self action:@selector(test:) forControlEvents:UIControlEventTouchUpInside];
22
+ [self.view addSubview:button];
23
+ }
24
+
25
+
26
+ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
27
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
28
+ return YES;
29
+ }
30
+
31
+ return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
32
+ }
33
+
34
+
35
+ #pragma mark -
36
+ #pragma mark Actions
37
+ #pragma mark -
38
+
39
+ - (void)test:(id)sender {
40
+ // Must be overridden by subclass
41
+ }
42
+
43
+ @end
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>CFBundleDevelopmentRegion</key>
6
- <string>en</string>
6
+ <string>English</string>
7
7
  <key>CFBundleDisplayName</key>
8
8
  <string>${PRODUCT_NAME}</string>
9
9
  <key>CFBundleExecutable</key>
@@ -11,7 +11,7 @@
11
11
  <key>CFBundleIconFile</key>
12
12
  <string>Icon.png</string>
13
13
  <key>CFBundleIdentifier</key>
14
- <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
14
+ <string>com.samsoffes.universal-ipad-iphone-example</string>
15
15
  <key>CFBundleInfoDictionaryVersion</key>
16
16
  <string>6.0</string>
17
17
  <key>CFBundleName</key>
@@ -21,10 +21,23 @@
21
21
  <key>CFBundleSignature</key>
22
22
  <string>????</string>
23
23
  <key>CFBundleVersion</key>
24
- <string>2.6</string>
24
+ <string>1.0</string>
25
25
  <key>LSRequiresIPhoneOS</key>
26
26
  <true/>
27
27
  <key>NSMainNibFile</key>
28
- <string>MainWindow</string>
28
+ <string>MainWindow_Phone</string>
29
+ <key>NSMainNibFile~ipad</key>
30
+ <string>MainWindow_Pad</string>
31
+ <key>UISupportedInterfaceOrientations</key>
32
+ <array>
33
+ <string>UIInterfaceOrientationPortrait</string>
34
+ </array>
35
+ <key>UISupportedInterfaceOrientations~ipad</key>
36
+ <array>
37
+ <string>UIInterfaceOrientationPortrait</string>
38
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
39
+ <string>UIInterfaceOrientationLandscapeLeft</string>
40
+ <string>UIInterfaceOrientationLandscapeRight</string>
41
+ </array>
29
42
  </dict>
30
43
  </plist>
@@ -0,0 +1,8 @@
1
+ //
2
+ // Prefix header for all source files of the 'Universal' target in the 'Universal' project
3
+ //
4
+
5
+ #ifdef __OBJC__
6
+ #import <Foundation/Foundation.h>
7
+ #import <UIKit/UIKit.h>
8
+ #endif
data/app/Shared/main.m ADDED
@@ -0,0 +1,14 @@
1
+ //
2
+ // main.m
3
+ // Universal
4
+ //
5
+ // Created by Sam Soffes on 4/12/10.
6
+ // Copyright Sam Soffes 2010. All rights reserved.
7
+ //
8
+
9
+ int main(int argc, char *argv[]) {
10
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
11
+ int retVal = UIApplicationMain(argc, argv, nil, nil);
12
+ [pool release];
13
+ return retVal;
14
+ }