tungvoduc / dtphotoviewercontroller Goto Github PK
View Code? Open in Web Editor NEWA fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.
License: MIT License
A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.
License: MIT License
Don't get me wrong! The lib is AWESOME! but ... the main issue i've found is when you are looking at the image with the controller and rotate your device. This action seems that is not yet supported and is a real cool improvement.
I'm subclassing DTPhotoViewController to add support for video, and I noticed that there's no method that exposes the currently visible collection view cell.
This is problematic for me because I need to access the cell in order to configure the AVPlayer instance I added to it. I can't do it in configureCell
method because it's possible for a user to scroll a bit and then give up (thus returning to the previous cell), but other methods don't pass in the cell instance.
I suppose I can cast scrollView
to UICollectionView and use that, but that's not future-proof. Can we have a way to access the current cell?
Thank you!
I am trying to download from url's some photos and it seems that the referenceView is required.
Is there a way to have optional the referencedView? because sometimes referenceView is not always available
(action from text to open a remote image for example)
(i have subclassed DTPhotoViewerController and added activityIndicator to hide when download completes)
It would be nice to show the FullScreen View with a loader and download the remote photo.
What do you think?
great library by the way
I wanted to update a label that I placed inside a custom DTPhotoViewerController everytime user swipes to reveal new photo. I stored the data to the image's identifier. How can I access the current presented image?
I tried self.imageView.image but it returns only the first image every time.
Edit:
Yes I did try to follow the example but I wanted to hide/unhide this label (just like the close and save button from the example) along with other elements that I've placed.
Is there a chance to get a caption and a share button to each image?
func photoViewerController(_ photoViewerController: DTPhotoViewerController, configurePhotoAt index: Int, withImageView imageView: UIImageView) {
imageView.pin_setImage(from: images[index].link?.toURL, [placeholderImage:](url) cell.imageView.image)
}
}
when loading image i zoom imageView and when loaded image this is change zoomscale
Hello,
I got a UI problem, how can I fix that?
https://www.youtube.com/watch?v=tibflqQ6trQ
Thank you :)
Satoshi Tam
How can i get the delegate response in UiViewController class?
See my code here, I want to add cancel button on the top of the left corner. I am using BDFPostPhotoViewerController.swift
file.
Here is my Image Tapped Function where i initialise the class, i want to show/hide cross button on corner when image zoom or zoom out.
i tried to use like this but here is some error. See screenshot
Please help me. Thanks
I have copied your classes into my project. Some images are rotating/flipping automatically when I open them in DTPhotoViewer. Can you please help me to fix this issue?
@tungvoduc
@tungvoduc it's me again with the RTL :)
Could you please have a look on referencedViewForPhotoAt method with the RTL layout.
It returns invalid index,
Thanks again!
It looks like the framework comes with SPM support (great!), but when I try to build there are numerous errors. I have several other libraries managed by SPM and they work without an issue...
I'm importing the library via Xcode 11's UI. Also fwiw I can build it just fine with Carthage.
Hi,
i've added this line:
override var prefersStatusBarHidden: Bool { return true }
in debug mode the setter is called, but the status isn't hidden.
Is there another way to hide the status bar when the photo viewer is displayed?
Thank you
How to to image work with the url from server
Hi Again Tung!
I see that we can register a nib for the cell. But is it customisable? I mean the imageView will be added on the custom cell with Nib.
import UIKit
import DTPhotoViewerController
class TestPhotoCell: DTPhotoCollectionViewCell {
@IBOutlet var lblTest: UILabel!
@IBOutlet var imageView: UIImageView!
override func layoutSubviews() {
super.layoutSubviews()
//should layout those label and imageView!
}
Hi,
Is it possible to rotate only the photo view page?
thank you
"In case you want to add more UI elements to each photo, the best way is to create a subclass of DTPhotoCollectionViewCell and then call either one of these methods registerClassPhotoViewer: or registerNibForPhotoViewer:"
Im using cocoapods, hence I cannot subclassed the DTPhotoCollectionViewCell, error above
How to apply your method if a collection with one visible image is installed on the screen. For example, when you increase the isolation and after you wind up the collection and stop at the 3 index, after you close the picture and on this day the collection would wind up to the desired index
images from icloud not supported.
Please add a description of your project
Please fix this issue before we can approve your PR on AwesomeiOS
other methods in datasource called except "referencedViewForPhotoAt". I don't know why.
My application crashes if I use the full size image in the following delegate:
func photoViewerController(_ photoViewerController: DTPhotoViewerController, configurePhotoAt
index: Int, withImageView imageView: UIImageView) {
imageView.image = images[index].image
}
But if I reduce the size of image, the problem is not there. It crashes after I scroll about 50 images. The console says that out of memory. So I think the application is out of memory when I am using heavy images.
There is an issue here.
I build a nice gallery UITableViewCell displaying a vary of Images using UIStackViews.
This works fine and looks good...
But when I now want to show you PhotoViewerController I get some problems :(
That why you simple hide the referenceView.
And when you do this, the UIStackView removes it and updates the constraints.
Any changes to change this to not hide the referenceView?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.