{"id":21378455,"url":"https://github.com/shima11/interactivezoomdriver","last_synced_at":"2025-05-08T21:12:26.779Z","repository":{"id":45068819,"uuid":"129691945","full_name":"shima11/InteractiveZoomDriver","owner":"shima11","description":"Image zoomable like Instagram.","archived":false,"fork":false,"pushed_at":"2024-08-28T14:19:45.000Z","size":17856,"stargazers_count":44,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-08T21:11:50.347Z","etag":null,"topics":["carthage","cocoapods","driver","imageview","instagram","interactive","ios","swift","zoom-images","zoomable"],"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/shima11.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-16T05:56:52.000Z","updated_at":"2024-11-19T06:25:40.000Z","dependencies_parsed_at":"2024-08-28T15:46:34.025Z","dependency_job_id":"92ac4f26-9565-49bf-b2c6-d0bbb6eff3fe","html_url":"https://github.com/shima11/InteractiveZoomDriver","commit_stats":{"total_commits":53,"total_committers":4,"mean_commits":13.25,"dds":0.09433962264150941,"last_synced_commit":"eb5756026d6e9b0954b09bb76723acd19fa4cd86"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shima11%2FInteractiveZoomDriver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shima11%2FInteractiveZoomDriver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shima11%2FInteractiveZoomDriver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shima11%2FInteractiveZoomDriver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shima11","download_url":"https://codeload.github.com/shima11/InteractiveZoomDriver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149617,"owners_count":21861739,"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","cocoapods","driver","imageview","instagram","interactive","ios","swift","zoom-images","zoomable"],"created_at":"2024-11-22T09:31:47.991Z","updated_at":"2025-05-08T21:12:26.714Z","avatar_url":"https://github.com/shima11.png","language":"Swift","readme":"# InteractiveZoomDriver\nThis repo is view to zoomable by pinch gesture.\n\n## Overview\n\n![](demo.gif)\n\n## Installation\n\n### Swift Package Manager\n\nFor installing with SPM, add it to your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/shima11/InteractiveZoomDriver.git\", from: \"1.2.5\"))\n]\n```\n\n### Carthage\n\nFor installing with Carthage, add it to your `Cartfile`.\n\n```\ngithub \"shima11/InteractiveZoomDriver\"\n```\n\n### CocoaPods\n\nFor installing with CocoaPods, add it to your `Podfile`.\n\n```\npod 'InteractiveZoomDriver'\n```\n\n## Usage\n\n```\nimport InteractiveZoomDriver\n\nlet zoomView = UIImageView() // UIView or SubClass of UIView\nzoomView.isUserInteractionEnabled = true\n```\n\n### Case1: driver\nAdd zoom function to target UIView.\n\n`gestureTargetView`: added tap and pan gesture.  \n`sourceView`: source view.  \n`targetViewFactory`: Transformed View during zooming.  \n`shouldZoomTransform`: Delegate to the outside whether zooming is possible.  \n\n```\nlet driver = InteractiveZoomDriver(\n  gestureTargetView: imageView2,\n  sourceView: imageView2,\n  targetViewFactory: { (fromImageView: UIImageView) -\u003e UIView in\n    let view = UIImageView()\n    view.image = fromImageView.image\n    view.clipsToBounds = fromImageView.clipsToBounds\n    view.contentMode = fromImageView.contentMode\n    return view\n  },\n  shouldZoomTransform: {(sourceView: UIImageView) -\u003e Bool in\n    if sourceView.image == nil {\n      return false\n    }\n    return true\n  }\n)\n```\nThis is also no problem.\n`InteractiveZoomView.clone` and `InteractiveZoomView.shouldZoomTransform` is default implementation of protocol extension.\n`InteractiveZoomView` corresponds to `UIImageView` only.\nTo support other than `UIImageView`, add an implementation in extension.\n\n```\nlet driver = InteractiveZoomDriver(\n  gestureTargetView: zoomView, \n  sourceView: zoomView, \n  targetViewFactory: InteractiveZoomView.clone, \n  shouldZoomTransform: InteractiveZoomView.shouldZoomTransform\n)\n```\n\n### Case2: overlay view \n\nInteractiveZoomView is able to only UIImageView now.  \nIf you want to use custom UIView, you need to create extension of InteractiveZoomView with reference to InteractiveZoomView.\n\n```\nlet overlayZoomView = InteractiveZoomView(\n    sourceView: zoomView\n)\nview.addSubView(overlayZoomView)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshima11%2Finteractivezoomdriver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshima11%2Finteractivezoomdriver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshima11%2Finteractivezoomdriver/lists"}