Introducing the ImageDataPicker
A SwiftUI Framework Package for PhotoLibrary Image Selection
Are you building a SwiftUI app that needs to let users pick, preview, and manage images from their iOS PhotoLibrary? Meet the ImageDataPicker — an open-source framework designed to make image selection in your apps seamless and intuitive.
What is ImageDataPicker?
ImageDataPicker is a Swift package that provides a robust, reusable SwiftUI component for image picking. It handles everything from presenting the image picker UI to managing image data, error states, and custom shapes for image previews. Whether you’re building a profile editor, a form, or any feature that needs user-supplied images, ImageDataPicker can save you time and effort.
Getting Started
- Grab the ImageDataPicker package:
Head to Swift Package Index for the package details or; - Download the multi-platform framework from the repo:
The ImageDataPicker repo lists the latest releases with archives for extracting the framework for use in your application. - Add the package or framework to your app:
Then import the library to start using the SwiftUI control in your app.
import ImageDataPicker
import SwiftUI
struct ContentView: View{
@State var data: Data? = nil
var body: some View {
ImageDataPickerView(imageData: $data, clipShape: Circle())
.frame(width: 240, height: 240)
}
}
}- Walk through the tutorial:
We have created a step-by-step tutorial showing how to use the ImageDataPicker. - Explore the Example app:
Run theEmployeeFormExampleapp to see ImageDataPicker in action. - Take a look at the documentation:
Dive into the DocC documentation for details on both the framework and the sample app to learn how to integrate and customize ImageDataPicker. - Integrate into Your App:
Add theImageDataPickerframework to your project and start building better image selection experiences for your users.
What’s in the Repository?
The GitHub repository is organized into two main parts:
- ImageDataPicker Framework (
ImageDataPickerfolder):
The core framework, ready to be integrated into your own projects. It’s fully documented with API references and a hands-on tutorial, all written using DocC for a native Xcode documentation experience. - EmployeeFormExample Application (
EmployeeFormExamplefolder):
A sample app that demonstrates how to use ImageDataPicker in a real-world scenario. This project also includes DocC-powered application documentation, making it easy to understand and extend.
Why Use ImageDataPicker?
- SwiftUI-First: Built from the ground up for SwiftUI, with modern, idiomatic APIs.
- Customizable: Easily change the shape of image previews (circle, square, rounded rectangle, etc.).
- Error Handling: Built-in support for empty and error states, with customizable placeholder images.
- Well-Documented: Comprehensive API docs and tutorials, right inside Xcode.
- Open Source: Free to use and contribute to, with a welcoming community.
Join the Community
If you find ImageDataPicker useful, star the repository, open an issue, or contribute improvements.
Get Michael Logothetis’s stories in your inbox
Join Medium for free to get updates from this writer.
We are happy to answer your questions.
Your feedback and contributions help make the framework better for everyone.
Ready to simplify image selection in your SwiftUI apps?
Check out ImageDataPicker on GitHub to get started!










