{"id":19571310,"url":"https://github.com/orucanil/anwexpandscrollview","last_synced_at":"2025-04-27T03:32:12.922Z","repository":{"id":197658163,"uuid":"52273548","full_name":"orucanil/ANWExpandScrollView","owner":"orucanil","description":"Expand - Collapse Scroll View - Animate With Pinch Gesture","archived":false,"fork":false,"pushed_at":"2016-10-05T06:51:43.000Z","size":41,"stargazers_count":125,"open_issues_count":1,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T12:38:22.013Z","etag":null,"topics":["collapse-scroll","expand","ios","objective-c","tableview","uiview"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/annul","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/orucanil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-02-22T12:58:48.000Z","updated_at":"2024-10-22T13:14:45.000Z","dependencies_parsed_at":"2023-10-01T23:56:18.347Z","dependency_job_id":"2cd0e9e5-cf15-4fe8-9824-0b0bfe80c4d7","html_url":"https://github.com/orucanil/ANWExpandScrollView","commit_stats":null,"previous_names":["orucanil/anwexpandscrollview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orucanil%2FANWExpandScrollView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orucanil%2FANWExpandScrollView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orucanil%2FANWExpandScrollView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orucanil%2FANWExpandScrollView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orucanil","download_url":"https://codeload.github.com/orucanil/ANWExpandScrollView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251085147,"owners_count":21533821,"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":["collapse-scroll","expand","ios","objective-c","tableview","uiview"],"created_at":"2024-11-11T06:18:24.027Z","updated_at":"2025-04-27T03:32:12.583Z","avatar_url":"https://github.com/orucanil.png","language":"Objective-C","readme":"# ExpandScrollView\nExpand - Collapse Scroll View - Animate With Pinch Gesture \n\nThe component was used in the platinum application : https://itunes.apple.com/tr/app/turkcell-platinum-size-ozel/id671494224?mt=8\n\n## Display Visual Example \n\n----\n![Visual1](http://g.recordit.co/2ExfUA6pbw.gif)\n\n\nInstallation\n--------------\n\nTo use the PLExpandScrollView class in an app, just drag the PLExpandScrollView class files (demo files and assets are not needed) into your project.\n\nProperties\n--------------\n\nThe PLExpandScrollView has the following properties (note: for iOS, UIView when using properties):\n\n    @property (nonatomic, weak) IBOutlet id\u003cPLExpandScrollViewDataSource\u003e dataSource;\n\nAn object that supports the PLExpandScrollViewDataSource protocol and can provide views to populate the scroll.\n\n    @property (nonatomic, weak) IBOutlet id\u003cPLExpandScrollViewDelegate\u003e delegate;\n\nAn object that supports the PLExpandScrollViewDelegate protocol and can respond to scroll events and layout requests.\n\n    @property (nonatomic, assign, readonly) BOOL isExpand;\n\nReturns the scroll is currently being state programatically.\n\n    @property (nonatomic, assign) BOOL scrollEnabledExpand;\n\nEnables and disables user scrolling on expand state of the scroll. The scroll can still be scrolled programmatically on expand state if this property is set to NO.\n\n    @property (nonatomic, assign) BOOL scrollEnabledCollapse;\n\nEnables and disables user scrolling on collapse state of the scroll. The scroll can still be scrolled programmatically on collapse state if this property is set to YES.\n\n    @property (nonatomic, assign, readonly) PLExpandScrollViewStatus status;\n\nReturns the scroll is currently being status programatically. (PLExpandScrollViewStatusExpand, PLExpandScrollViewStatusCollapse or PLExpandScrollViewStatusPinching)\n\n    @property (nonatomic, assign, readonly) NSUInteger currentPageIndex;\n\nReturns the scroll is currently being page index programatically. Expanding Status: Current Item Index - Collapse Status: Top Item Index.\n\n    @property (nonatomic, strong, readonly) NSArray *visibleItemIndexs;\n\nAn array containing the indexes of only visible item views currently loaded and visible in the scroll. The array contains NSNumber objects whose integer values match the indexes of the views. The indexes for item views start at zero and match the indexes passed to the dataSource to load the view, however the indexes not equal to numberOfItems.\n\n\nMethods\n--------------\n\nThe PLExpandScrollView class has the following methods (note: for iOS, UIView in method arguments):\n\n    + (instancetype)init;\n\nCustom initialize method.\n\n    + (instancetype)initWithFrame:(CGRect)frame;\n\nCustom initialize method.\n\n    - (UIView*)visibleItemAtIndex:(NSUInteger)index;\n\nReturns the visible item view with the specified index. Note that the index relates to the position in the scroll, and not the position in the visibleItemIndexs array, which may be different. Pass a negative index or one greater than or equal to numberOfItems to retrieve placeholder views. The method only works for visible item views and will return nil if the view at the specified index has not been loaded, or if the index is out of bounds.\n\n    - (void)expandAtIndex:(NSInteger)index animated:(BOOL)animated;\n\nThis will center the scroll expand on the specified item, either immediately or with a smooth animation.\n\n    - (void)collapseWithAnimated:(BOOL)animated;\n\nThis will top the scroll collapse on the specified item, either immediately or with a smooth animation.\n\n    - (void)reloadData;\n\nThis reloads all scroll views from the dataSource and refreshes the scroll display.\n\n\nProtocols\n--------------\n\nThe PLExpandScrollView follows the Apple convention for data-driven views by providing two protocol interfaces, PLExpandScrollViewDataSource and PLExpandScrollViewDelegate. The PLExpandScrollViewDataSource protocol has the following required methods (note: for iOS, UIView in method arguments):\n\n    -(NSUInteger)numberOfItemsInScrollView:(PLExpandScrollView *)scrollView;\n\nReturn the number of items (views) in the scroll.\n\n    -(UIView*)expandScrollView:(PLExpandScrollView *)scrollView viewForItemAtIndex:(NSUInteger)index;\n\nReturn a view to be displayed at the specified index in the scroll.\n\nThe PLExpandScrollViewDelegate protocol has the following optional methods:\n\n    -(void)expandScrollView:(PLExpandScrollView*)scrollView didSelectItemAtIndex:(NSUInteger)index;\n\nThis method will fire if the user taps any scroll item view, including the currently selected view. This method will not fire if the user taps a control within the currently selected view (i.e. any view that is a subclass of UIControl).\n\n    -(void)expandScrollView:(PLExpandScrollView*)scrollView changedStatus:(PLExpandScrollViewStatus)status previousStatus:(PLExpandScrollViewStatus)previousStatus;\n\nThis method is called whenever the scroll scrolls far enough for the currentItemIndex property to change. It is called regardless of whether the item index was updated programatically or through user interaction.\n\n    -(CGFloat)expandHeightInScrollView:(PLExpandScrollView *)scrollView index:(NSUInteger)index;\n\nThis method is called whenever the scroll change status far enough for the currentItemIndex property to change. It is called regardless of whether the item index was updated programatically or through user interaction. The scroll can still be scrolled programmatically on expand state if this property is set to [UIScreen mainScreen].bounds.size.height.\n\n    -(CGFloat)collapseHeightInScrollView:(PLExpandScrollView *)scrollView index:(NSUInteger)index;\n\nThis method is called whenever the scroll change status far enough for the currentItemIndex property to change. It is called regardless of whether the item index was updated programatically or through user interaction. The scroll can still be scrolled programmatically on collapse state if this property is set to 44.0f.\n\n\nHow to use ?\n----------\n\n```Objective-C\n#import \"PLExpandScrollView.h\"\n\n@interface ViewController () \u003cPLExpandScrollViewDataSource,PLExpandScrollViewDelegate\u003e\n\n...\n\n- (void)loadView\n{\n[super loadView];\n\nPLExpandScrollView *scrollView = [PLExpandScrollView initWithFrame:[UIScreen mainScreen].bounds];\nscrollView.delegate = self;\nscrollView.dataSource = self;\n\n[scrollView reloadData];\n\n[scrollView expandAtIndex:0 animated:NO];\n\n}\n\n...\n\n#pragma mark - PLExpandScrollView delegates \u0026 datasources\n\n-(NSUInteger)numberOfItemsInScrollView:(PLExpandScrollView *)scrollView\n{\nreturn 10;\n}\n\n-(UIView *)expandScrollView:(PLExpandScrollView *)scrollView viewForItemAtIndex:(NSUInteger)index\n{\nreturn [UIView new];\n}\n\n-(void)expandScrollView:(PLExpandScrollView *)scrollView didSelectItemAtIndex:(NSUInteger)index\n{\n\n}\n\n-(CGFloat)collapseHeightInScrollView:(PLExpandScrollView *)scrollView index:(NSUInteger)index\n{\n    return 160.0f;\n}\n\n-(void)expandScrollView:(PLExpandScrollView *)scrollView changedStatus:(PLExpandScrollViewStatus)status previousStatus:(PLExpandScrollViewStatus)previousStatus\n{\n    // Show Animation\n}\n\n```\n\nBuild and run the project files. Enjoy more examples!","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forucanil%2Fanwexpandscrollview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forucanil%2Fanwexpandscrollview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forucanil%2Fanwexpandscrollview/lists"}