GithubHelp home page GithubHelp logo

hyperoslo / lightbox Goto Github PK

View Code? Open in Web Editor NEW
1.6K 39.0 325.0 6.03 MB

:milky_way: A convenient and easy to use image viewer for your iOS app

Home Page: https://www.hyper.no

License: Other

Ruby 1.54% Swift 98.46%
ios swift lightbox image presentation

lightbox's Introduction

Lightbox

CI Status Carthage Compatible License Platform Swift

Lightbox Icon

Lightbox is a convenient and easy to use image viewer for your iOS app, packed with all the features you expect:

  • Paginated image slideshow.
  • Video support.
  • Double-tap to zoom.
  • Image caption.
  • Dynamic background based on Hue
  • Remote image loading and caching based on Imaginary
  • Interactive transition animations.
  • Powerful configuration.
  • Live Demo

Table of Contents

Usage

Controller

To start your slideshow just instantiate LightboxController, set needed delegates and present it:

// Create an array of images.
let images = [
  LightboxImage(imageURL: URL(string: "https://cdn.arstechnica.net/2011/10/05/iphone4s_sample_apple-4e8c706-intro.jpg")!),
  LightboxImage(
    image: UIImage(named: "photo1")!,
    text: "This is an example of a remote image loaded from URL"
  ),
  LightboxImage(
    image: UIImage(named: "photo2")!,
    text: "",
    videoURL: URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
  ),
  LightboxImage(
    image: UIImage(named: "photo3")!,
    text: "This is an example of a local image."
  )
]

// Create an instance of LightboxController.
let controller = LightboxController(images: images)

// Set delegates.
controller.pageDelegate = self
controller.dismissalDelegate = self

// Use dynamic background.
controller.dynamicBackground = true

// Present your controller.
present(controller, animated: true, completion: nil)

Delegates

Use LightboxControllerPageDelegate if you want to be notified about page navigation changes.

extension ViewController: LightboxControllerPageDelegate {

  func lightboxController(_ controller: LightboxController, didMoveToPage page: Int) {
    print(page)
  }
}

Use LightboxControllerDismissalDelegate to be notified when controller is about to be dismissed. Please note that LightboxController dismisses itself if it was presented initially.

extension ViewController: LightboxControllerDismissalDelegate: class {

  func lightboxControllerWillDismiss(_ controller: LightboxController) {
    // ...
  }
}

Image loading

By default images are loaded using Imaginary for reliable loading and caching. But it's easy to change this behavior using LightboxConfig

LightboxConfig.loadImage = {
  imageView, URL, completion in
  // Custom image loading
}

Video

Lightbox can show and plays video using default AVPlayerViewController. Showning video by using videoURL:

LightboxImage(
  image: UIImage(named: "photo2")!,
  text: "",
  videoURL: NSURL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
)

Override video handling if needed:

LightboxConfig.handleVideo = { from, videoURL in
  // Custom video handling
  let videoController = AVPlayerViewController()
  videoController.player = AVPlayer(url: videoURL)

  from.present(videoController, animated: true) {
    videoController.player?.play()
  }
}

Configuration

Configure text, colors, fonts of UI elements by overriding the static variables in the Lightbox configuration struct. As an example:

LightboxConfig.CloseButton.image = UIImage(named: ImageList.Lightbox.closeButton)
LightboxConfig.CloseButton.textAttributes = TextAttributes.Lightbox.closeButton
LightboxConfig.CloseButton.text = "Finish"

LightboxConfig.DeleteButton.image = UIImage(named: ImageList.Lightbox.deleteButton)
LightboxConfig.DeleteButton.textAttributes = TextAttributes.Lightbox.deleteButton
LightboxConfig.DeleteButton.text = "Delete"

LightboxConfig.InfoLabel.ellipsisText = "Show more"

Installation

Lightbox is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Lightbox'

In order to quickly try the demo project of a Lightbox just run pod try Lightbox in your terminal.

Lightbox is also available through Carthage. To install just write into your Cartfile:

github "hyperoslo/Lightbox"

To install Lightbox manually just download and drop Sources and Images folders in your project.

Author

Hyper Interaktiv AS, [email protected]

Contributing

We would love you to contribute to Lightbox, check the CONTRIBUTING file for more info.

License

Lightbox is available under the MIT license. See the LICENSE file for more info.

lightbox's People

Contributors

3lvis avatar aashishdhawan avatar alexandrapp avatar bchrobot avatar danwilliams64 avatar davidevincenzi avatar dknchris avatar fassko avatar hyperseed avatar johnsundell avatar kitwtnb avatar mhassanpur avatar mohammadrezaansari avatar novr avatar onmyway133 avatar r-mckay avatar ramongilabert avatar richardtop avatar rinat-enikeev avatar shaneqi avatar tobisaninfo avatar tparizek avatar vadymmarkov avatar vitalii-tym avatar yspreen avatar zenangst 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  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

lightbox's Issues

Physics, or easy stuff

All right fellas, so I have a question regarding the transition.

Right now it's pretty much working, but got a question about the image, right now, the image is not .ScaleAspectFill, then, it makes sense to treat the image like Slack does, like something that has life and you can carry on playing with it.

The other option is what Twitter does, the view it's like kinda sticked to the borders, and you can dismiss it going up or down.

What to you prefer, 1, 2, or both and then we'll select one with an enum or whatever?

Swift 3 and legacy support

Hi

I am using ImagePicker in iOS that uses Lightbox.

I am getting below when opened project in xcode 8. Seems Swift 3 and 2.3 are not supported yet.

โ€œUse Legacy Swift Language Versionโ€ (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntaxโ€ฆ] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

When will this framework support Swift 3 and 2.3?

Or is there any alternative?

Cheers
Ashish

SwiftHash is missing in Carthage-Build

When i try to build the latest version with carthage i get the error:

Failed to read file or folder at /.../Carthage/Checkouts/Lightbox/Carthage/Build/iOS/SwiftHash.framework

I think it is because the dependency Imaginary uses Cache (https://github.com/hyperoslo/Cache) this is not pinned to a specific version. Since some days the Cache-project includes swiftHash in an other way since before.

I created a fork https://github.com/papierschiff/Lightbox which uses a pinned version to a forked Imaginary repo which ha a pinned Cache-dependency.

Stats: Xcode 9.1, Carthage 0.26.2, latest Lightbox build

Dynamic background issue

First of all, - Sir you have done amazing work. I love Lightbox and how it looks like.

About the issue. I like dynamic background, however I don't understand following:
please see this gif:
issue

I set startIndex like this:

let controller = LightboxController.init(images: photos, startIndex: indexPath.row)

I have also tried this( result still the same:( ):

        let controller = LightboxController.init(images: photos)
        controller.dynamicBackground = true
        controller.goTo(indexPath.row, animated: false)

As you can see, background is animating like scrolling from the image number 0 to selected image.
It would be much better(and more logical: it is the first picture user clicked), if there was no background animation on startIndex image, or at least to have such option.
I hope you understand my idea.

Add support for orientation changing

Now I've just dropped landscape mode, so it always in portrait.
@richardoti @zenangst You could try to play with it If you have some good ideas how to get it working properly in all device orientations and after zooming

Some images always fail to load (CFNetwork internal error:304)

I have no clue why this happens, but for some reason some images will never be loaded. Here is example:

  1. I load image using Lightbox:
    image_bug

  2. I load exact same image using another another lib(this is IDMPhotoBrowser):

image_succes

This happens often with random images.
In log I see following message:
CFNetwork internal error (0xc01a:/BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork_Sim/CFNetwork-808.2.16/Loading/URLConnectionLoader.cpp:304)

I have already tried adding in Info.plist file this lines:
info

Still no success. All images in collection are being downloaded via HTTPS.

Video support

Are you planning to add some Video support, so it can swipe trough videos and photos regardless the type of media?

Crash on IOS 11.1.1 (15B150)

We have got a crash on IOS 11.1.1 (15B150) iPhone SE

i have attached the logs below

Crashed: com.apple.main-thread
0  Lightbox                       0x1051ddecc _TFC8Lightbox9InfoLabelgP33_AA4B35F0720B741F0D46790C8576C04C13truncatedTextSS + 2100
1  Lightbox                       0x1051db4dc _TTSf4gs_n___TFC8Lightbox10FooterView10updateTextfSST_ + 252
2  Lightbox                       0x1051e8a3c _TTSf4d_n___TFC8Lightbox18LightboxControllerW11currentPageSi + 536
3  Lightbox                       0x1051e6c08 _TFC8Lightbox18LightboxController11viewDidLoadfT_T_ + 1704
4  Lightbox                       0x1051e6cc4 _TToFC8Lightbox18LightboxController11viewDidLoadfT_T_ + 28
5  UIKit                          0x18c584f08 -[UIViewController loadViewIfRequired] + 1040
6  UIKit                          0x18c584ae0 -[UIViewController view] + 28
7  Lightbox                       0x1051e8f50 _TTSf4d_n___TFC8Lightbox18LightboxControllerW17dynamicBackgroundSb + 80
8  Rapl                           0x104967f74 specialized QuizViewController.openImagePreview(url : String, text : String) -> () (QuizViewController.swift:388)
9  Rapl                           0x104968128 specialized QuizViewController.previewImage(choice : Choice) -> () (QuizViewController.swift)
10 Rapl                           0x1049655b0 protocol witness for ImageChoicePreviewDelegate.previewImage(choice : Choice) -> () in conformance QuizViewController (QuizViewController.swift)
11 Rapl                           0x1048de8fc ImageChoiceListView.previewImage(Any) -> () (ImageChoiceListView.swift:84)
12 Rapl                           0x1048dea2c @objc ImageChoiceListView.previewImage(Any) -> () (ImageChoiceListView.swift)
13 UIKit                          0x18c5b9614 -[UIApplication sendAction:to:from:forEvent:] + 96
14 UIKit                          0x18c5b9594 -[UIControl sendAction:to:forEvent:] + 80
15 UIKit                          0x18c5a42fc -[UIControl _sendActionsForEvents:withEvent:] + 440
16 UIKit                          0x18c5b8e88 -[UIControl touchesEnded:withEvent:] + 576
17 UIKit                          0x18cc0f084 _UIGestureEnvironmentSortAndSendDelayedTouches + 4280
18 UIKit                          0x18cc0a634 _UIGestureEnvironmentUpdate + 1224
19 UIKit                          0x18cc0a118 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 404
20 UIKit                          0x18cc09274 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 276
21 UIKit                          0x18c5b3e5c -[UIWindow sendEvent:] + 3180
22 UIKit                          0x18c585384 -[UIApplication sendEvent:] + 340
23 UIKit                          0x18ced285c __dispatchPreprocessedEventFromEventQueue + 2364
24 UIKit                          0x18ced4de8 __handleEventQueueInternal + 4760
25 UIKit                          0x18cecdd04 __handleHIDEventFetcherDrain + 152
26 CoreFoundation                 0x1830f62e8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
27 CoreFoundation                 0x1830f6268 __CFRunLoopDoSource0 + 88
28 CoreFoundation                 0x1830f5af0 __CFRunLoopDoSources0 + 204
29 CoreFoundation                 0x1830f36c8 __CFRunLoopRun + 1048
30 CoreFoundation                 0x183013fb8 CFRunLoopRunSpecific + 436
31 GraphicsServices               0x184eabf84 GSEventRunModal + 100
32 UIKit                          0x18c5e82f4 UIApplicationMain + 208
33 Rapl                           0x104896ee0 main (AppDelegate.swift:32)
34 libdyld.dylib                  0x182b3656c start + 4

The code which i am using to invoke the light box is

let images = [
    LightboxImage(imageURL: URL(string: url)!, text: text)
]

LightboxConfig.InfoLabel.ellipsisColor = UIColor.red;
LightboxConfig.PageIndicator.enabled = false;
LightboxConfig.CloseButton.enabled = false;

let controller = LightboxController(images: images)

if text == "" {
    controller.footerView.isHidden = true;
}

controller.headerView.isHidden = true;
controller.dynamicBackground = true

present(controller, animated: true, completion: nil)

Build with compile issues.

I am just update Lightbox to 2.0.0, but build with below compile error:
Cannot convert value of type '[NSAttributedStringKey : Any]' (aka 'Dictionary<NSString, Any>') to expected argument type '[String : Any]?'

Live Demo not working..

the demo page shows an error with text "Streaming for this account has been temporarily disabled"

Make config a class (or any other possibility to subclass the config)

Right now making a non-default config requires modifying a struct, which has to be done in the controller. I suggest making config to be a class, so it would be possible to keep it in one place and not overcomplicate controller class.

If config is a class, it is still possible for the library to work the same way (i.e. to be configured in the controller), but also, it is possible to subclass a default config, do some overrides and pass it with one line only:

let mySuperConfig = MySuperConfig()
let lightBox = LightboxController(imagesUI: images, config: mySuperConfig)

What do you think about this?

README outdated?

Version: 2.0.1
Swift 4

The README says that you can do custom image loading which is what I need given that my assets are private in S3 and not exposed to world via HTTP.

LightboxConfig.loadImage = {
  imageView, URL, completion in
  // Custom image loading
}

However, I am getting a compiler error saying Type 'LightboxConfig' has no member 'loadImage' and rightfully so as I am not seeing any mention of loadImage in the source code.

Is this still a supported feature or are the docs outdated?

Using UIWindow for layout size

LightboxController:261 attempts to get the size for the scroll view from UIApplication.shared.delegate?.window??.bounds.size, which assumes that you have that implemented.

Maybe something like UIApplication.shared.keyWindow could be used instead? I'm not sure if implementing UIApplicationDelegate.window is a common enough convention that this issue doesn't matter, but it's definitely something I ran into! :)

Edit:
I can open a PR that uses UIApplication.shared.keyWindow if I get the go ahead. Perhaps I can even have it use keyWindow just as a ?? fallback.

Screen is half-black after dismissal

Hi there,

I'm facing a weird issue after you do the following steps:

  1. Tap on an image while your phone is in portrait mode
  2. Turn your phone to landscape
  3. Zoom into the picture
  4. Zoom out
  5. Close the image by swiping or pressing the close button

My code looks like this:

let lightboxController = LightboxController(images: [LightboxImage(image: image)])
LightboxConfig.PageIndicator.enabled = false
LightboxConfig.hideStatusBar = true
present(lightboxController, animated: true, completion: nil)

What happens is this:

unadjustednonraw_thumb_2f6d

To resolve the issue on the iPhone, you have to close the app in the Task Manager and open the app again.

When multitasking on iPad, layout is incorrect

When using Slide Over multitasking on iPad, the frames are sized for the iPad screen size instead of the actual size of the view. This results in photos being out of bounds and paging is broken.

Playing Local Videos

Hello,
Thanks for such a library, i am using it in my apps.
In one of my apps i encountered a problem. I am getting a video from the phone's gallery, appending it on my lightbox array and trying to play it, but i am unsuccessful. If i add a remote video, it is playing the video. My own video url is something like this "assets-library://asset/asset.mov?id=C006BE3C-2327-4A91-A139-7B594A99458D&ext=mov".

thanks in advance.

Here is my code:

var controller:LightboxController! = nil
var lbImages = [LightboxImage]()

override func viewDidLoad() {
        super.viewDidLoad()
        LightboxConfig.handleVideo = { from, videoURL in
            
            // Custom video handling
            
            print("playing local :")
            print(videoURL)
            let videoController = AVPlayerViewController()
            videoController.player = AVPlayer(url: videoURL)
            
            from.present(videoController, animated: true) {
                videoController.player?.play()
            }
}

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        if let chosenImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
            picker.dismiss(animated: false, completion: { () -> Void in
                
                print("width is " + String(describing: chosenImage.size.width) + " height " +  String(describing: chosenImage.size.height))
                self.lbImages.append(LightboxImage(image: chosenImage))
                self.mediaCollectionView.reloadData()
                
            })
            
        } else if let videoURL = info["UIImagePickerControllerReferenceURL"] as? NSURL {
            picker.dismiss(animated: false, completion: { () -> Void in
                
                print(videoURL)
                self.lbImages.append(LightboxImage(
                    image: UIImage(named:"news")!,
                    text: "",
                    videoURL: videoURL as URL
                    //videoURL: NSURL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4") as URL?
                ))
                self.mediaCollectionView.reloadData()
                
            })
        
        
        } else{
            print("Something went wrong")
            self.dismiss(animated: true, completion: nil)
        }
        
        
    }

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        controller = LightboxController(images: lbImages)
        // Set delegates.
        //controller.pageDelegate = self
        //controller.dismissalDelegate = self
        
        // Use dynamic background.
        controller.dynamicBackground = true
        // Present your controller.
        
        controller.headerView.deleteButton.addTarget(self, action: #selector(self.deleteImage), for: .touchUpInside)
        
        present(controller, animated: true, completion: nil)
    }

Gallery is hard to scroll

ios simulator screen shot 16 jul 2015 22 34 49

On this screenshot I've almost scrolled out the first picture, but the second has not appeared yet.

If I try to swipe starting from blank space (inter-item-spacing) everything scrolls right (see the second screenshot).
ios simulator screen shot 16 jul 2015 22 36 24

I think, dynamics should be turned on only for vertical direction, but not for the horizontal, as this really interferes with the way you expect to interact with any image gallery.

Progress indicator appears too late for images loaded from URL if the very first image in a row was inited as UIImage

STR:

  1. Make sure there are no images cached (f.e. do Reset Content and Settings for simulator)
  2. In the demo project put photo1 at the first place, so that the array of lighboxImages will be "photo1", URL, "photo3", "photo4"
  3. Imitate a bad network quality with settings similar to DSL network for example
  4. Open the demo project, tap "Show me the lighbox" and quickly slide to the next image (which is supposed to be loaded from URL)

Result: There are no progress indication while image is being loaded. If you wait for some time, the progress indication will blink right before the image appears.

P.S. I'll try to do a PR later if I have time.

pod update

hi, plz update pod, since it's still the old one

imageView frames (and therefore activityIndicator frames) improperly placed while waiting for images to download.

First off, thanks for the nice repo guys :)

So I have uncovered an issue when viewing an imageView while waiting for an image to download.

I'm presenting the lightboxController and then immediately going to the image that the user selected from my previous UI:

lightboxVC.goTo(index, animated: false)
present(lightboxVC, animated: true)

If the index is 0 (the first image) then, the activityIndicator shows up and behaves as expected, and disappears as the downloaded image is displayed. However, if I either 1) swipe to the next photo which is still being downloaded or 2) my index (above) is greater than 0, then the activity indicator doesn't appear.

It took me a while just to figure out the problem but I think I have a clear description of it and a potential solution. In short the problem is that the frames of the imageView aren't being set properly when there's not yet an image.

All of the attached screenshots are supposed to have 9 images total and I'm focused on the 5th image in each case. I used images with numbers to help us out here...

Improperly placed imageViews (before images download):
screenshot 2017-04-25 00 44 48 Note that the imageViews skip every other slot while their images are downloading. Again, the focus is on the 5th slot (with the black background). The activityIndicators are the gray dots.

Properly placed imageViews (after images download):
screenshot 2017-04-25 00 45 17 Note that the imageViews become properly placed once there's an image.

I believe the fix is to add:
centerImageView()

to the guard-else statement (near ln 134 of PageView.swift):
guard let image = imageView.image else { return }

in:
func configureImageView()

yielding:

guard let image = imageView.image else {
	centerImageView()
	return
}

This seems to properly place the imageViews, even when they don't have images yet.

Properly placed imageViews (during image download):
screenshot 2017-04-25 01 32 24

Hope this helps to quickly test this bug and fix and then get this code pushed live!

Maybe this activityIndicator code can get some attention too??
https://github.com/hyperoslo/Lightbox/tree/fix/loading_view

Dynamic Background bug

When you have large gallery(this example is 50) and click an image, Background of first image you pick Dynamically animates to PREVIOUS(sometimes just random) image in your collection. Here is example:
incorrect background

(I click Albrecht Durer in 13, but in background we see pirate! )

I set page number with this code:

        let controller = LightboxController.init(images: photos)
        controller.dynamicBackground = true
        controller.goTo(indexPath.row, animated: true)

I've also tried animated: false and let controller = LightboxController.init(images: photos, startIndex:indexPath.row)

Value of type 'Image' has no member 'uimage'

let lightboxImages = images.flatMap { $0.uimage(ofSize: UIScreen.main.bounds.size)}.map({ LightboxImage(image: $0 )})

This line has the following error in your demo project: Value of type 'Image' has no member 'uimage'

Please post a fix/idea for fix. Thanks.

Open ImagePicker or Gallery from Lightbox example

Is there a way from Lightbox to open ImagePicker or Gallery? Examples in the other projects shows how to open Lightbox from them, but I want to do the other way around.

The users in my app should be able to add one or more images, view them and possibly add more in another session. So I wanted to use Lightbox as a image gallery to view images, and then ImagePicker or Gallery to add more images. But I want be able to add more images from Lightbox and I can't figure it out.

Allow to have smaller images centered without stretching

If I add a low resolution image into Lightbox, it stretches that images. Is it possible to have a feature that disables stretching of the images? Something like:

class PageView: UIScrollView {

  lazy var imageView: UIImageView = {
    let imageView = UIImageView()
    imageView.contentMode = LightBoxConfig.imageView.contentMode
    imageView.clipsToBounds = true
    imageView.isUserInteractionEnabled = true
    return imageView

  }()

  ...

And if this would be configurable for each page it would be even better. A change to LightboxControllerPageDelegate like this? In that way I would be able to manipulate the page.

public func lightboxController(_ controller: LightboxController, didMoveToPage page: Page, at index: Int)

Hue dependency - Xcode 9 / Swift 3

Hi,
thanks for awesome library. I have project written in Swift 3.2, deployment target iOS 9.0 and Xcode 9 and I've run into problem with Hue dependency. When I try to build project, I get error at import Hue - Module file's minimum deployment target is ios9.0 v9.0. I looked at Hue github and it is already updated to Swift 4 on master, could it be the problem?

Thanks,
Tomas

Landscape mode swipe bug

Hello,
I get a weird bug when in landscape mode and swiping up or down. The view becomes messed up and layouts are wrong.

Custom buttons at the bottom

Hey there,

Is there currently a way to add a custom button to the bottom of the photo viewer? I'd like to add a button (or any UIView) to allow the user to perform certain actions.

You can think of this similar to the native Photos.app on iOS. When you tap on a photo, you have a bottom bar where you can tap on the "share", "favourite" or "delete" buttons.

If this isn't possible right now, is this something you'd consider adding? This would mimic the behaviour of the native photo app and basically be underneath the current info label.

(Obviously the behaviour of those buttons would be defined by the developer and not by Lightbox. Lightbox would just provide a way to add buttons at the bottom, but the behaviour or what they do when tapped by the user, would be outside of the scope of this lib).

Play Video inside gallery

Thanks for your work, it's really awesome!

Autoplay video when it's shown, and do not create separate av view controller.

FooterView doesn't show up at start

Great library! This is my first time posting in GitHub.
The latest updates take care of the safe area issues for the iPhone X, but I noticed that the footer view doesn't show up when the Lightbox view appears for the first time. I used this in the viewDidAppear method to display the footer at start:

if #available(iOS 11.0, *) {
       configureLayout(view.safeAreaLayoutGuide.layoutFrame.size)
} else {
      configureLayout(view.bounds.size)
}

Right to left scrollView

I have an app that is localized to Arabic which make the layouts from the right to the left
And I have a collection view with images (from right to left) as in this image
https://i.suar.me/8qoM/m

The problem is when I view the last image (the image on the most left with index = 3) with light box
it is shown as the most right image in Lightbox scroll view

Another ex:
in collection view
3 2 1 0
in Lightbox scroll view
0 1 2 3

how can I change this behavior?

VERY BAD BUG: Crippled parent view after device rotation

This bug is even present in the online demo:

  1. Click on "Show me the lightbox"
  2. Double-Click or zoom in image
  3. Rotate Device 90 degrees (first anomaly: image is much too small now)
  4. Press close button

Now the parent view has wrong dimensions. I guess the width equals height.

Fail validate iTunes connect

Hello! Faced the problem of checking the archive when it was published in itunes. The fact is that the policy of the apple prohibits the use of built-in frameworks. I removed the hue from the framework, hooked it up as a separate framework, and the project was tested. Make changes please.

Sorry, I'm using google translate =)

Add buttons

Is there any way to add custom button? Or, for example, re-program existing "delete" button?

LightboxConfig initializer is inaccesible due to 'internal' protection level

I had this issue using the hyperoslo/imagePicker as well. However, updating to the latest release solved the issue. On the other hand, trying the same with hyperoslo/Lightbox didn't do it.

Trying to to initialize LightboxConfig:

var lightboxConfig = LightboxConfig()
โš ๏ธ Causes the following error:
LightboxConfig initializer is inaccesible due to 'internal' protection level

I need access to the LightboxConfig to change the texts for the buttons

launching on ipad landscape view default preview layer input is portrait

Hi,
I am having a minor issue on launching the camera on ipad from landscape, the default connection video orientation is always portrait. but rotating the device fixes the issue. looking through the code it looks like the preview layer for cameraView initialization didn't start with the current device orientation. Just thought I bring this up.

This library is a pleasure to use, thanks for the great work!

i fixed it by doing the following changes in cameraView.swift if you decided to use it.

func setupPreviewLayer(_ session: AVCaptureSession) {
guard previewLayer == nil else { return }

let layer = AVCaptureVideoPreviewLayer(session: session)
layer.autoreverses = true
layer.videoGravity = .resizeAspectFill

//-----adding the following code here seems to fix the issue --------------
if let connection = layer.connection,
connection.isVideoOrientationSupported {
connection.videoOrientation = Utils.videoOrientation()
}
//-----end fix--------------
self.layer.insertSublayer(layer, at: 0)
layer.frame = self.layer.bounds

previewLayer = layer

}

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.