Skip to content

Commit 0090cc3

Browse files
committed
[[ Bug 22605 ]] Use storyboard for iOS startup screens
This patch implements storyboard compilation and inclusion as the startup and launch screens on iOS. The template storyboard allows for a single centered and unscaled image and a background color which will be visible in transparent areas of the image and areas outside the image rectangle. Two variants of the compiled storyboard are required. The `LaunchScreen` is loaded by the OS. The `StartupScreen` is loaded by the engine while it is initializing. They are the same with the minor tweak of a custom class and launch screen setting.
1 parent fcdcb0a commit 0090cc3

File tree

7 files changed

+223
-239
lines changed

7 files changed

+223
-239
lines changed

engine/engine.gyp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,18 +488,17 @@
488488
{
489489
'dist_aux_files':
490490
[
491-
492491
'rsrc/fontmap',
493492
'rsrc/mobile-device-template.plist',
494493
'rsrc/mobile-remote-notification-template.plist',
495-
'rsrc/mobile-splashscreen-template.plist',
496494
'rsrc/mobile-template.plist',
497495
'rsrc/mobile-url-scheme-template.plist',
498496
'rsrc/mobile-disable-ats-template.plist',
499497
'rsrc/template-entitlements.xcent',
500498
'rsrc/template-beta-report-entitlement.xcent',
501499
'rsrc/template-remote-notification-entitlements.xcent',
502500
'rsrc/template-remote-notification-store-entitlements.xcent',
501+
'rsrc/template.storyboard',
503502
],
504503
},
505504
},

engine/rsrc/[email protected]

-816 Bytes
Binary file not shown.

engine/rsrc/mobile-device-template.plist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
<key>CFBundleShortVersionString</key>
3030
<string>${BUNDLE_VERSION}</string>
3131
${BUNDLE_ICONS}
32-
<key>UILaunchImages</key>
33-
<array>
34-
${SPLASHSCREENS}
35-
</array>
3632
<key>DTCompiler</key>
3733
<string>com.apple.compilers.llvm.clang.1_0</string>
3834
<key>DTPlatformBuild</key>
@@ -64,6 +60,8 @@
6460
<dict>
6561
${DEVICE_CAPABILITY}
6662
</dict>
63+
<key>UILaunchStoryboardName</key>
64+
<string>LaunchScreen</string>
6765
<key>UIRequiresPersistentWiFi</key>
6866
${PERSISTENT_WIFI}
6967
<key>UIInitialInterfaceOrientation</key>

engine/rsrc/mobile-splashscreen-template.plist

Lines changed: 0 additions & 10 deletions
This file was deleted.

engine/rsrc/mobile-template.plist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
${BUNDLE_DISPLAY_NAME_SUPPORT}
2626
<key>MinimumOSVersion</key>
2727
${MINIMUM_OS_SUPPORT}
28-
<key>UILaunchImages</key>
29-
<array>
30-
${SPLASHSCREENS}
31-
</array>
3228
<key>UIDeviceFamily</key>
3329
<array>
3430
${DEVICE_SUPPORT}
@@ -37,6 +33,8 @@
3733
<dict>
3834
${DEVICE_CAPABILITY}
3935
</dict>
36+
<key>UILaunchStoryboardName</key>
37+
<string>LaunchScreen</string>
4038
<key>UIRequiresPersistentWiFi</key>
4139
${PERSISTENT_WIFI}
4240
<key>UIInitialInterfaceOrientation</key>

engine/rsrc/template.storyboard

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="${LAUNCH_SCREEN}" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="ipad12_9rounded" orientation="portrait" layout="fullscreen" appearance="light"/>
4+
<dependencies>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
6+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8+
</dependencies>
9+
<scenes>
10+
<!--View Controller-->
11+
<scene sceneID="EHf-IW-A2E">
12+
<objects>
13+
<viewController id="01J-lp-oVM" ${CUSTOM_CLASS} sceneMemberID="viewController">
14+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
15+
<rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
16+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17+
<subviews>
18+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="livecode_launch_image" translatesAutoresizingMaskIntoConstraints="NO" id="pPj-nc-AKt">
19+
<rect key="frame" x="${LAUNCH_IMAGE_X_ORIGIN}" y="${LAUNCH_IMAGE_Y_ORIGIN}" width="${LAUNCH_IMAGE_WIDTH}" height="${LAUNCH_IMAGE_HEIGHT}"/>
20+
</imageView>
21+
</subviews>
22+
<color key="backgroundColor" red="${BACKCOLOR_RED}" green="${BACKCOLOR_GREEN}" blue="${BACKCOLOR_BLUE}" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
23+
<constraints>
24+
<constraint firstItem="pPj-nc-AKt" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="MhG-0G-r7K"/>
25+
<constraint firstItem="pPj-nc-AKt" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="Oh7-59-YIx"/>
26+
</constraints>
27+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
28+
</view>
29+
</viewController>
30+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
31+
</objects>
32+
<point key="canvasLocation" x="92.800000000000011" y="210.832083958021"/>
33+
</scene>
34+
</scenes>
35+
<resources>
36+
<image name="livecode_launch_image" width="${LAUNCH_IMAGE_WIDTH}" height="${LAUNCH_IMAGE_HEIGHT}"/>
37+
</resources>
38+
</document>

0 commit comments

Comments
 (0)