iOS Setup
New project
npx @thelacanians/vue-native-cli create my-app
cd my-app
bun install
Open ios/ in Xcode and run on a simulator.
Add to existing Xcode project
1. Add the Swift package
In Xcode: File → Add Package Dependencies → Add Local → select native/ios/VueNativeCore.
Or with XcodeGen (project.yml):
packages:
VueNativeCore:
path: ../path/to/native/ios/VueNativeCore
targets:
MyApp:
dependencies:
- package: VueNativeCore
product: VueNativeCore
2. Copy the JS bundle at build time
Add a Run Script build phase:
cp "${SRCROOT}/../dist/vue-native-bundle.js" \
"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/vue-native-bundle.js"
3. Configure your view controller
// MyAppViewController.swift
import VueNativeCore
class MyAppViewController: VueNativeViewController {
override var bundleName: String { "vue-native-bundle" }
}
4. Set your window's root VC
// SceneDelegate.swift
func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
let window = UIWindow(windowScene: windowScene)
window.rootViewController = MyAppViewController()
window.makeKeyAndVisible()
self.window = window
}
Info.plist
No special keys are required for basic usage. For native modules:
| Module | Info.plist key |
|---|---|
| Camera | NSCameraUsageDescription |
| Photo library | NSPhotoLibraryUsageDescription |
| Microphone | NSMicrophoneUsageDescription |
| Location | NSLocationWhenInUseUsageDescription |
| Face ID | NSFaceIDUsageDescription |