Skip to content

How to deallocate memory? #85

@Marcin951

Description

@Marcin951

New Issue Checklist

Issue Description

It can take a lot of memory (about 400Mb) and CPU 50%, how I can delete magnetic when the user doesn't need it?
magnetic!.removeAllChildren() magnetic!.removeFromParent() magnetView.removeFromSuperview()
It doesn't help
https://imgur.com/a/Xy3NM5q screens after open view with magnetic views
And implementation of magnetic view (i have 4 magnetic views there, but user needs it only for a while, also i have this with tab bar so i'm not able to dismiss view)
@IBOutlet weak var magneticView: UIView! @IBOutlet weak var nextMagneticButton: UIButton! weak var magnetic: Magnetic? var magnetView: MagneticView! func loadMagnetic(){ view.removeGestureRecognizer(tapGesture) magnetView = MagneticView(frame: self.magneticView.bounds) magnetView.backgroundColor = .clear magnetic = magnetView.magnetic magnetic!.magneticDelegate = self self.magneticView.addSubview(magnetView) self.magneticView.bringSubviewToFront(nextMagneticButton) magnetic!.backgroundColor = .clear for i in 0..<stylesText.count{ let node = Node(text: stylesText[i], image: nil, color: UIColor.init(hexFromString: "FFFFFF", alpha: 0.15), radius: 50) self.magnetic!.addChild(node) }

Environment

  • iOS Version: [13.3.1]
  • Device(s): [iPhone XS Max]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions