media/DSImagePicker
DSImagePicker
mediaPhoto library and camera source picker that returns a UIImage/SwiftUI Image. Shows a preview thumbnail after selection.
iOS 17+
Purpose
Profile photo upload, post creation, avatar editing.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| imagereq | Binding<UIImage?> | โ | Bound selected image. |
| allowsCamera | Bool | true | Includes camera as a source option. |
| cropStyle | DSCropStyle | .square | .square, .circle, .freeform. |
| placeholder | String | "Add photo" | Empty state label. |
Examples
Profile avatar editor
Tappable avatar that opens the image picker.
swift
DSImagePicker(image: $profilePhoto, cropStyle: .circle) {
DSAvatar(image: profilePhoto, size: .xl)
.overlay(alignment: .bottomTrailing) {
DSIconButton(icon: "camera.fill", size: .sm, action: {})
}
}