/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*
//! [getting started]
    \section1 Getting Started

    Qt supports you in building, testing, and deploying applications for iOS. Qt
    applications are typically defined using the \l{Build with CMake}{CMake} or
    \l qmake build tools. Both tools can generate an \c .xcodeproj file that
    can then be loaded and built from the command line, or with Xcode.
    \l{Qt Creator Manual}{Qt Creator} also directly supports building, running,
    debugging, and profiling CMake and qmake projects for iOS.

    The minimum deployment target for Qt applications is specified in
    \l {Supported Platforms}.

    \section2 Setting Up the Development Environment

    You can download the Qt installers from the \l Downloads page.
    For more information, see \l{Getting Started with Qt}.

    Before installing Qt, you first need to install
    Xcode. You will find it in the Mac App Store \l{Xcode}{here}.

    \note As recommended by Apple, you should always use the latest
    Xcode version when building your applications for the App Store.
    In practice this means you also need the latest version of \macos to develop
    apps with Qt, due to Xcode's system requirements.

    For running Qt applications on your Mac or in the simulator that comes with
    Xcode, this is all you need. However, for running applications on a
    mobile device and/or publishing your applications in the App Store, you must
    join the \l{Apple Developer Program}, and set up
    developer certificates and provisioning profiles. The easiest
    solution is to use a profile that takes any App ID (a \c *).

    Before building any Qt applications, you should test that Xcode
    is set up correctly, for example, by running one of the standard
    Xcode application templates on your device.

    \section2 Building Applications from the Command Line

    Use CMake or qmake to define how to build your iOS application. Both CMake
    and qmake can generate an \c xcodeproj file, which can then be loaded and
    built from the command line.

    \section3 Using CMake

    While it's possible to use Makefiles or Ninja to build static libraries
    targeting iOS, you have to use the Xcode generator for executable
    applications or shared libraries.

    You can choose to use the \c qt-cmake convenience script located in
    \c <Qt-dir>/<version>/ios/bin/ or use CMake directly from the
    command line. If you run CMake directly, you need to set the
    \c CMAKE_OSX_SYSROOT, \c CMAKE_OSX_ARCHITECTURES, and the Qt toolchain file
    with \c CMAKE_TOOLCHAIN_FILE. The \c qt-cmake convenience script will set
    these variables for you.

    Using \c qt-cmake convencience script:

    \badcode
        <Qt-dir>/<version>/ios/bin/qt-cmake <source-dir> -G Xcode
    \endcode

    Using CMake directly:

    \badcode
        cmake <source-dir> -G Xcode -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_SYSROOT="iphoneos" -DCMAKE_TOOLCHAIN_FILE="<Qt-dir>/<version>/ios/lib/cmake/Qt6/qt.toolchain.cmake"
    \endcode

    Using the generated \c xcodeproj file, you can either use Xcode to build
    your application or run \c xcodebuild from the command line. For a list of
    available targets and schemes for your application, run the following
    command:

    \badcode
        xcodebuild -list -project <your-app>.xcodeproj
    \endcode

    Then, run \c {xcodebuild build}, passing in your application details:

    \badcode
        xcodebuild build -allowProvisioningUpdates -project <your-app>.xcodeproj -scheme <your-scheme> -configuration Debug -destination "generic/platform=iOS" -destination-timeout 1 ENABLE_ONLY_ACTIVE_RESOURCES=NO
    \endcode

    \section3 Using qmake

    First, define how to build the application using qmake. Then, use the
    generated \c xcodeproj file to build the application, either in Xcode or
    from the command line.

    \badcode
        qmake <your-app>.pro -spec macx-ios-clang CONFIG+=debug CONFIG+=iphoneos CONFIG+=device CONFIG+=qml_debug QMAKE_MAC_XCODE_SETTINGS+=qteam qteam.name=DEVELOPMENT_TEAM qteam.value=<your-team-id> QMAKE_TARGET_BUNDLE_PREFIX+=com.<your-company> QMAKE_BUNDLE+=<your-app>
    \endcode

    qmake creates a wrapper Makefile that in turns calls \c xcodebuild, so you
    can run \c make to build your application:

    \badcode
        make -j8
    \endcode

    Note that you must re-import the project if its setup changes, for
    example, when adding or removing source files.

    \section2 Building Applications with Qt Creator

    You can find information on how to set up and run Apple mobile device
    applications in Qt Creator's manual:

    \list
        \li \l{Qt Creator: Connecting iOS devices}{Connecting Apple Mobile Devices}.
    \endlist

    As mentioned previously, you must have Xcode installed.

    \section1 Using Objective-C Code in Qt Applications

    Clang, the compiler used for applications on Apple Platforms, allows mixing
    C++ and Objective-C code. To enable this mode, suffix your source
    files with \c .mm, and add them to \c OBJECTIVE_SOURCES instead of
    \c SOURCES in the \c .pro file. This makes it possible to use
    frameworks from Apple's Developer Library in Qt applications.
    Most useful is perhaps the possibility for adding In-App
    Purchasing with the StoreKit framework.

//! [getting started]
*/
