mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-27 15:07:43 +00:00
Fixed retain cycle bug with delegates
- Added weak reference to delegates
This commit is contained in:
parent
f760434cf8
commit
814a659d93
3 changed files with 4 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ import UIKit
|
||||||
|
|
||||||
/// Delegate for SwiftyCamButton
|
/// Delegate for SwiftyCamButton
|
||||||
|
|
||||||
public protocol SwiftyCamButtonDelegate {
|
public protocol SwiftyCamButtonDelegate: class {
|
||||||
|
|
||||||
/// Called when UITapGestureRecognizer begins
|
/// Called when UITapGestureRecognizer begins
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ open class SwiftyCamButton: UIButton {
|
||||||
|
|
||||||
/// Delegate variable
|
/// Delegate variable
|
||||||
|
|
||||||
public var delegate: SwiftyCamButtonDelegate?
|
public weak var delegate: SwiftyCamButtonDelegate?
|
||||||
|
|
||||||
/// Maximum duration variable
|
/// Maximum duration variable
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
|
|
||||||
/// Public Camera Delegate for the Custom View Controller Subclass
|
/// Public Camera Delegate for the Custom View Controller Subclass
|
||||||
|
|
||||||
public var cameraDelegate: SwiftyCamViewControllerDelegate?
|
public weak var cameraDelegate: SwiftyCamViewControllerDelegate?
|
||||||
|
|
||||||
/// Maxiumum video duration if SwiftyCamButton is used
|
/// Maxiumum video duration if SwiftyCamButton is used
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import UIKit
|
||||||
|
|
||||||
/// Delegate for SwiftyCamViewController
|
/// Delegate for SwiftyCamViewController
|
||||||
|
|
||||||
public protocol SwiftyCamViewControllerDelegate {
|
public protocol SwiftyCamViewControllerDelegate: class {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
SwiftyCamViewControllerDelegate function called when the takePhoto() function is called.
|
SwiftyCamViewControllerDelegate function called when the takePhoto() function is called.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue