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

Swift, PopUp is hidden by tableview cell. #52

Open
CapeFurSeal opened this issue Jun 17, 2016 · 5 comments
Open

Swift, PopUp is hidden by tableview cell. #52

CapeFurSeal opened this issue Jun 17, 2016 · 5 comments

Comments

@CapeFurSeal
Copy link

I read a similar post in the issues about someone having the same problem, except they had a jail broken phone and this was a while back.

The example project in Objective C is working but when I tried to implement it in my Swift project the pop over was being slightly hidden.

The delegate functions are being called.

screen shot 2016-06-17 at 12 15 39 pm

Any guesses?

    func sliderWillDisplayPopUpView(slider:ASValueTrackingSlider?) {
    self.superview?.bringSubviewToFront(self)
    } 
@alskipp
Copy link
Owner

alskipp commented Jun 17, 2016

Not sure : (
My best guess is it's something to do with the gradient in your tablecells.
The method to ensure the popup shows above other tablecells is admittedly a bit of a hack, I just can't think of a better way. What is the type of supeview in your use case? If it's not UITableView you might need superview.superview which is truly horrible. 🙀

@ghost
Copy link

ghost commented Sep 27, 2016

@alskipp I tried to implement it in a static tableview using swift 3. But I failed to connect the outlet from storyboard to my UITableViewCell subclass. (I tried to change my tableview to dynamic instead of static, everything works fine.)

Without the outlet I don't know how to prevent the slider being obscured by the cell. I tried to hack around in my TableViewController subclass but with no luck :( Do you know is there any way to solve it?

@alskipp
Copy link
Owner

alskipp commented Sep 28, 2016

Hi @rx2130, it is possible to get things working with a static tableview. I struggled a little initially, but the thing to check is that the cell has Clips to bounds set to false. Also ensure that the IBOutlet in the SliderCell subclass is connected to the slider.

snap

I've just added a new static tableview screen to the example project, please take a look at that – it's all done purely in Interface Builder.

@ghost
Copy link

ghost commented Sep 28, 2016

@alskipp Thanks for adding the new demo! I got it to work in the end but there're couple thing worth to point out.

  • After setting the subclass properly in storyboard, I was still having trouble to ctrl-drag from Interface Builder to my (swift) code. Eventually I created the @IBOutlet in code and drag from code to storyboard successfully. Guess it's probably a Xcode bug. (I'm using Xcode 8.0 8A218a)
  • I tried to leave Clip To Bounds to true. It doesn't make any difference. I have no idea why this is happening :o

@alskipp
Copy link
Owner

alskipp commented Sep 28, 2016

@rx2130 Glad it's working 👍
When I said "purely" in Interface Builder, I suppose that was a bit of a lie : )

What I really meant was that you don't need to add any code to your tableview controller, but you do need to declare the IBOutlet in the table cell subclass and handle the delegate method there.

No idea why keeping Clips To Bounds to true still works!?

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

2 participants