/LWSnapshot

LWSnapshot,一个可自定义选取截取范围的截图组件。

Primary LanguageObjective-CMIT LicenseMIT

LWSnapshot

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

//listen screen snapshot
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidTakeScreenshotNotification:) name:UIApplicationUserDidTakeScreenshotNotification object:nil];

- (void)appDidTakeScreenshotNotification:(NSNotification *)notification {
    [self showSnapshotView];
}


//show snapshot view
- (void)showSnapshotView {
    LWSnapshotMaskView *snapshotMaskView = [LWSnapshotMaskView showSnapshotMaskInView:self.view];
    snapshotMaskView.snapshotFrame = CGRectMake((self.view.frame.size.width-200)/2, (self.view.frame.size.height-200)/2, 200, 200);
}


//long press gesture recongniz
- (void)longPressGestureAction:(UILongPressGestureRecognizer *)gesture {
    NSLog(@"--------: recongizer gesture snapshot");

    if(gesture.state == UIGestureRecognizerStateBegan ){
        [self showSnapshotView];
    }

}

Requirements

Installation

LWSnapshot is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'LWSnapshot'

Carthage

github "luowei/LWSnapshot"

Author

luowei, luowei@wodedata.com

License

LWSnapshot is available under the MIT license. See the LICENSE file for more info.