Skip to content

Commit

Permalink
Use weak self for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
sberrevoets committed Feb 27, 2017
1 parent 232478f commit b7ef60e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/AlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public enum ActionLayout: Int {
@objc(SDCAlertController)
public class AlertController: UIViewController {

private lazy var assignResponder: () -> Bool = { [unowned self] () in
self.textFields?.first?.becomeFirstResponder() ?? false
private lazy var assignResponder: () -> Bool = { [weak self] _ in
self?.textFields?.first?.becomeFirstResponder() ?? false
}

/// The alert's title. Directly uses `attributedTitle` without any attributes.
Expand Down

0 comments on commit b7ef60e

Please sign in to comment.