Swift protocols: method does not override any method from its superclass

CocoaSwiftNslayoutmanager

Cocoa Problem Overview


Since Xcode 6 still has a lots of bugs with Swift, I'm not sure is it one or I'm missing something. My class adopts protocol NSLayoutManagerDelegate. But it seems impossible to override method I need. I do as documentation describes:

override func layoutManager(_ aLayoutManager: NSLayoutManager!,
		didCompleteLayoutForTextContainer aTextContainer: NSTextContainer!,
		atEnd flag: Bool) {
			
	}

But I get error here: method does not override any method from its superclass. What should I do?

Cocoa Solutions


Solution 1 - Cocoa

You're implementing a method from the protocol, yes, but it's not an override. Just remove the override keyword. An override is when your superclass also implements that method and you're providing a version that replaces or modifies the behavior of the superclass implementation. That's not what's happening here.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVitalii VashchenkoView Question on Stackoverflow
Solution 1 - CocoaKen ThomasesView Answer on Stackoverflow