Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

iOS 10 rotation issue #6

Open
akotulu opened this issue Mar 20, 2017 · 7 comments
Open

iOS 10 rotation issue #6

akotulu opened this issue Mar 20, 2017 · 7 comments

Comments

@akotulu
Copy link

akotulu commented Mar 20, 2017

When rotating to landscape, card will be show as in portrait. After closing the opened card, new one opens in correct orientation. Same goes when rotating back to portrait. First card is always messed up.

Also when I open cards on different view controller, it shows the last image of it not the current one.

@victorBaro
Copy link
Contributor

Thank you @akotulu for reporting. I haven't tried it in landscape mode. I am not sure how to tackle the problem, to be honest. Cards are a good option in portrait mode, making them wider and shorter for landscape mode... I don't really like it. I have seen iOS10 ipad takes the card to the right side, keeping its ratio (height/width).
I didn't understand this part: "when I open cards on different view controller, it shows the last image of it not the current one".
Can you upload a screenshot, code snippet or something so I can understand? Thanks.

@akotulu
Copy link
Author

akotulu commented Apr 5, 2017

I made a video, this happens all the time if you have custom table view cell with constraints.

Video

@victorBaro
Copy link
Contributor

I think you are misusing the control. Can you turn on slow animations on the simulator (cmd + t) and record another video?
Looks to me that you are presenting the same viewcontroller again underneath the card, that's wrong.

Can I see the code for didSelectCellAtIndexPath: ?

@akotulu
Copy link
Author

akotulu commented Apr 5, 2017

Ok, set the self.present(self.stackController, animated: false, completion: nil) to false, animation flicker went away. But when scrolling to top and opening a new tab and closing it, shows wrong rows in background.

Video2

@victorBaro
Copy link
Contributor

This is weird.. the CardStackController generates a screenshot on viewWillAppear. I guess you are not dismissing the controller.
There is a public property called automaticallyDismiss which defaults to true (make sure you have not set it to false).
If your problem persists after setting automaticallyDismiss to true, you might have found a bug..
Another thing you can try is to set yourself as a delegate of the stackController, and make sure didFinishDismissingCardController is called.
I will review the code in the meantime, but I have never had this problem before.

@akotulu
Copy link
Author

akotulu commented Apr 6, 2017

I haven't changed this property and delegate is called. Forced it to true, but nothing changed.

fileprivate let stackController: CardStackController = CardStackController()
private func setup()
{
    self.stackController.delegate = self
    self.stackController.cardScaleFactor = 0.9
    self.stackController.firstCardTopOffset = 20
    self.stackController.topOffsetBetweenCards = 20
    self.stackController.verticalTranslation = -20
    self.stackController.automaticallyDismiss = true
}
let taskController = self.storyboard?.instantiateViewController(withIdentifier: "\(TaskViewController.self)") as! TaskViewController

taskController.delegate = self

self.present(self.stackController, animated: false, completion: nil)
self.stackController.stack(viewController: taskController)
extension TasksTableViewController: CardStackDelegate
{
    func dismiss() {
        self.stackController.unstackLastViewController()
    }
}

@nmdias
Copy link

nmdias commented Oct 24, 2017

Hi also had an issue where it would always show the the image of the first transition.

I was keeping a strong reference to a CardStackController. After I started instantiating a new instance, instead of reusing the same, the problem went away.

Thank you for this great framework 🥇 very clean api, super simple, saved me hours.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants