Skip to content

Commit 4156c9d

Browse files
Add Objective-C compatibility for hide method #25
1 parent f9de73a commit 4156c9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CDAlertView/Classes/CDAlertView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,14 @@ open class CDAlertView: UIView {
290290
completionBlock = completion
291291
}
292292

293-
public func hide(animations: CDAlertAnimationBlock? = nil,
293+
// Instead of defining default `nil` parameter for `hide(animations: CDAlertAnimationBlock?, isPopupAnimated:Bool)` method
294+
// we define this method for Objective-C compatibility.
295+
// CDAlertAnimationBlock is not supported in Objective-C
296+
public func hide(isPopupAnimated: Bool) {
297+
hide(animations: nil, isPopupAnimated: isPopupAnimated)
298+
}
299+
300+
public func hide(animations: CDAlertAnimationBlock?,
294301
isPopupAnimated: Bool) {
295302
if !isTextFieldHidden {
296303
textField.resignFirstResponder()

0 commit comments

Comments
 (0)