Open francisjervis opened 9 years ago
Hi @francisjervis,
The reason is that you need to keep a strong reference to the tooltip manager.
I just tried it out (in Objective-C); something like this will fix it:
// Interface
@property (nonatomic, strong) JDFSequentialTooltipManager *tooltipManager;
// somewhere else
self.tooltipManager = [[JDFSequentialTooltipManager alloc] initWithHostView:self.view];
[self.tooltipManager addTooltipWithTargetPoint:CGPointMake(100.0f, 200.0f) tooltipText:@"Tooltip" arrowDirection:JDFTooltipViewArrowDirectionUp hostView:self.view width:150.0f];
[self.tooltipManager showNextTooltip];
I should have made this clear in the README - I'll update it to say so.
Joe
Hi, this doesn’t help at all I’m afraid. This isn’t applicable for Swift as far as I know.
On Feb 21, 2015, at 6:42 AM, Joe Fryer notifications@github.com wrote:
Hi Francis,
The reason is that you need to keep a strong reference to the tooltip manager.
I just tried it out (in Objective-C); something like this will fix it:
// Interface @property (nonatomic, strong) JDFSequentialTooltipManager *tooltipManager;
// somewhere else self.tooltipManager = [[JDFSequentialTooltipManager alloc] initWithHostView:self.view]; [self.tooltipManager addTooltipWithTargetPoint:CGPointMake(100.0f, 200.0f) tooltipText:@"Tooltip" arrowDirection:JDFTooltipViewArrowDirectionUp hostView:self.view width:150.0f]; [self.tooltipManager showNextTooltip]; I should have made this clear in the README - I'll update it to say so.
Joe
— Reply to this email directly or view it on GitHub https://github.com/JoeFryer/JDFTooltips/issues/3#issuecomment-75368221.
So, in Swift you would add a property (let
/var
, whatever you want) for your tooltip manager to your view controller (I'm assuming it's a view controller where you're using the tooltips from).
Quick/dirty example, that works:
Yes, that works, thanks! Not the fix I was expecting (not sure how the “strong reference” translates to declaring as an optional then unwrapping as I don’t know ObjC).
Unfortunately tho when I add
toolTipMgr?.showsBackdropView = true
the tips don’t appear...
On Feb 21, 2015, at 12:37 PM, Joe Fryer notifications@github.com wrote:
So, in Swift you would add a property (let/var, whatever you want) for your tooltip manager to your view controller (I'm assuming it's a view controller where you're using the tooltips from).
Quick/dirty example, that works:
https://cloud.githubusercontent.com/assets/5180610/6315138/3d0d7a50-b9f0-11e4-9b03-b47ac279ee88.png — Reply to this email directly or view it on GitHub https://github.com/JoeFryer/JDFTooltips/issues/3#issuecomment-75382534.
You're right - I'll push a fix when I can.
As a workaround, if you show the tooltips from viewDidAppear
instead of viewDidLoad
/viewWillAppear
, it works ok.
Thanks! I’m also seeing some odd layout behaviour (see shots)…it looks like the origin of the tip’s frame = LR corner of the target, which is unexpected with that arrow config.
On Feb 21, 2015, at 1:36 PM, Joe Fryer notifications@github.com wrote:
You're right - I'll push a fix when I can.
As a workaround, if you show the tooltips from viewDidAppear instead of viewDidLoad/viewWillAppear, it works ok.
— Reply to this email directly or view it on GitHub https://github.com/JoeFryer/JDFTooltips/issues/3#issuecomment-75385481.
No pictures have come through...
Hmm I've just tried something similar, and it seems to be working ok. Could you upload a test project showing the issue?
Hi, I get a crash as soon as I tap the tool tip:
The code I'm using (in a blank project with only this pod installed) is