iOS example projects
-
wrote on 7 Jun 2022, 03:42 last edited by
I'm trying to find some examples that show how to setup an iOS project.
Specifically, how do I create and setup a launchscreen storyboard? I don't understand this at all. I just want a minimal storyboard (an image splashscreen) or I would even settle for a blank white screen as long as the app store will accept it. Currently, my app fails validation with the app store because my launch screen is not configured properly and I'm completely lost on what to do about it.
Also, how do I setup the images catalog so that I don't have to drag all of the little icons into the appropriate fields after I clean & run qmake?
-
I'm trying to find some examples that show how to setup an iOS project.
Specifically, how do I create and setup a launchscreen storyboard? I don't understand this at all. I just want a minimal storyboard (an image splashscreen) or I would even settle for a blank white screen as long as the app store will accept it. Currently, my app fails validation with the app store because my launch screen is not configured properly and I'm completely lost on what to do about it.
Also, how do I setup the images catalog so that I don't have to drag all of the little icons into the appropriate fields after I clean & run qmake?
hi @kgregory
I would suggest the following, its the way I do it/ did it:
- compile your app
you should find a *.xcodeproj file
- open that generated Xcode project in Xcode.
Xcode does have a build in wizard for storyboards and image catalogs.
Once you have done that you can add those created files to your qt project. Using qmake:- excerpt from my pro file
ios{ QMAKE_ASSET_CATALOGS +=ios/AppIcons/Assets.xcassets QMAKE_INFO_PLIST = ios/Info.plist launchStoryboard.files = $$files($$PWD/ios/CustomLaunchScreen.storyboard) launchIcon.files = $$files($$PWD/ios/MyLaunchIcon.png) QMAKE_BUNDLE_DATA += launchIcon launchStoryboard DISTFILES += \ ios/Info.plist }
-
hi @kgregory
I would suggest the following, its the way I do it/ did it:
- compile your app
you should find a *.xcodeproj file
- open that generated Xcode project in Xcode.
Xcode does have a build in wizard for storyboards and image catalogs.
Once you have done that you can add those created files to your qt project. Using qmake:- excerpt from my pro file
ios{ QMAKE_ASSET_CATALOGS +=ios/AppIcons/Assets.xcassets QMAKE_INFO_PLIST = ios/Info.plist launchStoryboard.files = $$files($$PWD/ios/CustomLaunchScreen.storyboard) launchIcon.files = $$files($$PWD/ios/MyLaunchIcon.png) QMAKE_BUNDLE_DATA += launchIcon launchStoryboard DISTFILES += \ ios/Info.plist }
wrote on 8 Jun 2022, 02:13 last edited by kgregory 6 Aug 2022, 03:12@J-Hilk This helped alot, thanks!
Two more things:
-
do you know of a good tutorial on how to use the storyboard wizard? It makes no sense to me. I found some instructions on how to add a graphic, but I see no option in the editor to do so. Simply adding the icon via launchIcon.files doesn't seem to do anything for me.
-
Whenever I run clean & qmake, the default bundle identifier (in the General->Identity section of xcode) is never correct. It appears to be something that I put into some wizard when I first started this project and was just feeling my way around. For my life, I can't find where/how to set it (along with version & build). In my Info.plist, the bundle identifier field always reverts to "$(PRODUCT_BUNDLE_IDENTIFIER)", which I assume is a reference to that field in the General tab.
-
@J-Hilk This helped alot, thanks!
Two more things:
-
do you know of a good tutorial on how to use the storyboard wizard? It makes no sense to me. I found some instructions on how to add a graphic, but I see no option in the editor to do so. Simply adding the icon via launchIcon.files doesn't seem to do anything for me.
-
Whenever I run clean & qmake, the default bundle identifier (in the General->Identity section of xcode) is never correct. It appears to be something that I put into some wizard when I first started this project and was just feeling my way around. For my life, I can't find where/how to set it (along with version & build). In my Info.plist, the bundle identifier field always reverts to "$(PRODUCT_BUNDLE_IDENTIFIER)", which I assume is a reference to that field in the General tab.
@kgregory glad to hear it :D
- do you know of a good tutorial on how to use the storyboard wizard? It makes no sense to me. I found some instructions on how to add a graphic, but I see no option in the editor to do so. Simply adding the icon via launchIcon.files doesn't seem to do anything for me.
sorry I do not. For me, IIRC, the
launchIcon.files = $$files(...)
is for qmake to put the image into the app bundle so it can be used/found by the storyboard at runtime<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> <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"> <layoutGuides> <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="Startbildschirm.png" translatesAutoresizingMaskIntoConstraints="NO" id="FKH-qG-Hzl"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> </imageView> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="52" y="374.66266866566718"/> </scene> </scenes> <resources> <image name="MyLaunchIcon.png" width="720" height="457"/> </resources> </document>
- Whenever I run clean & qmake, the default bundle identifier (in the General->Identity section of xcode) is never correct. It appears to be something that I put into some wizard when I first started this project and was just feeling my way around. For my life, I can't find where/how to set it (along with version & build). In my Info.plist, the bundle identifier field always reverts to "$(PRODUCT_BUNDLE_IDENTIFIER)", which I assume is a reference to that field in the General tab.
you're using
QMAKE_INFO_PLIST
to ship your own custom info.plist right ?I think you can set the PRODUCT_BUNDLE_IDENTIFIER via
xcode_product_bundle_identifier_setting.value
in the pro file orQMAKE_TARGET_BUNDLE_PREFIX
its very much not documented well.
-
1/4