diff --git a/Frameworks/Account/Feed.swift b/Frameworks/Account/Feed.swift index 8a530d298..f7c42fe0d 100644 --- a/Frameworks/Account/Feed.swift +++ b/Frameworks/Account/Feed.swift @@ -12,7 +12,7 @@ import RSWeb import Articles import RSDatabase -public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable { +public final class Feed: DisplayNameProvider, Renamable, UnreadCountProvider, Hashable { private struct Key { static let url = "url" @@ -140,6 +140,12 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable { return NSLocalizedString("Untitled", comment: "Feed name") } + // MARK: - Renamable + + public func rename(to newName: String) { + editedName = newName + } + // MARK: - UnreadCountProvider public var unreadCount: Int { diff --git a/Frameworks/Account/Folder.swift b/Frameworks/Account/Folder.swift index 10e48b5f8..a20206f06 100644 --- a/Frameworks/Account/Folder.swift +++ b/Frameworks/Account/Folder.swift @@ -10,7 +10,7 @@ import Foundation import Articles import RSCore -public final class Folder: DisplayNameProvider, Container, UnreadCountProvider, Hashable { +public final class Folder: DisplayNameProvider, Renamable, Container, UnreadCountProvider, Hashable { public weak var account: Account? @@ -43,6 +43,12 @@ public final class Folder: DisplayNameProvider, Container, UnreadCountProvider, } } + // MARK: - Renamable + + public func rename(to newName: String) { + name = newName + } + // MARK: - Init init(account: Account, name: String?) {