{"id":21548103,"url":"https://github.com/schlaubischlump/scrollbardemo","last_synced_at":"2026-05-18T01:37:57.337Z","repository":{"id":116295473,"uuid":"564018296","full_name":"Schlaubischlump/ScrollBarDemo","owner":"Schlaubischlump","description":"A Mac Appstore like image or text scroller.","archived":false,"fork":false,"pushed_at":"2022-11-09T20:33:48.000Z","size":341,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T01:47:42.717Z","etag":null,"topics":["appstore","image-scroller","imagescrollview","ios","mac","macappstore","scroll","scrollbar","scroller","scrollview","swift","text-scroller","textscrollview","uikit"],"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/Schlaubischlump.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":"2022-11-09T20:22:37.000Z","updated_at":"2024-06-23T16:18:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c1b28e4-79a3-4eb8-9bb2-33ffee83eb26","html_url":"https://github.com/Schlaubischlump/ScrollBarDemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Schlaubischlump/ScrollBarDemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schlaubischlump%2FScrollBarDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schlaubischlump%2FScrollBarDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schlaubischlump%2FScrollBarDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schlaubischlump%2FScrollBarDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Schlaubischlump","download_url":"https://codeload.github.com/Schlaubischlump/ScrollBarDemo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schlaubischlump%2FScrollBarDemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33161965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["appstore","image-scroller","imagescrollview","ios","mac","macappstore","scroll","scrollbar","scroller","scrollview","swift","text-scroller","textscrollview","uikit"],"created_at":"2024-11-24T06:17:30.331Z","updated_at":"2026-05-18T01:37:57.317Z","avatar_url":"https://github.com/Schlaubischlump.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScrollBar\n\nA Mac Appstore like scroller component written with UIKit. Feel free to fork the project and adapt it to your needs. There are still a couple of rough edges in the project. All relevant source files can be found in the `ScrollbarView` subfolder. A simple example can be found in the `ViewController.swift` file.\n\nPull requests are always welcome ! \n\n### Screenshots\n\n##### Mac\n![](screenshots/mac.png)\n\n##### iOS\n![](screenshots/ios.png)\n\n\n### Example\n\n##### Textscroller\nHorizontal aligned text components, separated with a thin line, with a fixed width of 150 for each component. The left and right arrows are always displayed. The snapping size is set to zero, which means the scrollview scrolls continuously. \n\n```Swift\nlet textScroller = ScrollbarView(frame: CGRect(x: 0, y: 100, width: 0, height: 100))\ntextScroller.register(itemClass: ScrollbarViewTextItem.self, forItemWithReuseIdentifier: \"Cell\")\ntextScroller.dataSource = self\ntextScroller.delegate = self\ntextScroller.showsArrows = true\ntextScroller.showsSeparators = true\ntextScroller.autohideArrows = false\ntextScroller.itemSizingBehaviour = .fixed(150)\ntextScroller.snappingStepSize = 0\n```\n\n##### Image Scroller\n\nHorizontal aligned images. Each item occupies enough space to fit two images inside the scrollview frame. The arrows are only shown on mouse hover. The snapping size is set to two, which means paging with two items per page is enabled.\n\n```Swift\nlet imageScroller = ScrollbarView(frame: .zero)\nimageScroller.register(itemClass: ScrollbarViewImageItem.self, forItemWithReuseIdentifier: \"ImageCell\")\nimageScroller.dataSource = self\nimageScroller.delegate = self\nimageScroller.showsArrows = true\nimageScroller.showsSeparators = false\nimageScroller.autohideArrows = true\nimageScroller.itemSizingBehaviour = .dynamic(2)\nimageScroller.snappingStepSize = 2\nimageScroller.isScrollEnabled = true\n```\n\n##### Custom \n\nYou can create your own content by creating a subclass of `ScrollbarViewItem`. Take a look at `ScrollbarViewImageItem` and `ScrollbarViewTextItem` for an example of how the subclass should look like. \n\n##### ScrollbarViewDataSource\n\nYou should implement these methods to define the items that should be displayed.\n\n```Swift\nfunc numberOfItems(in scrollbarView: ScrollbarView) -\u003e Int {\n    return 7\n}\n\nfunc scrollbarView(_ scrollbarView: ScrollbarView, itemAtIndex index: Int) -\u003e ScrollbarViewItem {\n\t// imageScroller\n    if scrollbarView == imageScroller {\n        let item = scrollbarView.dequeueReusableItem(withReuseIdentifier: \"ImageCell\", for: index) as? ScrollbarViewImageItem\n        let itemSize = scrollbarView.calculateItemSize(inFrame: self.view.bounds)\n        item?.image = UIImage(text: \"\\(index + 1)\", color: .random(), size: itemSize)\n        return item!\n    }\n\n\t// textScrolller\n    let item = scrollbarView.dequeueReusableItem(withReuseIdentifier: \"Cell\", for: index) as? ScrollbarViewTextItem\n    item?.backgroundColor = .clear\n    item?.titleLabel.text = \"\\(index + 1) and some more text and more and more and even more and even even more !!!\"\n\n    return item!\n}\n```\n\n\n##### ScrollbarViewDelegate\n\nYou can use the delegate to responds to click events.\n\n```Swift\nfunc scrollbarView(_ scrollbarView: ScrollbarView, didSelectItemAtIndex index: Int) {\n    print(\"Did select item: \\(index)\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschlaubischlump%2Fscrollbardemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschlaubischlump%2Fscrollbardemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschlaubischlump%2Fscrollbardemo/lists"}