Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from AYastrebov/master
Browse files Browse the repository at this point in the history
Make protocol methods optionsl
  • Loading branch information
mariusc authored Sep 29, 2017
2 parents 510d959 + e64781a commit 5417bbd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Example/Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "nodes-ios/KeyboardHelper" "swift-3.0"
github "nodes-ios/KeyboardHelper"
2 changes: 1 addition & 1 deletion Example/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "nodes-ios/KeyboardHelper" "58d7c2bf19f7bc93d733290f06ae0eedf03f18a5"
github "nodes-ios/KeyboardHelper" "1.1.0"
5 changes: 5 additions & 0 deletions KeyboardHelper/Classes/KeyboardHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public protocol KeyboardHelperDelegate: class {
func keyboardWillDisappear(_ info: KeyboardAppearanceInfo)
}

/// Hack to make protocol methods optional
public extension KeyboardHelperDelegate {
func keyboardWillAppear(_ info: KeyboardAppearanceInfo) {}
func keyboardWillDisappear(_ info: KeyboardAppearanceInfo) {}
}

/// Useful helper to keep track of keyboard changes.
public class KeyboardHelper {
Expand Down
4 changes: 0 additions & 4 deletions KeyboardHelperTests/Tests/KeyboardHelperTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ class HideSpyDelegate : KeyboardHelperDelegate {
kai = info
expectation.fulfill()
}

func keyboardWillAppear(_ info: KeyboardAppearanceInfo) {

}
}

class KeyboardHelperTests: XCTestCase {
Expand Down

0 comments on commit 5417bbd

Please sign in to comment.