Skip to content

Commit

Permalink
Replace iOS launch screen with storyboard
Browse files Browse the repository at this point in the history
Fixes layout issue due to SDK silently altering effective screen size
when old launch image key is used in info.plist
  • Loading branch information
steveatinfincia committed Oct 12, 2019
1 parent 7f3cdea commit 2215626
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 35 deletions.
12 changes: 4 additions & 8 deletions QOpenHD.pro
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ DISTFILES += \
icons/AppIcon.appiconset/iPhone-spotlight@2x.png \
icons/AppIcon.appiconset/iPhone-spotlight@3x.png \
icons/AppIcon.appiconset/iTunesArtwork@2x.png \
icons/LaunchImage-iOS7-Landscape.png \
icons/LaunchImage-iOS7-Landscape@2x.png \
icons/LaunchImage-iOS7-Landscape@3x.png \
icons/LaunchImage-iOS7-Landscape@4x.png \
icons/LaunchImage-iOS7-Landscape~iPad.png \
icons/LaunchImage-iOS7-Landscape~iPad@2x.png \
qml/qtquickcontrols2.conf \
qml/ui/qmldir

Expand All @@ -117,15 +111,17 @@ DISTFILES += \
iOSBuild {
QMAKE_INFO_PLIST = ios/Info.plist
ICON = $${BASEDIR}/icons/macos.icns
DISTFILES += ios/Info.plist
DISTFILES += ios/Info.plist \
icons/LaunchScreen.png \
icons/LaunchScreen.storyboard
LIBS += -framework VideoToolbox -framework AudioToolbox -framework CoreAudio
CONFIG -= bitcode
CONFIG += EnableGamepads
CONFIG += EnableSpeech
CONFIG += EnableVideo
#QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $$APPLE_BUILD\" $$DESTDIR/$${TARGET}.app/Contents/Info.plist
#QMAKE_POST_LINK += && /usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $$APPLE_BUILD\" $$DESTDIR/$${TARGET}.app/Contents/Info.plist
app_launch_images.files = $$files($$PWD/icons/LaunchImage*.png)
app_launch_images.files = $$PWD/icons/LaunchScreen.png $$files($$PWD/icons/LaunchScreen.storyboard)
QMAKE_BUNDLE_DATA += app_launch_images

ios_icon.files = $$files($$PWD/icons/AppIcon.appiconset/*.png)
Expand Down
Binary file removed icons/LaunchImage-iOS7-Landscape.png
Binary file not shown.
Binary file removed icons/[email protected]
Binary file not shown.
Binary file removed icons/[email protected]
Binary file not shown.
Binary file removed icons/LaunchImage-iOS7-Landscape~iPad.png
Binary file not shown.
Binary file removed icons/[email protected]
Binary file not shown.
File renamed without changes
41 changes: 41 additions & 0 deletions icons/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen.png" translatesAutoresizingMaskIntoConstraints="NO" id="N4i-j3-JtW">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="N4i-j3-JtW" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="17N-m2-CEm"/>
<constraint firstItem="N4i-j3-JtW" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="4XU-wb-ZDi"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="N4i-j3-JtW" secondAttribute="bottom" id="NNC-ko-DRm"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="N4i-j3-JtW" secondAttribute="trailing" id="Ogf-3m-5Ab"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchScreen.png" width="2272" height="1280"/>
</resources>
</document>
31 changes: 4 additions & 27 deletions ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<true/>
<key>MinimumOSVersion</key>
<string>${IPHONEOS_DEPLOYMENT_TARGET}</string>

<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
Expand All @@ -42,33 +46,6 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>

<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage-iOS7-Landscape</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
</array>
<key>UILaunchImages~ipad</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage-iOS7-Landscape~iPad</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{768, 1024}</string>
</dict>
</array>

<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
Expand Down

0 comments on commit 2215626

Please sign in to comment.