wrap a flet app in xcode
temporarily replace flet_runtime/app.py with flet_runtime_app.py(All changes commented in flet_runtime_app.py markded with #!!!)
- in fletxcode.py py:
- app mode: use "ft.app(target=main)"
- web browser mode: use "ft.app(target=main,view=ft.AppView.WEB_BROWSER)" run : pyinstaller fletxcode.py
app mode: go to dist/flexcode/_internal/flet/bin/,unzip the flet-macos-amd64.tar.gz at same folder
web browser mode: copy "flet/web" folder to "dist/flexcode/_internal/flet"
drag the packed fletxcode folder to xcode project ,same level as fletxcodeApp.swift
in line 64-65:
let executable = "fletxcode"//executable name, same level as _internal folder
let exec_dir = "fletxcode" //folder name

for the first, time, while the bookmark data not established,it might shows:
"Bookmark data not found in UserDefaults." or "Failed to start accessing security scoped resource."
run and build again, it will show "Accessing Bundle Resources.", then the flet app will be successfully started.