Open ghost opened 7 years ago
In SwipeViewController viewWillAppear function write this:
//Navigation View
let navigationView = interfaceController.initNavigationView()
let imageView = UIImageView(image: UIImage(named: "YellowHearts"))
imageView.frame.size = CGSize(width: 20, height: 20)
imageView.center = CGPoint(x: viewWidth / 2 - 50, y: navigationBarHeight / 2)
navigationView.addSubview(imageView)
And in InterfaceController find line if buttonDelegate.equalSpaces {:
if buttonDelegate.equalSpaces {
originX = buttonDelegate.x * CGFloat(button.tag) + width + buttonDelegate.offset - barButtonDelegate.barButtonItemWidth
if button.tag == 1 {
originX -= buttonDelegate.offset
}
else {
originX += buttonDelegate.offset
}
width += buttonWidth
}
Let me know if it works, so I can close this.
Thanks a lot, it worked!
But when I set below code, the selection bar won't be right under the swipe buttons, how should I fix that?
setButtonsOffset(90, bottomOffset: 0)
How far away is it? Or can you send me a screenshot?
Here are the screenshots.
And did it work before adding the image? If it did, the problem should definitely be something in InterfaceController, I would try to check if the setting of tags and button offsets are right, focus on the part here:
if buttonDelegate.equalSpaces {
originX = buttonDelegate.x * CGFloat(button.tag) + width + buttonDelegate.offset - barButtonDelegate.barButtonItemWidth
if button.tag == 1 {
originX -= buttonDelegate.offset
}
else {
originX += buttonDelegate.offset
}
width += buttonWidth
}
Yes, it worked before adding the image.
I am sorry, the problem is with selectionBar, I will look into it later during today.
Mine works just fine with the adjustments I posted here, but just to be sure, could you send me your InterfaceController class and your implementation of SwipeViewController?
Hi, thank you so much for sharing this awesome project. I'm still an ios-app-developing beginner, I would like to insert an image between my two swipe buttons, is there possibly a way to do that? Thank you!