0

I'm using this GitHub project https://github.com/PaoloCuscela/Cards, and I have two view controllers with 14 cards each . Each card is declared like this in the view did load function :

let card = CardHighlight(frame: CGRect(x: 10, y: 30, width: 200 , height: 240))

card.backgroundColor = UIColor(red: 0, green: 94/255, blue: 112/255, alpha: 1)
card.icon = UIImage(named: "flappy")
card.title = "Welcome \nto \nCards !"
card.itemTitle = "Flappy Bird"
card.itemSubtitle = "Flap That !"
card.textColor = UIColor.white

card.hasParallax = true

let cardContentVC = storyboard!.instantiateViewController(withIdentifier: "CardContent")
card.shouldPresent(cardContentVC, from: self, fullscreen: false)

view.addSubview(card)

When I run my app on the simulator it is fine , but when running on my iPhone 6, if I open more that 5 cards at a time it crashes and it gives me error "Thread 1: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=650 MB, unused=0x0)".How should I fix this ?

  • What is the error message and stack trace and is it your code or the Cards library code that crashes? – Joakim Danielson Sep 03 '19 at 06:58
  • That error is basically an out-of-memory error, you have exceeded the limit of 650 Mb so the app crashes. Use fewer cards or make each card consume less memory if possible. You can google that error for more info. – Joakim Danielson Sep 04 '19 at 07:33

0 Answers0