The view coordinate arranged to the scrolling is adjusted.
// ViewController
#import <CoordinateManager.h>
#import <CoordinateContainer.h>
@interface ViewController ()
@property CoordinateManager *coordinateManager;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
・・・ 'TableView' and 'Custom Header' are made beforehand. ・・・
// Manager initialize
_coordinateManager = [[CoordinateManager alloc]initManager:self scroll:tableView header:headerView];
// create contents view
UIImageView *childView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sample-image"]];
// set start form
childView.frame = CGRectMake(100, 100, 0, 0);
// created view is put in the 'CoordinateContainer'
CoordinateContainer *containerView = [[CoordinateContainer alloc]initView:childView endForm:CGRectMake(100, 100, 50, 50) mode:kSmoothModeFixity completion:^(void){
// tap event callback.
}];
// set views
[_coordinateManager setContainer:tableView views:containerView, nil];
// set table view
[self.view addSubview:table];
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
// catch scroll event to coordinate object
[_coordinateManager scrolledDetection:scrollView];
}
MTCoordinatorView-objc is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MTCoordinatorView-objc'
- iOS 8.0+
- Xcode 7.3+
- MTCoordinatorView for Swift
https://github.com/mittsuu/MTCoordinatorView
MTCoordinatorView-objc is available under the MIT license. See the LICENSE file for more info.