iCuke 0.5.5 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/.gitmodules +3 -0
- data/README.rdoc +8 -7
- data/Rakefile +10 -30
- data/VERSION +1 -1
- data/app/.gitignore +3 -0
- data/app/LICENSE +20 -0
- data/app/Readme.markdown +3 -0
- data/app/Shared/AppDelegate_Shared.h +17 -0
- data/app/Shared/AppDelegate_Shared.m +25 -0
- data/app/{images/yellowslide.png → Shared/Icon.png} +0 -0
- data/app/Shared/ModalViewController.h +15 -0
- data/app/Shared/ModalViewController.m +96 -0
- data/app/Shared/TestViewController_Shared.h +15 -0
- data/app/Shared/TestViewController_Shared.m +43 -0
- data/app/{Info.plist → Shared/Universal-Info.plist} +17 -4
- data/app/Shared/Universal_Prefix.pch +8 -0
- data/app/Shared/main.m +14 -0
- data/app/Universal.xcodeproj/project.pbxproj +301 -0
- data/app/iPad/AppDelegate_Pad.h +15 -0
- data/app/iPad/AppDelegate_Pad.m +28 -0
- data/app/iPad/Default-Landscape.png +0 -0
- data/app/iPad/Default-Portrait.png +0 -0
- data/app/iPad/MainWindow_Pad.xib +343 -0
- data/app/iPad/TestViewController_Pad.h +15 -0
- data/app/iPad/TestViewController_Pad.m +52 -0
- data/app/iPhone/AppDelegate_Phone.h +15 -0
- data/app/iPhone/AppDelegate_Phone.m +28 -0
- data/app/{images/segment_search.png → iPhone/Default.png} +0 -0
- data/app/iPhone/MainWindow_Phone.xib +363 -0
- data/app/iPhone/TestViewController_Phone.h +15 -0
- data/app/iPhone/TestViewController_Phone.m +36 -0
- data/bin/.gitignore +1 -0
- data/bin/icuke +10 -0
- data/bin/icuke-module +17 -0
- data/ext/.gitignore +1 -0
- data/ext/Rakefile +6 -0
- data/ext/WaxSim/Simulator.h +31 -0
- data/ext/WaxSim/Simulator.m +131 -0
- data/ext/WaxSim/WaxSim.m +110 -0
- data/ext/WaxSim/WaxSim.xcodeproj/project.pbxproj +238 -0
- data/ext/WaxSim/WaxSim_Prefix.pch +7 -0
- data/ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +126 -0
- data/ext/iCuke/Rakefile +14 -17
- data/ext/iCuke/libicuke-sdk3.1.dylib +0 -0
- data/ext/iCuke/libicuke-sdk4.0.dylib +0 -0
- data/ext/iCuke/libicuke.dylib +0 -0
- data/ext/iCuke/{DefaultsResponse.h → sdk3.1/DefaultsResponse.h} +0 -0
- data/ext/iCuke/{DefaultsResponse.m → sdk3.1/DefaultsResponse.m} +0 -0
- data/ext/iCuke/{EventResponse.h → sdk3.1/EventResponse.h} +0 -0
- data/ext/iCuke/{EventResponse.m → sdk3.1/EventResponse.m} +0 -0
- data/ext/iCuke/sdk3.1/ModuleResponse.h +5 -0
- data/ext/iCuke/sdk3.1/ModuleResponse.m +76 -0
- data/ext/iCuke/sdk3.1/Rakefile +20 -0
- data/ext/iCuke/{Recorder.h → sdk3.1/Recorder.h} +0 -0
- data/ext/iCuke/{Recorder.m → sdk3.1/Recorder.m} +0 -0
- data/ext/iCuke/{RecorderResponse.h → sdk3.1/RecorderResponse.h} +0 -0
- data/ext/iCuke/{RecorderResponse.m → sdk3.1/RecorderResponse.m} +0 -0
- data/ext/iCuke/{SynthesizeSingleton.h → sdk3.1/SynthesizeSingleton.h} +0 -0
- data/ext/iCuke/{ViewResponse.h → sdk3.1/ViewResponse.h} +0 -0
- data/ext/iCuke/{ViewResponse.m → sdk3.1/ViewResponse.m} +0 -0
- data/ext/iCuke/{Viewer.h → sdk3.1/Viewer.h} +0 -0
- data/ext/iCuke/sdk3.1/Viewer.m +203 -0
- data/ext/iCuke/{iCukeHTTPResponseHandler.h → sdk3.1/iCukeHTTPResponseHandler.h} +0 -0
- data/ext/iCuke/{iCukeHTTPResponseHandler.m → sdk3.1/iCukeHTTPResponseHandler.m} +0 -0
- data/ext/iCuke/{iCukeHTTPServer.h → sdk3.1/iCukeHTTPServer.h} +0 -0
- data/ext/iCuke/{iCukeHTTPServer.m → sdk3.1/iCukeHTTPServer.m} +0 -0
- data/ext/iCuke/{iCukeServer.h → sdk3.1/iCukeServer.h} +0 -2
- data/ext/iCuke/{iCukeServer.m → sdk3.1/iCukeServer.m} +22 -20
- data/ext/iCuke/{json → sdk3.1/json}/JSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.m +0 -0
- data/ext/iCuke/sdk4.0/DefaultsResponse.h +5 -0
- data/ext/iCuke/sdk4.0/DefaultsResponse.m +66 -0
- data/ext/iCuke/sdk4.0/EventResponse.h +5 -0
- data/ext/iCuke/sdk4.0/EventResponse.m +130 -0
- data/ext/iCuke/sdk4.0/ModuleResponse.h +5 -0
- data/ext/iCuke/sdk4.0/ModuleResponse.m +76 -0
- data/ext/iCuke/sdk4.0/Rakefile +20 -0
- data/ext/iCuke/sdk4.0/Recorder.h +17 -0
- data/ext/iCuke/sdk4.0/Recorder.m +90 -0
- data/ext/iCuke/sdk4.0/RecorderResponse.h +6 -0
- data/ext/iCuke/sdk4.0/RecorderResponse.m +68 -0
- data/ext/iCuke/sdk4.0/SynthesizeSingleton.h +68 -0
- data/ext/iCuke/sdk4.0/ViewResponse.h +5 -0
- data/ext/iCuke/sdk4.0/ViewResponse.m +84 -0
- data/ext/iCuke/sdk4.0/Viewer.h +8 -0
- data/ext/iCuke/{Viewer.m → sdk4.0/Viewer.m} +14 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.h +50 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.m +381 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPServer.h +53 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPServer.m +365 -0
- data/ext/iCuke/sdk4.0/iCukeServer.h +14 -0
- data/ext/iCuke/sdk4.0/iCukeServer.m +65 -0
- data/ext/iCuke/sdk4.0/json/JSON.h +50 -0
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.h +68 -0
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.m +53 -0
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.h +58 -0
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.m +55 -0
- data/ext/iCuke/sdk4.0/json/SBJSON.h +75 -0
- data/ext/iCuke/sdk4.0/json/SBJSON.m +212 -0
- data/ext/iCuke/sdk4.0/json/SBJsonBase.h +86 -0
- data/ext/iCuke/sdk4.0/json/SBJsonBase.m +78 -0
- data/ext/iCuke/sdk4.0/json/SBJsonParser.h +87 -0
- data/ext/iCuke/sdk4.0/json/SBJsonParser.m +475 -0
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.h +129 -0
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.m +228 -0
- data/features/iphone.feature +15 -0
- data/features/support/env.rb +1 -1
- data/iCuke.gemspec +118 -114
- data/lib/icuke/cucumber.rb +93 -64
- data/lib/icuke/screen.rb +110 -0
- data/lib/icuke/sdk.rb +134 -0
- data/lib/icuke/simulate.rb +9 -5
- data/lib/icuke/simulator.rb +10 -11
- data/lib/icuke/waxsim.rb +36 -0
- data/lib/icuke.rb +2 -1
- metadata +124 -129
- data/app/AlertsViewController.h +0 -59
- data/app/AlertsViewController.m +0 -341
- data/app/AppDelegate.h +0 -60
- data/app/AppDelegate.m +0 -101
- data/app/ButtonsViewController.h +0 -80
- data/app/ButtonsViewController.m +0 -448
- data/app/Constants.h +0 -58
- data/app/ControlsViewController.h +0 -72
- data/app/ControlsViewController.m +0 -379
- data/app/ImagesViewController.h +0 -62
- data/app/ImagesViewController.m +0 -137
- data/app/MainViewController.h +0 -57
- data/app/MainViewController.m +0 -262
- data/app/Picker/CustomPickerDataSource.h +0 -55
- data/app/Picker/CustomPickerDataSource.m +0 -135
- data/app/Picker/CustomView.h +0 -62
- data/app/Picker/CustomView.m +0 -119
- data/app/PickerViewController.h +0 -88
- data/app/PickerViewController.m +0 -402
- data/app/Prefix.pch +0 -5
- data/app/ReadMe.txt +0 -82
- data/app/SearchBarController.h +0 -58
- data/app/SearchBarController.m +0 -105
- data/app/SegmentViewController.h +0 -54
- data/app/SegmentViewController.m +0 -195
- data/app/TextFieldController.h +0 -67
- data/app/TextFieldController.m +0 -342
- data/app/TextViewController.h +0 -57
- data/app/TextViewController.m +0 -164
- data/app/ToolbarViewController.h +0 -74
- data/app/ToolbarViewController.m +0 -303
- data/app/TransitionViewController.h +0 -64
- data/app/TransitionViewController.m +0 -178
- data/app/UICatalog.xcodeproj/project.pbxproj +0 -615
- data/app/WebViewController.h +0 -57
- data/app/WebViewController.m +0 -173
- data/app/en.lproj/AlertsViewController.xib +0 -144
- data/app/en.lproj/ButtonsViewController.xib +0 -147
- data/app/en.lproj/ControlsViewController.xib +0 -147
- data/app/en.lproj/ImagesViewController.xib +0 -264
- data/app/en.lproj/Localizable.strings +0 -41
- data/app/en.lproj/MainWindow.xib +0 -306
- data/app/en.lproj/PickerViewController.xib +0 -415
- data/app/en.lproj/SearchBarController.xib +0 -142
- data/app/en.lproj/SegmentViewController.xib +0 -143
- data/app/en.lproj/TextFieldController.xib +0 -167
- data/app/en.lproj/TextViewController.xib +0 -149
- data/app/en.lproj/ToolbarViewController.xib +0 -491
- data/app/en.lproj/TransitionViewController.xib +0 -255
- data/app/en.lproj/WebViewController.xib +0 -141
- data/app/images/12-6AM.png +0 -0
- data/app/images/12-6PM.png +0 -0
- data/app/images/6-12AM.png +0 -0
- data/app/images/6-12PM.png +0 -0
- data/app/images/Default.png +0 -0
- data/app/images/Icon.png +0 -0
- data/app/images/UIButton_custom.png +0 -0
- data/app/images/blueButton.png +0 -0
- data/app/images/orangeslide.png +0 -0
- data/app/images/scene1.jpg +0 -0
- data/app/images/scene2.jpg +0 -0
- data/app/images/scene3.jpg +0 -0
- data/app/images/scene4.jpg +0 -0
- data/app/images/scene5.jpg +0 -0
- data/app/images/segment_check.png +0 -0
- data/app/images/segment_tools.png +0 -0
- data/app/images/slider_ball.png +0 -0
- data/app/images/whiteButton.png +0 -0
- data/app/main.m +0 -58
- data/features/uicatalog.feature +0 -20
- data/lib/icuke/com.apple.Accessibility.plist +0 -0
- data/lib/icuke/headless.rb +0 -54
- data/lib/icuke/xcode.rb +0 -164
data/.gitignore
CHANGED
data/.gitmodules
ADDED
data/README.rdoc
CHANGED
|
@@ -20,8 +20,8 @@ Write some scenarios like:
|
|
|
20
20
|
|
|
21
21
|
== How it works
|
|
22
22
|
|
|
23
|
-
iCuke
|
|
24
|
-
|
|
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
|
|
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
|
|
36
|
+
iCuke does not support pinches yet. They'll be here soon!
|
|
37
37
|
|
|
38
|
-
iCuke compiles against the 3.1.
|
|
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/
|
|
18
|
-
gem.files += ['ext/
|
|
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/
|
|
26
|
-
|
|
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/
|
|
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.
|
|
1
|
+
0.6.0
|
data/app/.gitignore
CHANGED
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.
|
data/app/Readme.markdown
ADDED
|
@@ -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
|
|
Binary file
|
|
@@ -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>
|
|
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.
|
|
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>
|
|
24
|
+
<string>1.0</string>
|
|
25
25
|
<key>LSRequiresIPhoneOS</key>
|
|
26
26
|
<true/>
|
|
27
27
|
<key>NSMainNibFile</key>
|
|
28
|
-
<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>
|
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
|
+
}
|