Git Product home page Git Product logo

Comments (27)

Nerkyator avatar Nerkyator commented on August 25, 2024 1

I'have the same issue. It doesn't happen everytime so is hard to catch where and when it appears but I confirm.
The only thing I noticed is that (for me) happens only on a real device, never on simulator.

from cards.

Nerkyator avatar Nerkyator commented on August 25, 2024 1

Just tried with latest release and bug is still present. After few tries it seems that you can reproduce the problem if you dismiss detailViewController panning from its internal scrollView. It doesn't happen everytime unfortunately :(
I used CardGroup demo on an iPhone 8 Simulator

from cards.

Nerkyator avatar Nerkyator commented on August 25, 2024

It seems that on your side is quite easy to reproduce the issue but on my project(s) it's really random. The only thing I found with lot of tries is:
Open the CardHighlight detail
Scroll to bottom to let close button appear
While scrolling animation is still in progress (bouncing or scrolling) push the close button
With these steps the bug always appears (little different because the card goes on the top center instead top left).
I'm trying to figure out but it seems to be not so easy :(

from cards.

elitebyte avatar elitebyte commented on August 25, 2024

@walterkyo Thank you for your advice, unfortunately the problem still persists and I made sure to clean+build my project to make sure the dependencies were rebuilt using the modifications. But no cigar, any ideas? Also what's the best way to go about debugging this issue?

Edit: Whenever the card is dropped back down I get this printed in my console "(0.0, 0.0, 375.0, 812.0)" seems like a CGRect print out but the only thing is that my card's frame is 300x300 nowhere near the 812. Also not sure where this print out is coming from.

from cards.

Nerkyator avatar Nerkyator commented on August 25, 2024

@walterkyo Same as EliteByte said: I added your modifications to a fresh download of Cards and nothing changes. Well, actually the only thing changing is that on back animation the background is black and returns white once animation is finished (so worst than before ๐Ÿ˜…)

@elitebyte the print you see comes from print(scrollView.frame). It is located in layout func, in DetailViewController class ๐Ÿ˜Š

from cards.

elitebyte avatar elitebyte commented on August 25, 2024

@Nerkyator Yah I just realized that it made the problem worse lol. And also did find the line where that's being printed. Seems pretty extraneuous usually random print's like that are taken out of final builds as it doesn't seem to have any functionality.

Any thoughts though on getting this fixed? This has been buggin' me for the past week (no pun intented). The problem would have to exist within the Animations.swift file right? I'm not sure which function/class is triggered when the Card is pushed back.

from cards.

Nerkyator avatar Nerkyator commented on August 25, 2024

@walterkyo: Just tried your modifications. I can't reproduce easily the bug described by @elitebyte (happens scrolling down the DetailViewController to close it) so I don't know if your edit fixed it. I think we have to wait for him to try it.
I tried using the close button (as described few comments above) and the bug still persists :(

from cards.

walterkyo avatar walterkyo commented on August 25, 2024

@Nerkyator by more testing my code does not fix the "fast scrolling + dismiss cardview" bug. But it looks like a little bit better. The "fast scrolling + dismiss" problem is probably due to the card frame position.

in Card.swift
//Change this variable to public
open var originalFrame = CGRect.zero

in HighlightViewController.swift
//Update card frame
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

    if let superview = first.superview {
        first.originalFrame = superview.convert(first.frame, to: nil)
    }
    
    if let superview = second.superview {
        second.originalFrame = superview.convert(second.frame, to: nil)
    }
}

in Animator.swift
guard presenting else {
...
//Change (card.backgroundIV.frame, to: card.originalFrame) to (card.originalFrame, to: card.originalFrame)
let bounce = self.bounceTransform(card.originalFrame, to: card.originalFrame)
}

private func bounceTransform(_ from: CGRect, to: CGRect ) -> CGAffineTransform {
//Change .center to .origin
let old = from.origin
let new = to.origin
}

in DetailViewController.swift
if let detail = detailView {
//Add this
detail.frame = self.view.bounds

        scrollView.addSubview(detail)
        detail.alpha = 0
        detail.autoresizingMask = .flexibleWidth
    }

//Update detail frame, blurView frame, scrollView frame, card.backgroundIV frame, originalFrame here
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
if isShowing{
let screenSize = UIScreen.main.bounds
self.view.frame.size = CGSize(width: screenSize.width, height: screenSize.height)

        blurView.frame = self.view.bounds
        
        card.superVC?.viewWillLayoutSubviews()
        
        scrollView.frame.size = CGSize(width: LayoutHelper.editedXScreen(85, view: self.view), height: LayoutHelper.editedYScreen(100, view: self.view) - 20)
        
        scrollView.center = blurView.center
        scrollView.frame.origin.y = 40
        
        card.backgroundIV.frame.origin = scrollView.bounds.origin
        card.backgroundIV.frame.size = CGSize( width: scrollView.bounds.width,
                                               height: card.backgroundIV.bounds.height)
        
        originalFrame = scrollView.frame
        
        if let detail = detailView {
            detail.frame = CGRect(x: 0,
                                  y: card.backgroundIV.bounds.maxY,
                                  width: scrollView.frame.width,
                                  height: screenSize.height)
            scrollView.contentSize = CGSize(width: scrollView.bounds.width, height: detail.frame.maxY)
        }
    }
}

in LayoutHelper.swift
//this one is optional for device rotation issue
static func editedXScreen(_ percentage: CGFloat, view: UIView) -> CGFloat {
return percentage * view.bounds.width / 100
}

static func editedYScreen(_ percentage: CGFloat, view: UIView) -> CGFloat {
    return percentage * view.bounds.height / 100
}

from cards.

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

I've found where the problem was.
It was caused by a strange behavior of the DetailViewController's ScrollView.
I should have fixed that, try with the latest update and let me know ;D

from cards.

jondwillis avatar jondwillis commented on August 25, 2024

@walterkyo you could fork the project and commit those changes and submit a pull request.

from cards.

elitebyte avatar elitebyte commented on August 25, 2024

@jondwillis The changes Walter made actually made the problems worse, wouldn't recommend.

from cards.

akring avatar akring commented on August 25, 2024

Same problem here. Happens on cards with detail view controller.

I just tried the demo and we can reproduce it on all the cards in demo.

Device: iPhone 8
OS: iOS 12 Public Beta (a6A5345f)

from cards.

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

I managed to solve the rotation glitch in non-fullscreen cards just by switching

scrollView.frame.size = CGSize(width: LayoutHelper.YScreen(90), height: LayoutHelper.XScreen(100) - 20)

in DetailViewController -> layout()

For the disappearing cards on close I can't replicate it on iPhone 6s + simulator.
Pushing the latest changes, let me know...

from cards.

akring avatar akring commented on August 25, 2024

Not resolved, still can reproduce it on all kinds of devices running iOS 12. This bug seems only occurs on iOS 12 devices.

from cards.

eeschiavo avatar eeschiavo commented on August 25, 2024

I have the same problem, any solution? Thanks

from cards.

Michele404 avatar Michele404 commented on August 25, 2024

Same problem

from cards.

Michele404 avatar Michele404 commented on August 25, 2024

@walterkyo can you rewrite a better tutorial?

from cards.

Anyone404 avatar Anyone404 commented on August 25, 2024

upp

from cards.

amerhukic avatar amerhukic commented on August 25, 2024

@PaoloCuscela I've created a pull request that should fix this issue.

from cards.

akring avatar akring commented on August 25, 2024

@amerhukic Thank you for your PR but problem still not resolved, this bug is iOS 12 only, and we still can reproduce it with official demo.

from cards.

Michele404 avatar Michele404 commented on August 25, 2024

The demo is fixxed as I can see, I canโ€™t reproduce the bug. It was on iOS 11+ too and I donโ€™t got it at the moment, Iโ€™ll test with iOS 12 today

from cards.

Michele404 avatar Michele404 commented on August 25, 2024

Ios12 full bug

from cards.

federico2390 avatar federico2390 commented on August 25, 2024

same bug on iOS 12 when release a fix for cards? please

from cards.

jondwillis avatar jondwillis commented on August 25, 2024

Assuming this is fixed by @amerhukic 's PR that was merged.
The fix is in master, but there has not yet been a release published. However, if you are using Cocoapods, you may pull in the hotfix by:

pod 'Cards', :git => 'https://github.com/PaoloCuscela/Cards.git'

from cards.

Michele404 avatar Michele404 commented on August 25, 2024

Its not fixxed on iOS12.

from cards.

junaidxabd avatar junaidxabd commented on August 25, 2024

I'm still getting the glitchy animations with the Demo project in iOS 12

from cards.

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

#80

from cards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.