{"id":18010418,"url":"https://github.com/stefanceriu/scpageviewcontroller","last_synced_at":"2025-04-06T04:11:19.930Z","repository":{"id":14187609,"uuid":"16894011","full_name":"stefanceriu/SCPageViewController","owner":"stefanceriu","description":"Just like UIPageViewController but better.. :)","archived":false,"fork":false,"pushed_at":"2021-02-19T15:33:51.000Z","size":355,"stargazers_count":352,"open_issues_count":3,"forks_count":70,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-30T03:05:19.224Z","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/stefanceriu.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":"2014-02-16T20:56:05.000Z","updated_at":"2024-10-12T12:17:45.000Z","dependencies_parsed_at":"2022-09-23T20:41:09.102Z","dependency_job_id":null,"html_url":"https://github.com/stefanceriu/SCPageViewController","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanceriu%2FSCPageViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanceriu%2FSCPageViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanceriu%2FSCPageViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanceriu%2FSCPageViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanceriu","download_url":"https://codeload.github.com/stefanceriu/SCPageViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430870,"owners_count":20937874,"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-10-30T02:14:09.143Z","updated_at":"2025-04-06T04:11:19.834Z","avatar_url":"https://github.com/stefanceriu.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SCPageViewController\n\n\nSCPageViewController is a container view controller similar to UIPageViewController but which provides more control, is much more customizable and, arguably, has a better overall design. \nIt supports the following features:\n\n- Customizable transitions and animations (through layouters and custom easing functions)\n- Incremental updates with user defined animations\n- Bouncing and realistic physics\n- Correct appearance calls, even while interactions are in progres\n- Custom layouts and animated layout changes\n- Vertical and horizontal layouts\n- Pagination\n- Content insets\n- Completion blocks\n- Customizable interaction area and number of touches required\n\nand more..\n\n#### Screenshots\n\n![](https://drive.google.com/u/0/uc?id=1rzHLmAsoqfq_lY3gKoJfela769WmyGIk\u0026export=download)\n\n## Implementation details\n\nSCPageViewController is build on top of an UIScrollView subclass ([SCScrollView](https://github.com/stefanceriu/SCScrollView)) which provides it with correct physics, callbacks for building the pagination, navigational constraints and custom transitions. It also can work with user defined interaction areas and minimum/maximum number of touches. It's worth noting that SCScrollView also powers [SCStackViewController](https://github.com/stefanceriu/SCStackViewController)\n\nSCPageViewController relies on page layouters to know where to place each of the controllers at every point. Page layouters are built on top of a simple protocol with methods for providing the final and intermediate view controller frames, and custom animations for page insertions, deletions, moves and reloads. The demo project contains 4 examples: plain with inter-item spacings, parallax, sliding and cards.\n\n## Usage\n\n- Create a new instance and set its data source and delegate\n\n```objc\n    self.pageViewController = [[SCPageViewController alloc] init];\n    [self.pageViewController setDataSource:self];\n    [self.pageViewController setDelegate:self];\n```\n\n- SCPageViewController relies on layouters that define how pages are layed out. You can use one of the included ones or create a custom class that implements the SCPageLayouterProtocol.\n\n```objc\n    [self.pageViewController setLayouter:[[SCPageLayouter alloc] init] animated:NO completion:nil];\n```\n\n- Implement the SCPageViewControllerDataSource to define the total number of pages, the view controllers to be used for each of them and which one show be displayed first.\n\n```objc\n- (NSUInteger)numberOfPagesInPageViewController:(SCPageViewController *)pageViewController;\n\n- (UIViewController *)pageViewController:(SCPageViewController *)pageViewController viewControllerForPageAtIndex:(NSUInteger)pageIndex;\n\n- (NSUInteger)initialPageInPageViewController:(SCPageViewController *)pageViewController;\n```\n\n- Optionally, modify the following properties to your liking\n\n```objc\n    // Enable/disable pagination\n    [self.pageViewController setPagingEnabled:NO];\n    \n    // Ignore navigation contraints (bounce between pages)\n    [self.pageViewController setContinuousNavigationEnabled:YES];\n\n    // Have the page view controller come to a rest slower\n    [self.pageViewController.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];\n\n    // Disable bouncing\n    [self.pageViewController.scrollView setBounces:NO];\n\n    // Customize how many number of touches are required to interact with the pages\n    [self.pageViewController.scrollView.panGestureRecognizer setMinimumNumberOfTouches:2];\n    [self.pageViewController.scrollView setMaximumNumberOfTouches:1];\n    \n    // Allow interaction only in the specified area\n    //SCScrollViewTouchApprovalArea *touchApprovalArea = [[SCScrollViewTouchApprovalArea alloc] init];\n    //[touchApprovalArea setPath:[UIBezierPath bezierPathWithRect:someFrame]];\n    //[self.pageViewController.scrollView addTouchApprovalArea:touchApprovalArea];\n    \n    //Use different easing functions for animations and navigation\n    [self.pageViewController setEasingFunction:[SCEasingFunction easingFunctionWithType:SCEasingFunctionTypeLinear]];\n    \n    // Change the default animation durations\n    [self.pageViewController setAnimationDuration:1.0f];\n```\n\n#####Incremental updates\nSCPageViewController also supports incremental updates and all the animations are customizable through the layouter.\n\n```objc\n\t[self.pageViewController insertPagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated completion:^(void)completion];\n\n\t[self.pageViewController deletePagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated completion:^(void)completion]\n\n\t[self.pageViewController reloadPagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated completion:^(void)completion]\n\n\t[self.pageViewController movePageAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex animated:(BOOL)animated completion:^(void)completion]\n```\n\n#####Easing functions\n\nSCPageViewController can work with custom easing functions defined through the SCEasingFunctionProtocol. It comes bundled with 31 different ones (thanks to AHEasing) and new ones can be created with ease.\n\n* Ease In Out Back\n![Plain+BackEaseInOut](https://drive.google.com/u/0/uc?id=1DgqHRNjY0GjVViupQlLAPieuOc_EG4Zv\u0026export=download)\n\n* Ease Out Bounce\n![Plain+BounceEaseOut](https://drive.google.com/u/0/uc?id=1djURb38aDzH0xgs-BrP-FnPW7a5I5UMa\u0026export=download)\n    \n* Ease Out Elastic\n![Plain+ElasticEaseOut](https://drive.google.com/u/0/uc?id=1y4uNGO7DxbwQncCBwxvcCKVTedlBefKS\u0026export=download)\n\n##### For more usage examples please have a look at the included demo project (or `pod try SCPageViewController`)\n\n## License\nSCPageViewController is released under the MIT License (MIT) (see the LICENSE file)\n\n## Contact\nAny suggestions or improvements are more than welcome and I would also love to know if you are using this component in a published application.\nFeel free to contact me at [stefan.ceriu@gmail.com](mailto:stefan.ceriu@gmail.com) or [@stefanceriu](https://twitter.com/stefanceriu). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanceriu%2Fscpageviewcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanceriu%2Fscpageviewcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanceriu%2Fscpageviewcontroller/lists"}