Comments (27)
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.
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.
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.
@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.
@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.
@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.
@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.
@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.
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.
@walterkyo you could fork the project and commit those changes and submit a pull request.
from cards.
@jondwillis The changes Walter made actually made the problems worse, wouldn't recommend.
from cards.
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.
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.
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.
I have the same problem, any solution? Thanks
from cards.
Same problem
from cards.
@walterkyo can you rewrite a better tutorial?
from cards.
upp
from cards.
@PaoloCuscela I've created a pull request that should fix this issue.
from cards.
@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.
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.
Ios12 full bug
from cards.
same bug on iOS 12 when release a fix for cards? please
from cards.
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.
Its not fixxed on iOS12.
from cards.
I'm still getting the glitchy animations with the Demo project in iOS 12
from cards.
from cards.
Related Issues (20)
- Image on card HOT 1
- Updating the title when the view is loaded HOT 1
- change font in Card Group Sliding HOT 1
- Adding an image in CardArticle file gives an error HOT 1
- IB Designables: Error [Help :c]
- Is this library supports Swift 4.0 ? HOT 1
- Open detail view into collection view HOT 1
- iOS 13 Card Dismiss doesn't work HOT 1
- Black screen on dismiss action iOS 13 HOT 4
- [Question] Is it possible to change it to new SwiftUI?
- Shadow offset customization
- Dismiss cards cause black screen on iOS13 and Xcode 11.2 HOT 1
- New update turns the view black after closing the view HOT 3
- How to Support Dark Mode
- Crash! HOT 1
- Crash when player card is tapped for fullscreen effect
- Black Screen and Crash! HOT 1
- IOS14 XCODE BETA 4 : Return black screen after dismiss CardView HOT 5
- Card icon color changes to blue when card expands
- How to create multiple cards using code?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cards.