Trên GitHub, hyperoslo/Gallery đã đạt 1.4k sao, nhóm Mobile, ngôn ngữ Swift. 📹 Your next favorite image and video picker
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
We all love image pickers, don't we? You may already know of ImagePicker, the all in one solution for capturing pictures and selecting images. Well, it has a sibling too, called Gallery. Based on the same engine that powers ImagePicker, Gallery has a clearer flow based on albums and focuses on the use case of selecting video. If this suits your need, give it a try 😉
Gallery has 3 tabs with easy navigation through swipe gesture
Images: select albums and images. Handle selection with hightlighted numbers so your users don't forget the order
Camera: your photographer skill goes here
Videos: display all videos and select. For now the use case is to select one video at a time
And, it has zero dependencies 😎
Usage
Presenting
GalleryController is the main entry point, just instantiate and give it the delegate
The lightbox delegate method is your chance to display selected images. If you're looking for a nice solution, here is the Lightbox that we use and love
Resolving
The delegate methods give you Image and Video, which are just wrappers around PHAsset. To get the actual asset informations, we offer many convenient methods. See example
Image
Use instance method resolve to get the actual UIImage
Use static method Image.resolve to resolve a list of images
Video
Use instance method fetchDuration, fetchPlayerItem, fetchAVAsset, fetchThumbnail to get more information about the selected video.
Permission
Gallery handles permissions for you. It checks and askes for photo and camera usage permissions at first launch. As of iOS 10, we need to explicitly declare usage descriptions in plist files
<key>NSCameraUsageDescription</key>
<string>This app requires access to camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to photo library</string>
Configuration
There are lots of customization points in Config structs. For example
Gallery cares more about video with its editing functionalities. We have VideoEditor and AdvancedVideoEditor to trim, resize, scale and define quality of the selected video
func galleryController(_ controller: GalleryController, didSelectVideo video: Video) {
controller.dismiss(animated: true, completion: nil)
let editor = VideoEditor()
editor.edit(video: video) { (editedVideo: Video?, tempPath: URL?) in
DispatchQueue.main.async {
if let tempPath = tempPath {
let controller = AVPlayerViewController()
controller.player = AVPlayer(url: tempPath)
self.present(controller, animated: true, completion: nil)
}
}
}
}
With the Video object, you can fetchPlayerItem, fetchAVAsset and fetchThumbnail as well
And, of course, you have the ability to customize it
hyperoslo/Gallery có 1.4k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/hyperoslo/Gallery. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
hyperoslo/Gallery có những chủ đề gì?
GitHub topics của hyperoslo/Gallery: "imagepicker", "ios", "swift", "video". TopGit xếp repo vào nhóm Mobile.
hyperoslo/Gallery còn đang phát triển không?
Commit gần nhất trên hyperoslo/Gallery là 5.4 năm trước (theo timestamp GitHub). Repo có 267 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
hyperoslo/Gallery là gì?
hyperoslo/Gallery (hyperoslo/Gallery) là dự án Swift trên GitHub. Theo mô tả gốc: 📹 Your next favorite image and video picker
hyperoslo/Gallery so với các dự án Mobile khác thế nào?
hyperoslo/Gallery được TopGit xếp vào nhóm Mobile, với 1.4k sao GitHub và viết bằng Swift. Xem trang chủ đề Mobile trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
hyperoslo/Gallery viết bằng ngôn ngữ gì?
hyperoslo/Gallery chủ yếu viết bằng Swift. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Vì sao hyperoslo/Gallery được xếp vào nhóm Mobile?
TopGit xếp hyperoslo/Gallery vào nhóm Mobile dựa trên GitHub topics và mô tả của repo (gắn thẻ: "imagepicker", "ios", "swift"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Gallery có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về Gallery.