xcode: fix last problems of API compability

This commit is contained in:
Gautier Pelloux-Prayer 2016-02-05 14:18:18 +01:00
parent 7f4f95a9d1
commit ba114e525f
8 changed files with 40 additions and 36 deletions

View file

@ -278,6 +278,7 @@ struct codec_name_pref_table codec_pref_table[] = {{"speex", 8000, "speex_8k_pre
[NSNotificationCenter.defaultCenter removeObserver:self];
}
#pragma deploymate push "ignored-api-availability"
- (void)silentPushFailed:(NSTimer *)timer {
if (_silentPushCompletion) {
LOGI(@"silentPush failed, silentPushCompletion block: %p", _silentPushCompletion);
@ -285,6 +286,7 @@ struct codec_name_pref_table codec_pref_table[] = {{"speex", 8000, "speex_8k_pre
_silentPushCompletion = nil;
}
}
#pragma deploymate pop
#pragma mark - Migration
@ -599,14 +601,15 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
linphone_call_set_user_data(call, (void *)CFBridgingRetain(data));
}
#pragma deploymate push "ignored-api-availability"
if (_silentPushCompletion) {
// we were woken up by a silent push. Call the completion handler with NEWDATA
// so that the push is notified to the user
LOGI(@"onCall - handler %p", _silentPushCompletion);
_silentPushCompletion(UIBackgroundFetchResultNewData);
_silentPushCompletion = nil;
}
#pragma deploymate pop
const LinphoneAddress *addr = linphone_call_get_remote_address(call);
NSString *address = [FastAddressBook displayNameForAddress:addr];
@ -897,6 +900,7 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
#pragma mark - Text Received Functions
- (void)onMessageReceived:(LinphoneCore *)lc room:(LinphoneChatRoom *)room message:(LinphoneChatMessage *)msg {
#pragma deploymate push "ignored-api-availability"
if (_silentPushCompletion) {
// we were woken up by a silent push. Call the completion handler with NEWDATA
// so that the push is notified to the user
@ -904,6 +908,8 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
_silentPushCompletion(UIBackgroundFetchResultNewData);
_silentPushCompletion = nil;
}
#pragma deploymate pop
NSString *callID = [NSString stringWithUTF8String:linphone_chat_message_get_custom_header(msg, "Call-ID")];
const LinphoneAddress *remoteAddress = linphone_chat_message_get_from_address(msg);
NSString *from = [FastAddressBook displayNameForAddress:remoteAddress];

View file

@ -41,10 +41,13 @@ INIT_WITH_COMMON_CF {
#pragma mark - UIToggleButtonDelegate Functions
- (void)audioRouteChangeListenerCallback:(NSNotification *)notif {
if ([[notif.userInfo valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue] ==
AVAudioSessionRouteChangeReasonRouteConfigurationChange) {
#pragma deploymate push "ignored-api-availability"
if (UIDevice.currentDevice.systemVersion.doubleValue < 7 ||
[[notif.userInfo valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue] ==
AVAudioSessionRouteChangeReasonRouteConfigurationChange) {
[self update];
}
#pragma deploymate pop
}
- (void)onOn {

View file

@ -496,28 +496,29 @@ static RootViewManager *rootViewManagerInstance = nil;
}
- (void)updateStatusBar:(UICompositeViewDescription *)to_view {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
// In iOS7, the app has a black background on dialer, incoming and incall, so we have to adjust the
// status bar style for each transition to/from these views
BOOL toLightStatus = (to_view != NULL) && ![to_view darkBackground];
if (!toLightStatus) {
// black bg: white text on black background
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
#pragma deploymate push "ignored-api-availability"
if (UIDevice.currentDevice.systemVersion.doubleValue >= 7.) {
// In iOS7, the app has a black background on dialer, incoming and incall, so we have to adjust the
// status bar style for each transition to/from these views
BOOL toLightStatus = (to_view != NULL) && ![to_view darkBackground];
if (!toLightStatus) {
// black bg: white text on black background
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
[UIView animateWithDuration:0.3f
animations:^{
statusBarBG.backgroundColor = [UIColor blackColor];
}];
[UIView animateWithDuration:0.3f
animations:^{
statusBarBG.backgroundColor = [UIColor blackColor];
}];
} else {
// light bg: black text on white bg
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
[UIView animateWithDuration:0.3f
animations:^{
statusBarBG.backgroundColor = [UIColor colorWithWhite:0.935 alpha:1];
}];
} else {
// light bg: black text on white bg
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
[UIView animateWithDuration:0.3f
animations:^{
statusBarBG.backgroundColor = [UIColor colorWithWhite:0.935 alpha:1];
}];
}
#endif
#pragma deploymate pop
}
- (void)fullScreen:(BOOL)enabled {

View file

@ -16,7 +16,7 @@
[super viewDidLoad];
#pragma deploymate push "ignored-api-availability"
if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 7) {
if (UIDevice.currentDevice.systemVersion.doubleValue >= 7) {
// it's better to detect only pan from screen edges
UIScreenEdgePanGestureRecognizer *pan =
[[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(onLateralSwipe:)];

View file

@ -14,6 +14,7 @@
// This code is licensed under the BSD license that is available at: http://www.opensource.org/licenses/bsd-license.php
//
#pragma deploymate push "ignored-api-availability"
#import "IASKAppSettingsViewController.h"
#import "IASKSettingsReader.h"
@ -905,3 +906,5 @@ CGRect IASKCGRectSwap(CGRect rect) {
return newRect;
}
@end
#pragma deploymate pop

View file

@ -15,7 +15,7 @@
//
#import "IASKAppSettingsWebViewController.h"
#pragma deploymate push "ignored-api-availability"
@implementation IASKAppSettingsWebViewController
@synthesize url;
@ -145,7 +145,6 @@
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self dismissModalViewControllerAnimated:YES];
}
#pragma deploymate pop
@end

View file

@ -14,6 +14,7 @@
// This code is licensed under the BSD license that is available at: http://www.opensource.org/licenses/bsd-license.php
//
#pragma deploymate push "ignored-api-availability"
#import "IASKPSTextFieldSpecifierViewCell.h"
#import "IASKTextField.h"
#import "IASKSettingsReader.h"
@ -66,8 +67,6 @@
}
_textField.frame = textFieldFrame;
}
#pragma deploymate pop
@end

View file

@ -37,13 +37,6 @@
self.landscapeView = nil;
}
- (void)viewDidUnload {
[super viewDidUnload];
portraitAttributes = nil;
landscapeAttributes = nil;
}
- (void)dealloc {
portraitAttributes = nil;
landscapeAttributes = nil;