Use a storyboard to launch the main UI. This is needed for iOS 8 because otherwise, the main window will have bad dimensions in landscape.

This commit is contained in:
Guillaume BIENKOWSKI 2014-09-30 15:31:42 +02:00
parent 39ee715e47
commit 8ab996a75d
6 changed files with 64 additions and 14 deletions

View file

@ -23,10 +23,6 @@
#import "LinphoneCoreSettingsStore.h"
@interface UILinphoneWindow : UIWindow
@end
@interface LinphoneAppDelegate : NSObject <UIApplicationDelegate,UIAlertViewDelegate> {
@private
UIWindow *window;
@ -40,6 +36,7 @@
@property (assign) BOOL started;
@property (nonatomic, retain) UIAlertView *waitingIndicator;
@property (nonatomic, retain) NSString *configURL;
@property (nonatomic, strong) UIWindow* window;
@end

View file

@ -30,14 +30,10 @@
#include "LinphoneManager.h"
#include "linphone/linphonecore.h"
@implementation UILinphoneWindow
@end
@implementation LinphoneAppDelegate
@synthesize started,configURL;
@synthesize window;
#pragma mark - Lifecycle Functions
@ -234,6 +230,7 @@
// Only execute one time at application start
if(!started) {
started = TRUE;
[self.window makeKeyAndVisible];
[[PhoneMainView instance] startUp];
}
}

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13E28" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="eUP-Pz-8te">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<scenes>
<!--Phone Main View-->
<scene sceneID="qBS-cv-8Um">
<objects>
<viewController id="eUP-Pz-8te" customClass="PhoneMainView" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="6Tz-cV-9RM">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="1" contentMode="scaleToFill" image="background.png" id="aXd-fi-pw6" userLabel="background">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
</imageView>
<view contentMode="scaleToFill" id="rlH-Ra-JOu" userLabel="statusBarBG">
<rect key="frame" x="0.0" y="0.0" width="768" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="mainViewController" destination="emC-P9-oZj" id="goX-7a-wOn"/>
<outlet property="statusBarBG" destination="rlH-Ra-JOu" id="gTV-n5-AgJ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qO2-xf-enZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
<viewController nibName="UICompositeViewController" wantsFullScreenLayout="YES" id="emC-P9-oZj" userLabel="mainViewController" customClass="UICompositeViewController">
<extendedEdge key="edgesForExtendedLayout"/>
<nil key="simulatedStatusBarMetrics"/>
</viewController>
</objects>
<point key="canvasLocation" x="880" y="302"/>
</scene>
</scenes>
<resources>
<image name="background.png" width="640" height="523"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View file

@ -101,10 +101,6 @@
</array>
<key>CFBundleVersion</key>
<string>2.2.2</string>
<key>NSMainNibFile</key>
<string>LinphoneApp</string>
<key>NSMainNibFile~ipad</key>
<string>LinphoneApp</string>
<key>UIApplicationExitsOnSuspend</key>
<false/>
<key>UIBackgroundModes</key>
@ -117,6 +113,8 @@
<string>linphone_splashscreen</string>
<key>UILaunchImageFile~iphone</key>
<string>linphone_splashscreen</string>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>wifi</string>

View file

@ -1353,6 +1353,8 @@
F04892FF180C3296002FED35 /* ImageOptim.sh in Resources */ = {isa = PBXBuildFile; fileRef = F04892FE180C3296002FED35 /* ImageOptim.sh */; };
F0489300180C3296002FED35 /* ImageOptim.sh in Resources */ = {isa = PBXBuildFile; fileRef = F04892FE180C3296002FED35 /* ImageOptim.sh */; };
F04F1E9D1806A41800D080F2 /* libpolarssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57B0E35F173C010400A476B8 /* libpolarssl.a */; };
F0642EF119DAC891009DB336 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */; };
F0642EF219DAC891009DB336 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */; };
F066515517F9A02E0064280C /* UITransparentTVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F066515417F9A02E0064280C /* UITransparentTVCell.m */; };
F066515617F9A02E0064280C /* UITransparentTVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F066515417F9A02E0064280C /* UITransparentTVCell.m */; };
F0818E7E17FC51D8005A3330 /* linphone_icon_76.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7C17FC51D8005A3330 /* linphone_icon_76.png */; };
@ -2282,6 +2284,7 @@
F03CA84118C72F1A0008889D /* UITextViewNoDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextViewNoDefine.h; sourceTree = "<group>"; };
F03CA84218C72F1A0008889D /* UITextViewNoDefine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UITextViewNoDefine.m; sourceTree = "<group>"; };
F04892FE180C3296002FED35 /* ImageOptim.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ImageOptim.sh; sourceTree = "<group>"; };
F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
F066515317F9A02E0064280C /* UITransparentTVCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITransparentTVCell.h; sourceTree = "<group>"; };
F066515417F9A02E0064280C /* UITransparentTVCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UITransparentTVCell.m; sourceTree = "<group>"; };
F0818E7B17FC5160005A3330 /* linphone_icon_120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_120.png; path = Resources/linphone_icon_120.png; sourceTree = "<group>"; };
@ -2670,6 +2673,7 @@
D38187E015FE348A00C3EDCA /* WizardViewController.xib */,
D3D5126E160B3AD400946DF8 /* WizardViewController~ipad.xib */,
D3D5126A160B3A8E00946DF8 /* WizardViews.xib */,
F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */,
);
path = Classes;
sourceTree = "<group>";
@ -4163,6 +4167,7 @@
D3A74F4215C69392001500B9 /* speaker_on_disabled~ipad.png in Resources */,
D3A74F4415C69392001500B9 /* speaker_on_over~ipad.png in Resources */,
D3A74F4615C69392001500B9 /* statebar_background_landscape~ipad.png in Resources */,
F0642EF119DAC891009DB336 /* MainStoryboard.storyboard in Resources */,
D3A74F4815C69392001500B9 /* statebar_background~ipad.png in Resources */,
D3A74F4A15C69392001500B9 /* transfer_call_default~ipad.png in Resources */,
D3A74F4C15C69392001500B9 /* transfer_call_over~ipad.png in Resources */,
@ -4709,6 +4714,7 @@
D3A74F4315C69392001500B9 /* speaker_on_disabled~ipad.png in Resources */,
D3A74F4515C69392001500B9 /* speaker_on_over~ipad.png in Resources */,
D3A74F4715C69392001500B9 /* statebar_background_landscape~ipad.png in Resources */,
F0642EF219DAC891009DB336 /* MainStoryboard.storyboard in Resources */,
D3A74F4915C69392001500B9 /* statebar_background~ipad.png in Resources */,
D3A74F4B15C69392001500B9 /* transfer_call_default~ipad.png in Resources */,
D3A74F4D15C69392001500B9 /* transfer_call_over~ipad.png in Resources */,

3
main.m
View file

@ -18,6 +18,7 @@
*/
#import <UIKit/UIKit.h>
#import "LinphoneAppDelegate.h"
#ifdef DEBUG
@ -35,7 +36,7 @@ int main(int argc, char *argv[]) {
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
#endif
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([LinphoneAppDelegate class]));
[pool release];
return retVal;
}