An Interface should have one purpose and one purpose only. If a class wants to implement a functionality from an interface, it shouldn't have to implement methods it doesn't need.
Example from Apple's UIKit:
| import SwiftUI | |
| class ContentViewStateObject: ObservableObject { | |
| var titles = ["Hello", "World", "Test", "ABC"] | |
| @Published var primaryTitle: String | |
| init() { | |
| self.primaryTitle = titles.randomElement()! | |
| } |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>DVTConsoleDebuggerInputTextColor</key> | |
| <string>1 1 1 1</string> | |
| <key>DVTConsoleDebuggerInputTextFont</key> | |
| <string>SFMono-Bold - 12.0</string> | |
| <key>DVTConsoleDebuggerOutputTextColor</key> | |
| <string>1 1 1 1</string> |