Kaydet (Commit) 135cb84e authored tarafından siqi's avatar siqi

iOS5 backward compatible

Change-Id: Ia540e68d953069e5f690a36303823f59e1129b46
üst fc0a23e5
......@@ -36,7 +36,6 @@
57C6E405175E06E800E8BC5F /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E404175E06E800E8BC5F /* Default.png */; };
57C6E407175E06E800E8BC5F /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E406175E06E800E8BC5F /* Default@2x.png */; };
57C6E409175E06E800E8BC5F /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E408175E06E800E8BC5F /* Default-568h@2x.png */; };
57C6E40C175E06E800E8BC5F /* iPhone_autolayout.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40A175E06E800E8BC5F /* iPhone_autolayout.storyboard */; };
57C6E42E175E076900E8BC5F /* Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E427175E076900E8BC5F /* Client.m */; };
57C6E42F175E076900E8BC5F /* CommunicationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E429175E076900E8BC5F /* CommunicationManager.m */; };
57C6E430175E076900E8BC5F /* CommandInterpreter.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E42B175E076900E8BC5F /* CommandInterpreter.m */; };
......@@ -49,7 +48,7 @@
57DC7007178D84490050FC58 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57DC7006178D84490050FC58 /* CoreMotion.framework */; };
57DC700F178E03330050FC58 /* touchPointer_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 57DC700E178E03330050FC58 /* touchPointer_vc.m */; };
57DC7012178E16A40050FC58 /* setRecursiveUserInteraction.m in Sources */ = {isa = PBXBuildFile; fileRef = 57DC7011178E16A40050FC58 /* setRecursiveUserInteraction.m */; };
57DF0A85178FFFAB008B2D3D /* iPhone_spring&strut.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57DF0A83178FFFAB008B2D3D /* iPhone_spring&strut.storyboard */; };
57DF0A85178FFFAB008B2D3D /* iPhone_autosize.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57DF0A83178FFFAB008B2D3D /* iPhone_autosize.storyboard */; };
57FE71E31785C61400B50125 /* pinValidation_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 57FE71E21785C61400B50125 /* pinValidation_vc.m */; };
57FE71E61785D7FE00B50125 /* slideShowPreview_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 57FE71E51785D7FE00B50125 /* slideShowPreview_vc.m */; };
57FE71E917861A9000B50125 /* slideShowPreviewTable_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 57FE71E817861A9000B50125 /* slideShowPreviewTable_vc.m */; };
......@@ -99,7 +98,6 @@
57C6E404175E06E800E8BC5F /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
57C6E406175E06E800E8BC5F /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
57C6E408175E06E800E8BC5F /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
57C6E40B175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/iPhone_autolayout.storyboard; sourceTree = "<group>"; };
57C6E426175E076900E8BC5F /* Client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Client.h; sourceTree = "<group>"; };
57C6E427175E076900E8BC5F /* Client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Client.m; sourceTree = "<group>"; };
57C6E428175E076900E8BC5F /* CommunicationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CommunicationManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
......@@ -119,7 +117,7 @@
57DC700E178E03330050FC58 /* touchPointer_vc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = touchPointer_vc.m; sourceTree = "<group>"; };
57DC7010178E16A40050FC58 /* setRecursiveUserInteraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setRecursiveUserInteraction.h; sourceTree = "<group>"; };
57DC7011178E16A40050FC58 /* setRecursiveUserInteraction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = setRecursiveUserInteraction.m; sourceTree = "<group>"; };
57DF0A84178FFFAB008B2D3D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = "en.lproj/iPhone_spring&strut.storyboard"; sourceTree = "<group>"; };
57DF0A84178FFFAB008B2D3D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/iPhone_autoSize.storyboard; sourceTree = "<group>"; };
57FE71E11785C61300B50125 /* pinValidation_vc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pinValidation_vc.h; path = Communication/pinValidation_vc.h; sourceTree = "<group>"; };
57FE71E21785C61400B50125 /* pinValidation_vc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = pinValidation_vc.m; path = Communication/pinValidation_vc.m; sourceTree = "<group>"; };
57FE71E41785D7FE00B50125 /* slideShowPreview_vc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = slideShowPreview_vc.h; sourceTree = "<group>"; };
......@@ -296,8 +294,7 @@
57DF0A78178FFF8C008B2D3D /* StoryBoards */ = {
isa = PBXGroup;
children = (
57DF0A83178FFFAB008B2D3D /* iPhone_spring&strut.storyboard */,
57C6E40A175E06E800E8BC5F /* iPhone_autolayout.storyboard */,
57DF0A83178FFFAB008B2D3D /* iPhone_autosize.storyboard */,
);
name = StoryBoards;
sourceTree = "<group>";
......@@ -358,7 +355,6 @@
57C6E405175E06E800E8BC5F /* Default.png in Resources */,
57C6E407175E06E800E8BC5F /* Default@2x.png in Resources */,
57C6E409175E06E800E8BC5F /* Default-568h@2x.png in Resources */,
57C6E40C175E06E800E8BC5F /* iPhone_autolayout.storyboard in Resources */,
57867A541787172A00EBBE52 /* impress.jpeg in Resources */,
57867A5A1787510700EBBE52 /* pushed_next_button.png in Resources */,
57867A5B1787510700EBBE52 /* released_next_button.png in Resources */,
......@@ -374,7 +370,7 @@
57CC48C7178B42A400075DE4 /* timer_resume_btn.png in Resources */,
57DC7003178D82610050FC58 /* ic_launcher.png in Resources */,
57DC7005178D82940050FC58 /* ic_launcher@2x.png in Resources */,
57DF0A85178FFFAB008B2D3D /* iPhone_spring&strut.storyboard in Resources */,
57DF0A85178FFFAB008B2D3D /* iPhone_autosize.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -420,20 +416,12 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
57C6E40A175E06E800E8BC5F /* iPhone_autolayout.storyboard */ = {
isa = PBXVariantGroup;
children = (
57C6E40B175E06E800E8BC5F /* en */,
);
name = iPhone_autolayout.storyboard;
sourceTree = "<group>";
};
57DF0A83178FFFAB008B2D3D /* iPhone_spring&strut.storyboard */ = {
57DF0A83178FFFAB008B2D3D /* iPhone_autosize.storyboard */ = {
isa = PBXVariantGroup;
children = (
57DF0A84178FFFAB008B2D3D /* en */,
);
name = "iPhone_spring&strut.storyboard";
name = iPhone_autosize.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
......
......@@ -17,29 +17,16 @@
landmarkType = "3">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "iosremote/newServer_vc.m"
timestampString = "395055655.034211"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "50"
endingLineNumber = "50"
landmarkName = "-viewWillAppear:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "iosremote/newServer_vc.m"
timestampString = "395055655.034211"
filePath = "iosremote/slideShowSwipeInList.m"
timestampString = "395327716.10653"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "46"
endingLineNumber = "46"
landmarkName = "-viewDidLoad"
startingLineNumber = "122"
endingLineNumber = "122"
landmarkName = "-tableView:cellForRowAtIndexPath:"
landmarkType = "5">
</FileBreakpoint>
</FileBreakpoints>
......
......@@ -12,11 +12,11 @@
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate> {
// make sure we instanciate only once motionManager
CMMotionManager *motionManager;
}
@property (readonly) CMMotionManager *motionManager;
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
......@@ -10,9 +10,27 @@
@implementation AppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
/**
* If ever we need some iOS6-only storyboard based features and we want to keep backward compatibility, we should uncomment these code to pick the right storyboard based on the existence on certains classes.
*/
// UIStoryboard *mainStoryboard = nil;
// if (NSClassFromString(@"NSLayoutConstraint")) {
// mainStoryboard = [UIStoryboard storyboardWithName:@"iPhone_autolayout" bundle:nil];
// NSLog(@"loading autolayout storyboard");
// } else {
// mainStoryboard = [UIStoryboard storyboardWithName:@"iPhone_autosize" bundle:nil];
// NSLog(@"Doesn't support autolayout, loading autosize");
// }
//
// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// self.window.rootViewController = [mainStoryboard instantiateInitialViewController];
// [self.window makeKeyAndVisible];
return YES;
}
......
......@@ -38,7 +38,7 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>iPhone_autolayout</string>
<string>iPhone_autoSize</string>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
......
......@@ -63,14 +63,18 @@
{
if (self.slidesRunning && [self.comManager.interpreter.slideShow size] > 0){
self.slidesRunning = NO;
[self.parentViewController performSegueWithIdentifier:@"slideShowSegue" sender:self];
[self performSegueWithIdentifier:@"slideShowSegue" sender:self];
}
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
self.slideShowStartObserver = [[NSNotificationCenter defaultCenter] addObserverForName:STATUS_CONNECTED_SLIDESHOW_RUNNING
object:nil
queue:mainQueue
usingBlock:^(NSNotification *note) {
[self.parentViewController performSegueWithIdentifier:@"slideShowSegue" sender:self];
// if (NSClassFromString(@"NSLayoutConstraint"))
// // support autolayout, this tablevc has a parent_vc which has this segue
// [self.parentViewController performSegueWithIdentifier:@"slideShowSegue" sender:self];
// else
[self performSegueWithIdentifier:@"slideShowSegue" sender:self];
}];
[super viewDidAppear:animated];
}
......
......@@ -52,11 +52,11 @@ dispatch_queue_t backgroundQueue;
- (void) viewDidAppear:(BOOL)animated
{
[self changeStartButtonIconForButton:nil];
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.slideshow.currentSlide
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:self.slideshow.currentSlide
inSection:1];
[self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
[[[self.tableView cellForRowAtIndexPath:indexPath] viewWithTag:2] setBackgroundColor:[UIColor lightGrayColor]];
// [[[self.tableView cellForRowAtIndexPath:indexPath] viewWithTag:2] setBackgroundColor:[UIColor lightGrayColor]];
}
- (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender
......@@ -114,6 +114,11 @@ dispatch_queue_t backgroundQueue;
return nil;
}
- (void) tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier: @"sw_customized_segue" sender: [tableView cellForRowAtIndexPath: indexPath]];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0) {
......@@ -137,6 +142,16 @@ dispatch_queue_t backgroundQueue;
}
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
// Otherwise selection will disable background color and make slide number unreadable
if(indexPath.section == 1 && cell.selected){
UILabel *label = (UILabel *)[cell viewWithTag:2];
if ([label backgroundColor]!=[UIColor lightGrayColor]) {
[label setBackgroundColor:[UIColor lightGrayColor]];
}
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
......@@ -165,7 +180,7 @@ dispatch_queue_t backgroundQueue;
// Format the elapsed time and set it to the label
NSString *timeString = [dateFormatter stringFromDate:timerDate];
UILabel *l = (UILabel *)[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]] viewWithTag:1];
UILabel *l = (UILabel *)[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]] viewWithTag:1];
l.text = timeString;
}
......@@ -207,7 +222,7 @@ dispatch_queue_t backgroundQueue;
{
UIButton * btn = sender;
if (!btn) {
btn = (UIButton *)[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]] viewWithTag:2];
btn = (UIButton *)[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]] viewWithTag:2];
}
switch (self.state) {
case TIMER_STATE_RUNNING:
......@@ -231,7 +246,7 @@ dispatch_queue_t backgroundQueue;
self.lastInterval = 0;
self.state = TIMER_STATE_CLEARED;
UIButton *l = (UIButton *)[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]] viewWithTag:2];
UIButton *l = (UIButton *)[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]] viewWithTag:2];
[l setImage:[UIImage imageNamed:@"timer_start_btn"] forState:UIControlStateNormal];
[self updateTimer];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment