{"id":13686043,"url":"https://github.com/nakajijapan/PhotoSlider","last_synced_at":"2025-05-01T05:31:33.823Z","repository":{"id":30263165,"uuid":"33814571","full_name":"nakajijapan/PhotoSlider","owner":"nakajijapan","description":"PhotoSlider is a simple photo slider and can delete slider with swiping.","archived":false,"fork":false,"pushed_at":"2022-01-12T08:38:27.000Z","size":47076,"stargazers_count":249,"open_issues_count":5,"forks_count":59,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-17T09:39:32.980Z","etag":null,"topics":["carthage","kingfisher","photo-slider","sdwebimage","swift","viewcontroller","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nakajijapan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-12T11:40:43.000Z","updated_at":"2024-12-04T00:14:11.000Z","dependencies_parsed_at":"2022-09-03T18:51:49.528Z","dependency_job_id":null,"html_url":"https://github.com/nakajijapan/PhotoSlider","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakajijapan%2FPhotoSlider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakajijapan%2FPhotoSlider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakajijapan%2FPhotoSlider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakajijapan%2FPhotoSlider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nakajijapan","download_url":"https://codeload.github.com/nakajijapan/PhotoSlider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250368437,"owners_count":21419079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","kingfisher","photo-slider","sdwebimage","swift","viewcontroller","xcode"],"created_at":"2024-08-02T14:01:02.443Z","updated_at":"2025-05-01T05:31:28.795Z","avatar_url":"https://github.com/nakajijapan.png","language":"Swift","funding_links":["https://opencollective.com/PhotoSlider"],"categories":["Swift"],"sub_categories":[],"readme":"# PhotoSlider for Swift\n\n[![Carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Version](https://img.shields.io/cocoapods/v/PhotoSlider.svg?style=flat)](http://cocoapods.org/pods/PhotoSlider)\n[![License](https://img.shields.io/cocoapods/l/PhotoSlider.svg?style=flat)](http://cocoapods.org/pods/PhotoSlider)\n[![Platform](https://img.shields.io/cocoapods/p/PhotoSlider.svg?style=flat)](http://cocoapods.org/pods/PhotoSlider)\n[![Language](https://img.shields.io/badge/language-Swift%204-orange.svg)](https://swift.org)\n[![Backers on Open Collective](https://opencollective.com/PhotoSlider/backers/badge.svg)](#backers) \n[![Sponsors on Open Collective](https://opencollective.com/PhotoSlider/sponsors/badge.svg)](#sponsors) \n\nPhotoSlider is a simple photo slider and can delete slider with swiping.\n\n\u003cimg src=\"https://raw.githubusercontent.com/nakajijapan/PhotoSlider/master/demo.gif\" width=\"300\" /\u003e\n\n## Requirements\n\n- Xcode 9+\n- Swift 4.0+\n- iOS 10+\n\n## Installation\n\n### CocoaPods\n\nPhotoSlider is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"PhotoSlider\"\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager for Cocoa application.\n\n``` bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate PhotoSlider into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n``` ogdl\ngithub \"nakajijapan/PhotoSlider\"\n```\n\nThen, run the following command to build the PhotoSlider framework:\n\n``` bash\n$ carthage update\n```\n\n## Usage\n\n### Using ZoomingAnimationControllerTransitioning\n\n```swift\n\nfunc collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {\n\n    var slider = PhotoSlider.ViewController(imageURLs: self.images)\n    slider.currentPage = indexPath.row\n    photoSlider.transitioningDelegate = self\n    present(photoSlider, animated: true, completion: nil)\n\n}\n\n```\n\n#### ZoomingAnimationControllerTransitioning\n\nreturn imageView for starting position\n\n```swift\n// MARK: ZoomingAnimationControllerTransitioning\n\nfunc transitionSourceImageView() -\u003e UIImageView {\n\n    let indexPath = collectionView.indexPathsForSelectedItems?.first\n    let cell = collectionView.cellForItem(at: indexPath!) as! ImageCollectionViewCell\n    let imageView = UIImageView(image: cell.imageView.image)\n\n    var frame = cell.imageView.frame\n    frame.origin.y += UIApplication.shared.statusBarFrame.height\n\n    imageView.frame = frame\n    imageView.clipsToBounds = true\n    imageView.contentMode = .scaleAspectFill\n\n    return imageView\n\n}\n```\n\n\nreturn sourceImageView for finished position\n\n```swift\nfunc transitionDestinationImageView(sourceImageView: UIImageView) {\n\n    guard let image = sourceImageView.image else {\n        return\n    }\n\n    let indexPath = collectionView.indexPathsForSelectedItems?.first\n    let cell = collectionView.cellForItem(at: indexPath!) as! ImageCollectionViewCell\n    let statusBarHeight = UIApplication.shared.statusBarFrame.height\n\n    // snip..\n\n    sourceImageView.frame = frame\n\n}\n```\n\n\n#### UIViewControllerTransitioningDelegate\n\n```swift\n// MARK: UIViewControllerTransitioningDelegate\n\nfunc animationController(forDismissed dismissed: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n    let animationController = PhotoSlider.ZoomingAnimationController(present: false)\n    animationController.sourceTransition = dismissed as? ZoomingAnimationControllerTransitioning\n    animationController.destinationTransition = self\n    return animationController\n}\n\nfunc animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n    let animationController = PhotoSlider.ZoomingAnimationController(present: true)\n    animationController.sourceTransition = source as? ZoomingAnimationControllerTransitioning\n    animationController.destinationTransition = presented as? ZoomingAnimationControllerTransitioning\n    return animationController\n}\n\n```\n\n\n### Using UIModalTransitionStyle\n\nselect ZoomingAnimationController\n\n```swift\n\nfunc collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {\n\n    var slider = PhotoSlider.ViewController(imageURLs: self.images)\n    slider.modalPresentationStyle = .OverCurrentContext\n    slider.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve\n    slider.index = indexPath.row\n    self.presentViewController(slider, animated: true, completion: nil)\n\n}\n\n```\n\n## Delegation\n\nYou can handle the following event:\n\n- optional func photoSliderControllerWillDismiss(viewController: PhotoSlider.ViewController)\n- optional func photoSliderControllerDidDismiss(viewController: PhotoSlider.ViewController)\n\n## Multiple Image Loader\n\nPhotoSlider use Kingfisher for remote image.\nIf use SDWebImage in your project, image cache is not shared between Kingfisher and SDWebImage.\nIn this case you can make custom ImageLoader. default ImageLoader is Kingfisher.\n\nHere is how to change SDWebImage.\n\nFirst, create custom ImageLoader.\n\n```swift\nimport PhotoSlider\n\nclass PhotoSliderSDImageLoader: PhotoSlider.ImageLoader {\n    public func load(\n        imageView: UIImageView?,\n        fromURL url: URL?,\n        progress: @escaping PhotoSlider.ImageLoader.ProgressBlock,\n        completion: @escaping PhotoSlider.ImageLoader.CompletionBlock)\n    {\n        // Webp compatibility (optional)\n        let WebPCoder = SDImageWebPCoder.shared\n        SDImageCodersManager.shared.addCoder(WebPCoder)\n        \n        imageView?.sd_setImage(\n            withURL: url,\n            placeholderImage: nil,\n            options: SDWebImageOptions.retryFailed,\n            progress: { (receivedSize, totalSize) in\n                progress(receivedSize, totalSize)\n            },\n            completed: { (image, _, _, _) in\n                completion(image)\n            }\n        )\n    }\n}\n```\n\nand set ImageLoader.\n\n```swift\nlet slider = PhotoSlider.ViewController(imageURLs: images)\nslider.modalPresentationStyle = .OverCurrentContext\nslider.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve\nslider.index = indexPath.row\nslider.imageLoader = PhotoSliderSDImageLoader()\npresent(slider, animated: true, completion: nil)\n```\n\n## Author\n\nnakajijapan\n\n### Special Thanks\n\n- hikarock\n- yhkaplan\n- seapy\n- antrix1989\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. \n\u003ca href=\"https://github.com/nakajijapan/PhotoSlider/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n\n## Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/PhotoSlider#backer)]\n\n\u003ca href=\"https://opencollective.com/PhotoSlider#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n\n## Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/PhotoSlider#sponsor)]\n\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/0/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/1/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/2/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/3/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/4/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/5/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/6/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/7/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/8/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/PhotoSlider/sponsor/9/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/PhotoSlider/sponsor/9/avatar.svg\"\u003e\u003c/a\u003e\n\n\n\n## License\n\nPhotoSlider is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakajijapan%2FPhotoSlider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnakajijapan%2FPhotoSlider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakajijapan%2FPhotoSlider/lists"}