{"id":15038227,"url":"https://github.com/lvnkmn/zoomy","last_synced_at":"2025-04-07T16:19:31.470Z","repository":{"id":35120837,"uuid":"128778383","full_name":"lvnkmn/Zoomy","owner":"lvnkmn","description":"Adds seamless scrollView and instagram like zooming to UIImageViews in any view hierarchy.","archived":false,"fork":false,"pushed_at":"2023-10-09T16:26:08.000Z","size":96721,"stargazers_count":206,"open_issues_count":6,"forks_count":25,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-04-07T16:19:18.015Z","etag":null,"topics":["bounce","bounces","cocoapods","hierarchy","image","instagram","instazoom","swift","swift4","uiimageview","uiscrollview","zoom","zooming","zoomy"],"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/lvnkmn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-09T13:42:59.000Z","updated_at":"2024-01-23T11:05:13.000Z","dependencies_parsed_at":"2024-06-19T10:10:20.510Z","dependency_job_id":null,"html_url":"https://github.com/lvnkmn/Zoomy","commit_stats":{"total_commits":246,"total_committers":9,"mean_commits":"27.333333333333332","dds":0.1422764227642277,"last_synced_commit":"f01ff8bbec4ce2fdf986f7c8d72a4043bca0f768"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvnkmn%2FZoomy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvnkmn%2FZoomy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvnkmn%2FZoomy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvnkmn%2FZoomy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvnkmn","download_url":"https://codeload.github.com/lvnkmn/Zoomy/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685634,"owners_count":20979085,"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":["bounce","bounces","cocoapods","hierarchy","image","instagram","instazoom","swift","swift4","uiimageview","uiscrollview","zoom","zooming","zoomy"],"created_at":"2024-09-24T20:37:36.674Z","updated_at":"2025-04-07T16:19:31.449Z","avatar_url":"https://github.com/lvnkmn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](Art/Banner.png)\n\nZoomy allows you to add seamless scrollView and instagram like zooming to UIImageViews in any view hierarchy.\n\n## Example\n\n![](Art/Gif/1.gif)![](Art/Gif/2.gif)![](Art/Gif/3.gif)\n\nExample project can be found in the Example folder\n\n## Setup\nJust add\n\n```swift\nimport Zoomy\n```\nto the files that of the code that needs zoombehavior.\n\n## Usage\nAll of the folowing snippets are expected to be called from within to your viewcontroller. \n\nSomewhere after `viewDidLoad` should work just fine.\n\n### Scrollable zooming\n\n```swift\naddZoombehavior(for: imageView)\n```\n\n### Insta zooming\n\n```swift\naddZoombehavior(for: imageView, settings: .instaZoomSettings)\n```\n\n### Zooming above navigationbar/tabbar\n\n```swift\nguard let parentView = parent?.view else { return }\naddZoombehavior(for: imageView, in:parentView)\n```\n\n### Zooming below UI element\n\n```swift\naddZoombehavior(for: imageView, below: dismissButton)\n```\n\n### Zooming with some custom gesture actions\n\n```swift\nlet settings = Settings.defaultSettings\n    .with(actionOnTapOverlay: Action.dismissOverlay)\n    .with(actionOnDoubleTapImageView: Action.zoomIn)\n        \naddZoombehavior(for: imageView, settings: settings)\n```\n\nThere's a lot more [triggers](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Zoomy/Classes/Structs/ImageZoomControllerSettings.swift#L44-L72) and [actions](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Zoomy/Classes/Classes/ImageZoomControllerActions.swift#L8-L26) to choose from.\n\n### Zooming a collectionviewcell\n\n```swift\npublic func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -\u003e UICollectionViewCell {\n    \n    //After your regular dequeue and configuration:\n    addZoombehavior(for: cell.imageView)\n        \n    return cell\n}\n```\n\n### Other examples\n\n* [Zooming non centered images](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Example/Zoomy/NonCenteredImagesViewController.swift)\n* [Zooming scrollable images](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Example/Zoomy/StackViewImagesViewController.swift)\n* [Zooming underneath floating action button](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Example/Zoomy/FloatingActionButtonViewController.swift)\n* [Dynamically changing gesture actions](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Example/Zoomy/ChangingActionsViewController.swift)\n\n### A note about zooming images that live inside scrollviews\n\nZooming inside any viewhierarchy will work perfectly fine using Zoomy, however sometimes you want to disable existing behaviors while zooming. A good example of this is when zooming images that are subviews of a scrollview.\n\nFor best performance just implement these Zoomy.Delegate methods:\n\n```swift\nextension YourViewController: Zoomy.Delegate {\n    \n    func didBeginPresentingOverlay(for imageView: Zoomable) {\n        scrollView.isScrollEnabled = false\n    }\n    \n    func didEndPresentingOverlay(for imageView: Zoomable) {\n        scrollView.isScrollEnabled = true\n    }\n}\n```\n\nNo need to set the viewController as a delegate to anyting. This is infered using conditional conformance. In case you're interested in seeing how this is done, see [this](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Zoomy/Classes/Extensions/UIViewController%2BCanManageZoomBehavior.swift#L3) and [this](https://github.com/lvnkmn/Zoomy/blob/3c6e6195190515522dd84d2653f61acdfaeef897/Zoomy/Classes/ExtendedProtocols/CanManageZoomBehaviors.swift#L72).\n\n## Texture\n\nAll the code examples provided above work with texture's `ImageNode` as well. All that is needed for this is adding `extension ASImageNode: Zoomable {}` anywhere in your targets sources. See the example projects for basic and more advanced usage of texture.\n\n## There's more to come\n\nSee the [roadmap](https://github.com/lvnkmn/Zoomy/labels/roadmap) for upcoming features.\n\nMissing anyting or something is not working as desired? [Create an issue](https://github.com/lvnkmn/Zoomy/issues/new) and it will likely be picked up. \n\n## Support\n\nThere may not always be time for personal support on how to implement Zoomy in different scenario's. Hopefully the code is clear enough to get done what's needed 💪. In case you've implemented a scenario thats not described in this readme or the examples, feel free to [create a pull request](https://github.com/lvnkmn/Zoomy/compare?expand=1), that would be pretty cool actually.  \n\n## Installation\n\nZoomy is available through [Swift Package Manager](https://swift.org/package-manager/). To install it, simply add it to your project using this repository's URL as explained [here](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app).\n\n## Credits \u0026 Acknowledgements\n\nCover photo by [Leonardo Yip](https://unsplash.com/@yipleonardo), all other images that have been used can be found on [Unsplash](https://unsplash.com).\n\n## License\n\nZoomy 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%2Flvnkmn%2Fzoomy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvnkmn%2Fzoomy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvnkmn%2Fzoomy/lists"}