joefryer / jdftooltips Goto Github PK
View Code? Open in Web Editor NEWA simple library for showing tooltip-like popups on iOS
License: MIT License
A simple library for showing tooltip-like popups on iOS
License: MIT License
Add the option to auto-dismiss a tooltip after a certain amount of time.
I'd like to add a tooltip pointing to the right BarButton in the Navigation bar. I can't seem to figure out the right approach.
I've tried this but it doesn't work. I can't get a pointer to the host view. It seems the targetview is nil.
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self loadObjects];
UIBarButtonItem *rightBarButtonItem = self.navigationItem.rightBarButtonItem;
UIView *targetView = [self.navigationItem.rightBarButtonItem valueForKey:@"view"];
UIView *targetSuperview = [targetView superview];
UIView *containerView = [targetSuperview superview];
if (nil == containerView) {
NSLog(@"Cannot determine container view from UIBarButtonItem: %@", self.navigationItem.rightBarButtonItem);
return;
}
JDFTooltipView *tooltip = [[JDFTooltipView alloc] initWithTargetBarButtonItem:self.navigationItem.rightBarButtonItem hostView:containerView tooltipText:@"Right bar button" arrowDirection:JDFTooltipViewArrowDirectionDown width:200.0f];
[tooltip show];
}
So I tried a different way to get the view for UIBarButtonItem but again the targetview is nil.
UIView *targetView = (UIView *)[self.navigationItem.rightBarButtonItem performSelector:@selector(view)];
I even tried getting the view this way but no luck there either.
UIView* customview = [self.navigationItem.rightBarButtonItem customView];
Hi,
I'm unable to get tooltips to show when using the line: "self.tooltipManager.showsBackdropView = YES;"
If I remove that line, then the tooltips appear, but without the backdrop, and they have to be individually pressed to dismiss them (instead of being able to tap anywhere on the screen).
The configuration is straight forward, as I copied the code from the example.
Possible issue with iOS9?
Thanks.
I've also found that the line:
[self.tooltipManager setDismissOnTouchForAllTooltips:NO];
doesn't change the behaviour of the tooltips at all (they still dismiss when touched).
Am I doing something obviously wrong?
Thanks.
Chris
is there a setting to position the tooltip (arrow facing down) with the tooltip centred above the view and not to the side?
Seems to be new with iOS 11 SDK. Other tool tips fail here too
Here's what I get when I try to install the dependencies.
$ pod install
Analyzing dependencies
CocoaPods 0.36.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Fetching podspec for `JDFTooltips` from `../`
[!] Unable to satisfy the following requirements:
- `JDFTooltips (from `../`)` required by `Podfile`
- `JDFTooltips (from `../`)` required by `Podfile`
- `JDFTooltips (= 0.1.0)` required by `Podfile.lock`
Regardless, I've managed to integrate your library into my app, and was wondering if you had plans to support the following:
I could also try implementing these myself and submitting a pull request if you'd like.
Dismiss on touch doesn't work, i think it's because it's drawing using Brezier Line Path, and has a clear color as the background, so the touchgesture never gets firedinside of the rectangle
I'm getting two tooltips when I should be getting one. I have a tableview which contains a imageview and a contentview. The contentview has a button. I'd like to show the tooltip pointing to the button. The code below tries to do that. Could you point me where I'm going wrong?
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object {
static NSString *CellIdentifier = @"Cell";
JKEPFTableViewCell *cell = (JKEPFTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[JKEPFTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell
...
UIView contentView = (UIView) [cell viewWithTag:105];
JDFTooltipView *tooltip = [[JDFTooltipView alloc] initWithTargetView:cell.shortlistButton hostView:contentView tooltipText:@"Tap to find similar shoes" arrowDirection:JDFTooltipViewArrowDirectionUp width:200.0f];
[tooltip show];
...
return cell;
}
Hi, sorry for the delay (I stopped receiving notifications for some reason). Since you closed the first issue, posting a new one with the code that got me that position behavior:
https://gist.github.com/francisjervis/1b022e05f948a2e71770#file-positionerror
Backdrop is working now, too.
Pull request: #13
Thanks for the great library. it's really well written and architected. One issue though is that the text is always some milliseconds behind when showing the tooltip. I mean the tooltip background shows first and after that the text appears. the same when dismissing. You can see it in the demo picture on the home page.
Is this intentional or is it a bug ? visually it looks like an issue.. if you got a quick hack to fix it, please help. Thank you
Hi, I get a crash as soon as I tap the tool tip:
tooltip`top_level_code at AppDelegate.swift:
0x101500540: pushq %rbp
0x101500541: movq %rsp, %rbp
0x101500544: subq $0x20, %rsp
0x101500548: callq 0x10150ac32 ; symbol stub for: Swift.C_ARGC.mutableAddressor : Swift.Int32
0x10150054d: movl (%rax), %edi
0x10150054f: movl %edi, -0x4(%rbp)
0x101500552: callq 0x10150ac38 ; symbol stub for: Swift.C_ARGV.mutableAddressor : Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>>
0x101500557: movq (%rax), %rax
0x10150055a: movq %rax, -0x10(%rbp)
0x10150055e: callq 0x101500330 ; type metadata accessor for tooltip.AppDelegate
0x101500563: movq %rax, %rdi
0x101500566: callq 0x10150ac0e ; symbol stub for: NSStringFromClass
0x10150056b: movabsq $0x0, %rdx
0x101500575: movq -0x10(%rbp), %rdi
0x101500579: movl -0x4(%rbp), %ecx
0x10150057c: movq %rdi, -0x18(%rbp)
0x101500580: movl %ecx, %edi
0x101500582: movq -0x18(%rbp), %rsi
0x101500586: movq %rax, %rcx
0x101500589: callq 0x10150ab48 ; symbol stub for: UIApplicationMain
0x10150058e: movl %eax, -0x1c(%rbp)
0x101500591: addq $0x20, %rsp
0x101500595: popq %rbp
0x101500596: retq
The code I'm using (in a blank project with only this pod installed) is
let toolTipMgr = JDFSequentialTooltipManager(hostView: self.view)
toolTipMgr.addTooltipWithTargetView(button, hostView: self.view, tooltipText: "tip", arrowDirection: JDFTooltipViewArrowDirection.Up, width: 180.0)
toolTipMgr.showNextTooltip()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.