-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Liftric/fix/memory-leaks
Fix: memory leaks
- Loading branch information
Showing
11 changed files
with
271 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// DebugViewController.swift | ||
// TestApp | ||
// | ||
// Created by Jan Gaebel on 11.06.21. | ||
// | ||
|
||
import UIKit | ||
import kvault | ||
|
||
class DebugViewController: UIViewController { | ||
|
||
let button = UIButton() | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
title = "test" | ||
view.backgroundColor = .white | ||
view.addSubview(button) | ||
|
||
button.translatesAutoresizingMaskIntoConstraints = false | ||
button.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true | ||
button.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true | ||
button.setTitle("DEBUG", for: .normal) | ||
button.setTitleColor(.red, for: .normal) | ||
|
||
button.addTarget(self, action: #selector(debug), for: .touchUpInside) | ||
} | ||
|
||
@objc func debug() { | ||
let vault = KVault(serviceName: "DEBUG", accessGroup: nil) | ||
self.performOperations(on: vault) | ||
} | ||
|
||
private func performOperations(on vault: KVault) { | ||
vault.set(key: "A", boolValue: true) | ||
vault.set(key: "B", intValue: 1) | ||
vault.set(key: "C", floatValue: 1) | ||
vault.set(key: "D", doubleValue: 1) | ||
vault.set(key: "E", longValue: 1) | ||
vault.set(key: "F", stringValue: "T") | ||
_ = vault.existsObject(forKey: "A") | ||
_ = vault.bool(forKey: "A") | ||
_ = vault.int(forKey: "B") | ||
_ = vault.float(forKey: "C") | ||
_ = vault.double(forKey: "D") | ||
_ = vault.long(forKey: "E") | ||
vault.deleteObject(forKey: "F") | ||
vault.clear() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.