Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Pod/Classes/LiquidFloatingActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import QuartzCore
@objc public protocol LiquidFloatingActionButtonDelegate {
// selected method
optional func liquidFloatingActionButton(liquidFloatingActionButton: LiquidFloatingActionButton, didSelectItemAtIndex index: Int)
optional func didTapped(liquidFloatingActionButton: LiquidFloatingActionButton)
}

public enum LiquidFloatingActionButtonAnimateStyle : Int {
Expand Down Expand Up @@ -240,6 +241,7 @@ public class LiquidFloatingActionButton : UIView {
}

private func didTapped() {
delegate!.didTapped!(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the delegate and the protocol method are optionals, the force unwrapping on this line will lead to crashes if either the delegate is not provided or the protocol method didTapped: is not implemented.

Use ? instead of !

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agreed with @carlosgrossi .

if isClosed {
open()
} else {
Expand Down Expand Up @@ -544,4 +546,4 @@ public class LiquidFloatingCell : LiquittableCircle {
actionButton?.didTappedCell(self)
}

}
}