-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix optional members in Obj-C protocols
- Loading branch information
1 parent
9d5e886
commit 8fef295
Showing
9 changed files
with
284 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Foundation | ||
|
||
@objc protocol ObjCProtocol: Foundation.NSObjectProtocol { | ||
@objc func trivial() | ||
@objc func parameterizedReturning(param: String) -> Bool | ||
|
||
@objc var property: Bool { get } | ||
@objc var readwriteProperty: Bool { get set } | ||
|
||
// It’s possible to define Obj-C protocols with overloaded subscript requirements, but it can | ||
// never be implemented in Swift as the compiler will complain about the conflicting selectors. | ||
// @objc subscript(param: Int) -> Int { get set } | ||
|
||
// MARK: Optional | ||
|
||
@objc optional func optionalTrivial() | ||
@objc optional func optionalParameterizedReturning(param: String) -> Bool | ||
|
||
@objc optional var optionalProperty: Bool { get } | ||
@objc optional var optionalReadwriteProperty: Bool { get set } | ||
|
||
@objc optional subscript(param: Int) -> Bool { get set } | ||
} |
Oops, something went wrong.