From de82b4309c4303d3c51b54821494f3d9cf56ab8c Mon Sep 17 00:00:00 2001 From: Reinier Melian Massip Date: Mon, 16 Apr 2018 13:36:58 +0200 Subject: [PATCH] fixing issue related to deallocation --- Example/AZAPicker/ViewController.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Example/AZAPicker/ViewController.swift b/Example/AZAPicker/ViewController.swift index 0f7aa80..196a49f 100644 --- a/Example/AZAPicker/ViewController.swift +++ b/Example/AZAPicker/ViewController.swift @@ -30,7 +30,9 @@ class ViewController: UIViewController { let pickerView = AZAPicker(with: config, frame: .zero) pickerView.backgroundColor = .white - pickerView.onPickItem = self.picker + pickerView.onPickItem = {( sender : AZAPicker,item:PickerItem) in + print("didPickItem: \(item)") + } pickerView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(pickerView) @@ -44,8 +46,11 @@ class ViewController: UIViewController { NSLayoutConstraint(item: pickerView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 80).isActive = true } - func picker(sender: AZAPicker, item: PickerItem) { + /*func picker(sender: AZAPicker, item: PickerItem) { print("didPickItem: \(item)") - } + }*/ + deinit { + debugPrint("Deallocated") + } }