KYAsyncLoadBubble - 一个后台加载网页的悬浮球控件(OC)
jopen
9年前
一个后台加载网页的悬浮球控件。使用它,当你点击一个链接之后会挂起一个悬浮球进行后台加载,而不是粗鲁地切换到加载页面打扰用户当前的行为。
Installation
pod 'KYAsyncLoadBubble', '~> 1.0.2'
How to use
- (IBAction)addBubble:(id)sender { for (UIView *subview in self.view.subviews) { if ([subview isKindOfClass:[KYAsyncLoadBubble class]]) { return; } } _bubble = [KYAsyncLoadBubble new]; _bubble.bubbleColor = [UIColor colorWithRed:0.0 green:0.487 blue:1.0 alpha:1.0]; _bubble.progress = 0.0; _bubble.bubbleText = @"网页"; _bubble.delegate = self; _bubble.webUrl = @"http://kittenyang.com/deformationandgooey/"; [self.view addSubview:_bubble]; }
Then,you need to immplement the protocol method
#pragma mark -- TapBubbleDelegate -(void)bubbleDidTapped:(NSString *)webContent{ WebViewController *webVc = [[WebViewController alloc]initWithURL:_bubble.webUrl]; webVc.webContent = webContent; [self.navigationController pushViewController:webVc animated:YES]; }