Coder Social home page Coder Social logo

tungvoduc / dtphotoviewercontroller Goto Github PK

View Code? Open in Web Editor NEW
281.0 9.0 39.0 12.53 MB

A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.

License: MIT License

Ruby 1.24% Swift 98.76%
swift4 swift photoviewer cocoapod cocoapods xcode swift5 swift-package-manager

dtphotoviewercontroller's People

Contributors

sjchmiela avatar tungvoduc avatar yalishanda42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dtphotoviewercontroller's Issues

Device rotation not supported

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.

Expose current cell in a method

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!

How can i present PhotoLibrary without referenceView

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)

Show RemotePhoto

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

How to get the current image?

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.

Load image from link

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

Delegate and datasource use in UIViewController Class

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.

screen shot 2017-08-04 at 4 18 49 pm

i tried to use like this but here is some error. See screenshot
screen shot 2017-08-04 at 4 50 31 pm

Please help me. Thanks

Image Rotate/Flip Automatically

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

Unable to build with SPM

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.

Status bar not hidden

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

registerNibForPhotoViewer

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!
}

Rotation

Hi,
Is it possible to rotate only the photo view page?

thank you

One cell. CGSize(width: view.frame.width, height: 300)

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

DTPhotoViewerController crashes the application

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.

There is an issue here.

  1. In landscape view on iPhone x, the image is pushed a few pixels to the right.
  2. If you rotate the screen after zooming in, the position will not come out properly.

Problem wit UIStackView

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.