qt5base-lts/tests/manual/ios_assets/utils.mm
Alexandru Croitor cf3535fdf2 CMake: Add manual test for various iOS asset handling
Includes:
- setting a custom Info.plist
- Bundling non-image assets
- Bundling image assets using asset catalogs
- Bundling app icons
- Bundling a launch screen

Projects added for both qmake and CMake.
The executable uses testlib to check that non-image assets,
icons and asset catalogs were successfully bundled upon deployment
to a device.

Task-number: QTBUG-104519
Change-Id: Iaab6112e31e1098dcd2548e18b58bed5b64e6f83
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-17 01:05:45 +02:00

19 lines
449 B
Plaintext

// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtCore/QString>
#ifdef Q_OS_IOS
#include <UIKit/UIKit.h>
#endif
bool imageExistsInAssetCatalog(QString imageName) {
#ifdef Q_OS_IOS
UIImage* image = [UIImage imageNamed:imageName.toNSString()];
return image != nil;
#else
// Don't fail the test when building on platforms other than iOS.
return true;
#endif
}