Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bubble Padding X position #74

Closed
JaimeYesidLeonParada opened this issue May 20, 2016 · 14 comments
Closed

Bubble Padding X position #74

JaimeYesidLeonParada opened this issue May 20, 2016 · 14 comments

Comments

@JaimeYesidLeonParada
Copy link

JaimeYesidLeonParada commented May 20, 2016

It is possible to add a padding for the Bubble, position X? In some cases it is necessary move the bubble but not the arrow, for example:

http://www.dreamtemplate.com/dreamcodes/documentation/dc_images/dc-tooltips.jpg
dc-tooltips

I tested into a fork and looks good.

Thanks

@andreamazz
Copy link
Owner

Hi @JaimeYesidLeonParada
Which fork did you use?

@JaimeYesidLeonParada
Copy link
Author

JaimeYesidLeonParada commented May 29, 2016

Hi @andreamazz ,
I use this personal fork [https://github.com/JaimeYesidLeonParada/AMPopTip]. Branch => master.
I am working in this moment using the pod from path.

The idea is easy, add a horizontal offset, if the offset value is positive the bubble needs to move right side and if the value offset is negative the bubble needs to move left side.

I will appreciate very much whether you can add this functionality into AMPoptip.

@JaimeYesidLeonParada
Copy link
Author

@andreamazz If do you want I can do a PR with this new functionality.

@andreamazz
Copy link
Owner

Hi, yeah I would appreciate that :)
Can you call the property horizontalOffset instead of offsetHorizontal? Thanks 👍

@JaimeYesidLeonParada
Copy link
Author

@andreamazz excellent. I'll keep you posted.

@JaimeYesidLeonParada
Copy link
Author

JaimeYesidLeonParada commented May 31, 2016

@andreamazz I created the PR #75. I call the property as bubbleOffset because is more easy to apply in any direction and don't be restricted to one direction.

@jpv123
Copy link

jpv123 commented Jun 1, 2016

Amazing idea! I would love to use this, @andreamazz can you approve and release a new version with this today? It would be an incredible improvement for all of us that use your framework :D

@JaimeYesidLeonParada
Copy link
Author

Hi @andreamazz , I waiting for the approval to the PR, after this I would like to implement another feature that I had seen in another apps.

@andreamazz
Copy link
Owner

This should be solved now. Closing it, feel free to reopen if you need further assistance. 👍

@nevinjethmalani
Copy link

Can you add this to the docs? This is really helpful but I had to come and check the issues page to see if someone else was having this problem and only then did I see that this feature is available. Would have been great to have it in the readme. Great tool by the way!

@andreamazz
Copy link
Owner

Done 👍

@imokoi
Copy link

imokoi commented Sep 1, 2017

I Set this property, But The entire view moves, including arrows?

        cell.showTipBlock = { [weak self] (viewModel, label) in
            let energyTipView = MyTeamEnergyContributeView(frame: CGRect(x: 0, y: 0, width: 115, height: 100))
            energyTipView.bindViewModel(viewModel)
            
            guard let _self = self else { return }
            let newFrame = cell.convert(label.frame, to: _self.tableView)
            _self.popTip.edgeMargin = 0
            _self.popTip.bubbleOffset = CGFloat(-30)
            
            _self.popTip.show(customView: energyTipView, direction: .down, in: _self.tableView, from: newFrame)
        }

@andreamazz
Copy link
Owner

@codertian
Yes, the offset property moves the whole poptip from the origin, arrow included.

(BTW, you can use backticks if you don't want to prefix self with an underscore:

guard let `self` = self else { return }
self.doSomething()

@imokoi
Copy link

imokoi commented Sep 1, 2017

Yes thanks!
Is it necessary to do so?when the frame origin change, the arrowPosition also change? this code work good, The arrow will at the correct position!

    frame.origin.x += bubbleOffset
    arrowPosition.x -= bubbleOffset
    frame.size = CGSize(width: frame.width + borderWidth * 2, height: frame.height + borderWidth * 2)

    return (frame, arrowPosition)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants