-
Notifications
You must be signed in to change notification settings - Fork 146
How to deallocate memory? #85
Description
New Issue Checklist
- I updated Magnetic to the latest version.
- I read the Contribution Guidelines.
- I read the documentation.
- I searched for existing GitHub issues.
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]