Created
February 26, 2015 16:56
-
-
Save bimusiek/43dad861801aa0c62288 to your computer and use it in GitHub Desktop.
Swift allows override public method with private one
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 | |
class GiftCardPaymentViewController{ | |
public func nextStep() { | |
[...] | |
} | |
} | |
// Some testcase | |
class GiftCardPaymentTest:XCTestCase { | |
func testIt() { | |
class MockedGiftCardPaymentViewController:GiftCardPaymentViewController { | |
var nextStepExecutedCount = 0 | |
// SO FUCKING APPLE ALLOWES YOU TO SAY HERE PRIVATE... Even suggest it. If you do public you get: | |
// https://www.dropbox.com/s/7lbj0868dvctmia/Screenshot%202015-02-26%2017.55.47.png?dl=0 | |
private override func nextStep() { | |
nextStepExecutedCount++; | |
super.nextStep() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment