{"id":18270152,"url":"https://github.com/ltebean/LTInfiniteScrollView-Swift","last_synced_at":"2025-04-04T23:31:45.667Z","repository":{"id":56919192,"uuid":"50094398","full_name":"ltebean/LTInfiniteScrollView-Swift","owner":"ltebean","description":"Paged scrollview allowing easily applying animation(Swift 3)","archived":false,"fork":false,"pushed_at":"2017-07-25T03:44:51.000Z","size":23,"stargazers_count":202,"open_issues_count":1,"forks_count":32,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-21T13:46:35.124Z","etag":null,"topics":[],"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/ltebean.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":"2016-01-21T08:48:50.000Z","updated_at":"2025-03-19T03:28:58.000Z","dependencies_parsed_at":"2022-08-21T04:50:27.988Z","dependency_job_id":null,"html_url":"https://github.com/ltebean/LTInfiniteScrollView-Swift","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltebean%2FLTInfiniteScrollView-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltebean%2FLTInfiniteScrollView-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltebean%2FLTInfiniteScrollView-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltebean%2FLTInfiniteScrollView-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ltebean","download_url":"https://codeload.github.com/ltebean/LTInfiniteScrollView-Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266476,"owners_count":20910831,"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":[],"created_at":"2024-11-05T11:38:20.758Z","updated_at":"2025-04-04T23:31:45.035Z","avatar_url":"https://github.com/ltebean.png","language":"Swift","readme":"![LTInfiniteScrollViewSwift](https://cocoapod-badges.herokuapp.com/v/LTInfiniteScrollViewSwift/badge.png)\n\n## Demo\n##### 1. You can apply animation to each view during the scroll:\n![LTInfiniteScrollView](https://raw.githubusercontent.com/ltebean/LTInfiniteScrollView/master/demo/demo.gif)\n\n##### 2. The iOS 9 task switcher animation can be implemented in ten minutes with the support of this lib:\n![LTInfiniteScrollView](https://raw.githubusercontent.com/ltebean/LTInfiniteScrollView/master/demo/task-switcher-demo.gif)\n\n\n##### 3. The fancy menu can also be implemented easily:\n![LTInfiniteScrollView](https://raw.githubusercontent.com/ltebean/LTInfiniteScrollView/master/demo/menu-demo.gif)\n\nYou can find the full demo in the Objective-C version: https://github.com/ltebean/LTInfiniteScrollView.\n\n## Installation\n```\npod 'LTInfiniteScrollViewSwift'\n```\n\nOr just copy `LTInfiniteScrollView.swift` into your project.\n\n\n## Usage\n\nYou can create the scroll view by:\n```swift\nscrollView = LTInfiniteScrollView(frame: CGRect(x: 0, y: 200, width: screenWidth, height: 300))\nscrollView.dataSource = self\nscrollView.delegate = self\nscrollView.maxScrollDistance = 5\nscrollView.reloadData(initialIndex: 0)\n```\n\nThen implement `LTInfiniteScrollViewDataSource` protocol:\n```swift\npublic protocol LTInfiniteScrollViewDataSource: class {\n    func viewAtIndex(index: Int, reusingView view: UIView?) -\u003e UIView\n    func numberOfViews() -\u003e Int\n    func numberOfVisibleViews() -\u003e Int\n}\n```\n\nSample code:\n```swift\nfunc numberOfViews() -\u003e Int {\n    return 100\n}\n    \nfunc numberOfVisibleViews() -\u003e Int {\n    return 5\n}\n\nfunc viewAtIndex(index: Int, reusingView view: UIView?) -\u003e UIView {\n    if let label = view as? UILabel {\n        label.text = \"\\(index)\"\n        return label\n    }\n    else {\n        let size = screenWidth / CGFloat(numberOfVisibleViews())\n        let label = UILabel(frame: CGRect(x: 0, y: 0, width: size, height: size))\n        label.textAlignment = .Center\n        label.backgroundColor = UIColor.darkGrayColor()\n        label.textColor = UIColor.whiteColor()\n        label.layer.cornerRadius = size / 2\n        label.layer.masksToBounds = true\n        label.text = \"\\(index)\"\n        return label\n    }\n}\n```\n\n\nIf you want to apply any animation during scrolling, implement `LTInfiniteScrollViewDelegate` protocol: \n```swift\npublic protocol LTInfiniteScrollViewDelegate: class {\n    func updateView(view: UIView, withProgress progress: CGFloat, scrollDirection direction: ScrollDirection)\n}\n\n```\nThe value of progress dependends on the position of that view, if there are 5 visible views, the value will be ranged from -2 to 2:\n```\n|                  |\n|-2  -1   0   1   2|\n|                  |\n```\n\nYou can clone the project and investigate the example for details. \n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltebean%2FLTInfiniteScrollView-Swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fltebean%2FLTInfiniteScrollView-Swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltebean%2FLTInfiniteScrollView-Swift/lists"}