mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-21 21:26:26 +00:00
Finalize classes
This commit is contained in:
parent
095abbeea9
commit
a4b94bf33c
30 changed files with 31 additions and 31 deletions
|
@ -3,7 +3,7 @@
|
|||
import Foundation
|
||||
import HTTP
|
||||
|
||||
public class StubbingURLProtocol: URLProtocol {
|
||||
public final class StubbingURLProtocol: URLProtocol {
|
||||
private static var targetsForURLs = [URL: Target]()
|
||||
private static var stubsForURLs = [URL: HTTPStub]()
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ private extension HTML {
|
|||
|
||||
// https://docs.joinmastodon.org/spec/activitypub/#sanitization
|
||||
|
||||
private class HTMLParser: NSObject {
|
||||
private final class HTMLParser: NSObject {
|
||||
private struct Link: Hashable {
|
||||
let href: URL
|
||||
let location: Int
|
||||
|
|
|
@ -6,7 +6,7 @@ import Mastodon
|
|||
import Secrets
|
||||
import UserNotifications
|
||||
|
||||
class NotificationService: UNNotificationServiceExtension {
|
||||
final class NotificationService: UNNotificationServiceExtension {
|
||||
|
||||
var contentHandler: ((UNNotificationContent) -> Void)?
|
||||
var bestAttemptContent: UNMutableNotificationContent?
|
||||
|
|
|
@ -27,7 +27,7 @@ public struct UserNotificationClient {
|
|||
extension UserNotificationClient {
|
||||
public static func live(_ userNotificationCenter: UNUserNotificationCenter) -> Self {
|
||||
// swiftlint:disable nesting
|
||||
class Delegate: NSObject, UNUserNotificationCenterDelegate {
|
||||
final class Delegate: NSObject, UNUserNotificationCenterDelegate {
|
||||
let subject: PassthroughSubject<DelegateEvent, Never>
|
||||
|
||||
init(subject: PassthroughSubject<DelegateEvent, Never>) {
|
||||
|
|
|
@ -42,7 +42,7 @@ extension WebAuthSession {
|
|||
}
|
||||
}
|
||||
|
||||
class WebAuthSessionContextProvider: NSObject, ASWebAuthenticationPresentationContextProviding {
|
||||
final class WebAuthSessionContextProvider: NSObject, ASWebAuthenticationPresentationContextProviding {
|
||||
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
|
||||
ASPresentationAnchor()
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
public class MockUserDefaults: UserDefaults {
|
||||
public final class MockUserDefaults: UserDefaults {
|
||||
public convenience init() {
|
||||
self.init(suiteName: Self.suiteName)!
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class MockWebAuthSession: WebAuthSession {
|
|||
}
|
||||
}
|
||||
|
||||
public class SuccessfulMockWebAuthSession: MockWebAuthSession {
|
||||
public final class SuccessfulMockWebAuthSession: MockWebAuthSession {
|
||||
private let redirectURL: URL
|
||||
|
||||
required init(
|
||||
|
@ -60,7 +60,7 @@ public class SuccessfulMockWebAuthSession: MockWebAuthSession {
|
|||
}
|
||||
}
|
||||
|
||||
public class CanceledLoginMockWebAuthSession: MockWebAuthSession {
|
||||
public final class CanceledLoginMockWebAuthSession: MockWebAuthSession {
|
||||
override var completionHandlerError: Error? {
|
||||
WebAuthSessionError(.canceledLogin)
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import CombineExpectations
|
|||
@testable import ServiceLayerMocks
|
||||
import XCTest
|
||||
|
||||
class AuthenticationServiceTests: XCTestCase {
|
||||
final class AuthenticationServiceTests: XCTestCase {
|
||||
func testAuthentication() throws {
|
||||
let sut = AuthenticationService(url: URL(string: "https://mastodon.social")!, environment: .mock())
|
||||
let authenticationRecorder = sut.authenticate().record()
|
||||
|
|
|
@ -8,7 +8,7 @@ import CombineExpectations
|
|||
import Stubbing
|
||||
import XCTest
|
||||
|
||||
class InstanceURLServiceTests: XCTestCase {
|
||||
final class InstanceURLServiceTests: XCTestCase {
|
||||
func testFiltering() throws {
|
||||
let sut = InstanceURLService(environment: .mock())
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ protocol ZoomAnimatorDelegate: class {
|
|||
func referenceViewFrameInTransitioningView(for zoomAnimator: ZoomAnimator) -> CGRect?
|
||||
}
|
||||
|
||||
class ZoomAnimator: NSObject {
|
||||
final class ZoomAnimator: NSObject {
|
||||
weak var fromDelegate: ZoomAnimatorDelegate?
|
||||
weak var toDelegate: ZoomAnimatorDelegate?
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
class ZoomDismissalInteractionController: NSObject {
|
||||
final class ZoomDismissalInteractionController: NSObject {
|
||||
var transitionContext: UIViewControllerContextTransitioning?
|
||||
var animator: UIViewControllerAnimatedTransitioning?
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
class ZoomTransitionController: NSObject {
|
||||
final class ZoomTransitionController: NSObject {
|
||||
var isInteractive = false
|
||||
|
||||
weak var fromDelegate: ZoomAnimatorDelegate?
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import AVFoundation
|
||||
import UIKit
|
||||
|
||||
class ImageNavigationController: UINavigationController {
|
||||
final class ImageNavigationController: UINavigationController {
|
||||
let transitionController = ZoomTransitionController()
|
||||
|
||||
private let imagePageViewController: ImagePageViewController
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class ImagePageViewController: UIPageViewController {
|
||||
final class ImagePageViewController: UIPageViewController {
|
||||
let imageViewControllers: [ImageViewController]
|
||||
|
||||
init(initiallyVisible: AttachmentViewModel, statusViewModel: StatusViewModel) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import Kingfisher
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class ImageViewController: UIViewController {
|
||||
final class ImageViewController: UIViewController {
|
||||
let scrollView = UIScrollView()
|
||||
let imageView = AnimatedImageView()
|
||||
let playerView = PlayerView()
|
||||
|
|
|
@ -5,7 +5,7 @@ import Foundation
|
|||
import Mastodon
|
||||
import ServiceLayer
|
||||
|
||||
final public class CollectionItemsViewModel: ObservableObject {
|
||||
public final class CollectionItemsViewModel: ObservableObject {
|
||||
@Published public var alertItem: AlertItem?
|
||||
public private(set) var nextPageMaxId: String?
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import Combine
|
||||
import ServiceLayer
|
||||
|
||||
final public class LoadMoreViewModel: ObservableObject, CollectionItemViewModel {
|
||||
public final class LoadMoreViewModel: ObservableObject, CollectionItemViewModel {
|
||||
public var direction = LoadMore.Direction.up
|
||||
@Published public private(set) var loading = false
|
||||
public let events: AnyPublisher<AnyPublisher<CollectionItemEvent, Error>, Never>
|
||||
|
|
|
@ -10,7 +10,7 @@ import ServiceLayerMocks
|
|||
@testable import ViewModels
|
||||
import XCTest
|
||||
|
||||
class AddIdentityViewModelTests: XCTestCase {
|
||||
final class AddIdentityViewModelTests: XCTestCase {
|
||||
func testAddIdentity() throws {
|
||||
let uuid = UUID(uuidString: "E621E1F8-C36C-495A-93FC-0C247A3E6E5F")!
|
||||
let environment = AppEnvironment.mock(uuid: { uuid })
|
||||
|
|
|
@ -7,7 +7,7 @@ import ServiceLayerMocks
|
|||
@testable import ViewModels
|
||||
import XCTest
|
||||
|
||||
class RootViewModelTests: XCTestCase {
|
||||
final class RootViewModelTests: XCTestCase {
|
||||
var cancellables = Set<AnyCancellable>()
|
||||
|
||||
func testAddIdentity() throws {
|
||||
|
|
|
@ -4,7 +4,7 @@ import Kingfisher
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class AccountHeaderView: UIView {
|
||||
final class AccountHeaderView: UIView {
|
||||
let headerImageView = AnimatedImageView()
|
||||
let headerButton = UIButton()
|
||||
let noteTextView = TouchFallthroughTextView()
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class AccountListCell: UITableViewCell {
|
||||
final class AccountListCell: UITableViewCell {
|
||||
var viewModel: AccountViewModel?
|
||||
|
||||
override func updateConfiguration(using state: UICellConfigurationState) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import Kingfisher
|
||||
import UIKit
|
||||
|
||||
class AccountView: UIView {
|
||||
final class AccountView: UIView {
|
||||
let avatarImageView = AnimatedImageView()
|
||||
let displayNameLabel = UILabel()
|
||||
let accountLabel = UILabel()
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class ConversationListCell: UITableViewCell {
|
||||
final class ConversationListCell: UITableViewCell {
|
||||
var viewModel: ConversationViewModel?
|
||||
|
||||
override func updateConfiguration(using state: UICellConfigurationState) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class LoadMoreCell: UITableViewCell {
|
||||
final class LoadMoreCell: UITableViewCell {
|
||||
var viewModel: LoadMoreViewModel?
|
||||
|
||||
override func updateConfiguration(using state: UICellConfigurationState) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class NotificationListCell: UITableViewCell {
|
||||
final class NotificationListCell: UITableViewCell {
|
||||
var viewModel: NotificationViewModel?
|
||||
|
||||
override func updateConfiguration(using state: UICellConfigurationState) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import AVKit
|
||||
import UIKit
|
||||
|
||||
class PlayerView: UIView {
|
||||
final class PlayerView: UIView {
|
||||
override class var layerClass: AnyClass {
|
||||
AVPlayerLayer.self
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import Mastodon
|
||||
import UIKit
|
||||
|
||||
class PollOptionButton: UIButton {
|
||||
final class PollOptionButton: UIButton {
|
||||
init(title: String, emoji: [Emoji], multipleSelection: Bool) {
|
||||
super.init(frame: .zero)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import Mastodon
|
||||
import UIKit
|
||||
|
||||
class PollResultView: UIView {
|
||||
final class PollResultView: UIView {
|
||||
private let verticalStackView = UIStackView()
|
||||
private let horizontalStackView = UIStackView()
|
||||
private let titleLabel = UILabel()
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import UIKit
|
||||
import ViewModels
|
||||
|
||||
class StatusListCell: UITableViewCell {
|
||||
final class StatusListCell: UITableViewCell {
|
||||
var viewModel: StatusViewModel?
|
||||
|
||||
override func updateConfiguration(using state: UICellConfigurationState) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
class WebfingerIndicatorView: UIVisualEffectView {
|
||||
final class WebfingerIndicatorView: UIVisualEffectView {
|
||||
private let activityIndicatorView = UIActivityIndicatorView()
|
||||
|
||||
init() {
|
||||
|
|
Loading…
Reference in a new issue