You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`liveview-native-swiftui-photokit` is an add-on library for [LiveView Native](https://github.com/liveview-native/live_view_native). It adds [PhotoKit](https://developer.apple.com/documentation/photokit) support for uploading images from the Photos app and camera.
6
+
7
+
## Installation
8
+
9
+
1. Add this library as a package to your LiveView Native application's Xcode project
10
+
* In Xcode, select *File* → *Add Packages...*
11
+
* Enter the package URL `https://github.com/liveview-native/liveview-native-swiftui-photokit`
12
+
* Select *Add Package*
13
+
14
+
## Usage
15
+
16
+
Add `.photoKit` to the `addons` list of your `#LiveView`.
17
+
18
+
```swift
19
+
importSwiftUI
20
+
importLiveViewNative
21
+
importLiveViewNativePhotoKit// 1. Import the add-on library.
22
+
23
+
structContentView: View {
24
+
var body: some View {
25
+
#LiveView(
26
+
.localhost,
27
+
addons: [.photoKit] // 2. Include the `PhotoKit` addon.
28
+
)
29
+
}
30
+
}
31
+
```
32
+
33
+
Use a `PhotosPicker` or `LiveCameraPicker` to upload images.
34
+
Include a `live_img_preview` to display the selected images before upload.
0 commit comments