To run the example project, clone the repo, and run pod install
from the Example directory first.
SJPopMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SJPopMenu'
- 显示: [[SJPopMenu menu] showBy:xxxxxx]
- 需实现 SJCustomSelectTextView 里面方法,如果是自定义textView,只需将 SJCustomSelectTextView 的父类改为项目使用的textView即可
- controller中需实现3个方法并且发送通知,使滚动时正确显示menu
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
[[NSNotificationCenter defaultCenter] postNotificationName:@"SJChangePopMenuIfNeeded" object:nil];
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"SJShowPopMenuIfNeeded" object:nil];
}
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
if (!decelerate) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"SJShowPopMenuIfNeeded" object:nil];
}
}
- 点击menu action回调使用 menu.itemActions
SJPopMenu is available under the MIT license. See the LICENSE file for more info.