{"id":22370348,"url":"https://github.com/dreaminginbinary/dibpagerdots","last_synced_at":"2025-03-26T16:41:24.061Z","repository":{"id":56907471,"uuid":"48557273","full_name":"DreamingInBinary/DIBPagerDots","owner":"DreamingInBinary","description":"A fun, little animated way to show paging in UIScrollviews.","archived":false,"fork":false,"pushed_at":"2016-02-11T18:20:06.000Z","size":363,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T21:09:23.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/DreamingInBinary.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-12-24T21:30:52.000Z","updated_at":"2021-03-28T07:16:34.000Z","dependencies_parsed_at":"2022-08-21T03:20:54.163Z","dependency_job_id":null,"html_url":"https://github.com/DreamingInBinary/DIBPagerDots","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DreamingInBinary%2FDIBPagerDots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DreamingInBinary%2FDIBPagerDots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DreamingInBinary%2FDIBPagerDots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DreamingInBinary%2FDIBPagerDots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DreamingInBinary","download_url":"https://codeload.github.com/DreamingInBinary/DIBPagerDots/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245696901,"owners_count":20657799,"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-12-04T19:44:56.648Z","updated_at":"2025-03-26T16:41:24.041Z","avatar_url":"https://github.com/DreamingInBinary.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DIBPagerDots\nAdd animated pagination easily to any `UIScrollView`.\n\n![Demo](/demo.gif?raw=true \"Demo\")\n\nNo auto layout or frame manipulation required.\n\n####Installation\n\n**Cocoapods**:\n\n    pod 'DIBPagerDots'\n    \n**Old Way:**\n\nDrag one source file into your project:\n- DIBPagination.h and .m\n\n####Using It\n\n**1:** Import `DIBPagination.h`:\n\n    #import 'DIBPagination.h'\n    \n**2:** Add a property for a pager instance:\n\n    @property(strong, nonatomic) DIBPagination *pager;\n    \n**3:** Initialize it whenever you'd like. Call `animateIn` to show it:\n\n    //First, add the pager\n    self.pager = [[DIBPagination alloc] initWithFrame:self.view.bounds parentView:self.view paginationMax:8 andColors:@[[UIColor blueColor], [UIColor purpleColor]]];\n    \n    //Animate in - i.e. when you display the scrollview and it's content has been set\n    [self.pager animateIn];\n    \n    //When you are done\n    [self.pager animateOut];\n    \n    //You can also dynamically remove indices\n    [self.pager removeIndexAndResize:1];\n\n**4:** On your `UIScrollView`, you'll need to change a few properties like so:\n\n    scrollView.delegate = self;\n    scrollView.pagingEnabled = YES;\n    scrollView.showsHorizontalScrollIndicator = NO; //Optional, looks better without it\n\n**5:** Lastly, add this code to your implementation of `scrollViewDidEndDecelerating:`\n\n    - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView\n    {\n       static NSInteger previousPage = 0;\n       CGFloat pageWidth = scrollView.frame.size.width;\n       float fractionalPage = scrollView.contentOffset.x / pageWidth;\n       NSInteger page = lround(fractionalPage);\n       if (previousPage != page) {\n          [self.pager setPageIndexToIndex:page];\n          previousPage = page;\n       }\n    }\n    \n####A Bit More\nThis is part of some old code I am open sourcing for fun since the projects they are used in are about to be deleted or \nentirely refactored. This particular code was some of the first iOS code I ever wrote several years ago. That said,\nit's very scattered and not very structured, so feel free to hack away at it as you see fit.\n\nThis was originially built for my first iOS app, [Spend Stack](https://itunes.apple.com/us/app/spend-stack/id825371644?mt=8), which reached #18 in paid apps under Finance when it released.\n\n###Can I tweet at you?\nPlease do, [@jordanmorgan10](https://twitter.com/jordanmorgan10). As the mantra goes - pull requests welcome (it needs a lot of love).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreaminginbinary%2Fdibpagerdots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreaminginbinary%2Fdibpagerdots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreaminginbinary%2Fdibpagerdots/lists"}