ZFFramework
Loading...
Searching...
No Matches
iOS

Requirement

you must have these settings being prepared:

  • have XCode installed

once prepared, it's recommended to follow Quick setup for quick setup your project files
specially, when adding resource files, you must ensure they are placed under YourApp.app/zfres/, see the Manual Setup below for how to do it

Manual Setup

if you really want to setup manually:

  1. build necessary libraries of ZFFramework, by one of these methods:
    • tools from ~/tools/release
    • manually build projects under ~/ZF
  2. create your own iOS project
  3. drag and drop ZFFramework's libraries (*.xcframework) to your project
  4. modify your project's target settings:
    • Header Search Paths
    • Library Search Paths
    • Other Linker Flags:
      "-ObjC -all_load"
  5. ensure these libraries seleted in "Link Binary With Libraries" of XCode's target settings:
    • Foundation.framework
    • UIKit.framework
    • QuartzCore.framework
    • CoreGraphics.framework
    • WebKit.framework, if you want the ZFUIWebKit module
    • all ZFFramework's *.xcframework files
  6. add "New Run Script Phase" in your project's target's "Build Phases", to copy all resource files:
    ZF_ROOT_PATH=${SRCROOT}/path_to_ZFFramework
    RES_DST_PATH=${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/zfres
    sh "$ZF_ROOT_PATH/tools/util/copy_res.sh" "$ZF_ROOT_PATH/_release/iOS/module/required_ZF_lib_name/zfres" "$RES_DST_PATH"
    # ...
    sh "$ZF_ROOT_PATH/tools/util/copy_res.sh" "${SRCROOT}/../../../zfres" "$RES_DST_PATH"
    zfauto zfres(const zfchar *resFilePath, const ZFPathInfo &pathInfo=(zft_zfnull))
    load resource by ZFObjectIOLoad
    or, if you prefer to make it manually, please ensure all resource files of all modules are placed like this: (folder structure must be kept)
    YourApp.app/
    ZFUIKit/
    xxx.xml
    ZFUIWidget/
    xxx.xml
  7. create cpp files in your project and follow the Tutorial to code with ZFFramework, enjoy