Remove unused source files
Signed-off-by: Brentley Jones <github@brentleyjones.com>
This commit is contained in:
parent
10aa700e88
commit
44649cc672
|
@ -1,12 +0,0 @@
|
||||||
// Generated using Sourcery 1.6.1 — https://github.com/krzysztofzablocki/Sourcery
|
|
||||||
// DO NOT EDIT
|
|
||||||
// sourcery:inline:NotificationTableViewCellDelegate.AutoGenerateProtocolDelegate
|
|
||||||
notificationView(_ notificationView: NotificationView, menuButton button: UIButton, didSelectAction action: NotificationView.AuthorMenuAction, menuContext: NotificationView.AuthorMenuContext)
|
|
||||||
notificationView(_ notificationView: NotificationView, statusView: StatusView, authorAvatarButtonDidPressed button: AvatarButton)
|
|
||||||
notificationView(_ notificationView: NotificationView, statusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta)
|
|
||||||
notificationView(_ notificationView: NotificationView, statusView: StatusView, actionToolbarContainer: ActionToolbarContainer, buttonDidPressed button: UIButton, action: ActionToolbarContainer.Action)
|
|
||||||
notificationView(_ notificationView: NotificationView, quoteStatusView: StatusView, authorAvatarButtonDidPressed button: AvatarButton)
|
|
||||||
notificationView(_ notificationView: NotificationView, quoteStatusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta)
|
|
||||||
// sourcery:end
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
// Generated using Sourcery 1.6.1 — https://github.com/krzysztofzablocki/Sourcery
|
|
||||||
// DO NOT EDIT
|
|
||||||
// sourcery:inline:NotificationViewContainerTableViewCell.AutoGenerateProtocolRelayDelegate
|
|
||||||
func notificationView(_ notificationView: NotificationView, menuButton button: UIButton, didSelectAction action: NotificationView.AuthorMenuAction, menuContext: NotificationView.AuthorMenuContext) {
|
|
||||||
notificationView(notificationView, menuButton: button, didSelectAction: action, menuContext: menuContext)
|
|
||||||
}
|
|
||||||
|
|
||||||
func notificationView(_ notificationView: NotificationView, statusView: StatusView, authorAvatarButtonDidPressed button: AvatarButton) {
|
|
||||||
notificationView(notificationView, statusView: statusView, authorAvatarButtonDidPressed: button)
|
|
||||||
}
|
|
||||||
|
|
||||||
func notificationView(_ notificationView: NotificationView, statusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta) {
|
|
||||||
notificationView(notificationView, statusView: statusView, metaText: metaText, didSelectMeta: meta)
|
|
||||||
}
|
|
||||||
|
|
||||||
func notificationView(_ notificationView: NotificationView, statusView: StatusView, actionToolbarContainer: ActionToolbarContainer, buttonDidPressed button: UIButton, action: ActionToolbarContainer.Action) {
|
|
||||||
notificationView(notificationView, statusView: statusView, actionToolbarContainer: actionToolbarContainer, buttonDidPressed: button, action: action)
|
|
||||||
}
|
|
||||||
|
|
||||||
func notificationView(_ notificationView: NotificationView, quoteStatusView: StatusView, authorAvatarButtonDidPressed button: AvatarButton) {
|
|
||||||
notificationView(notificationView, quoteStatusView: quoteStatusView, authorAvatarButtonDidPressed: button)
|
|
||||||
}
|
|
||||||
|
|
||||||
func notificationView(_ notificationView: NotificationView, quoteStatusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta) {
|
|
||||||
notificationView(notificationView, quoteStatusView: quoteStatusView, metaText: metaText, didSelectMeta: meta)
|
|
||||||
}
|
|
||||||
|
|
||||||
// sourcery:end
|
|
||||||
|
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
// Generated using Sourcery 1.9.2 — https://github.com/krzysztofzablocki/Sourcery
|
|
||||||
// DO NOT EDIT
|
|
||||||
|
|
||||||
// sourcery:inline:DiscoveryCommunityViewController.AutoGenerateTableViewDelegate
|
|
||||||
|
|
||||||
// Generated using Sourcery
|
|
||||||
// DO NOT EDIT
|
|
||||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
||||||
aspectTableView(tableView, didSelectRowAt: indexPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
|
|
||||||
return aspectTableView(tableView, contextMenuConfigurationForRowAt: indexPath, point: point)
|
|
||||||
}
|
|
||||||
|
|
||||||
func tableView(_ tableView: UITableView, previewForHighlightingContextMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview? {
|
|
||||||
return aspectTableView(tableView, previewForHighlightingContextMenuWithConfiguration: configuration)
|
|
||||||
}
|
|
||||||
|
|
||||||
func tableView(_ tableView: UITableView, previewForDismissingContextMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview? {
|
|
||||||
return aspectTableView(tableView, previewForDismissingContextMenuWithConfiguration: configuration)
|
|
||||||
}
|
|
||||||
|
|
||||||
func tableView(_ tableView: UITableView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
|
|
||||||
aspectTableView(tableView, willPerformPreviewActionForMenuWith: configuration, animator: animator)
|
|
||||||
}
|
|
||||||
// sourcery:end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
//
|
|
||||||
// DiscoveryCommunityViewViewModel.swift
|
|
||||||
// Mastodon
|
|
||||||
//
|
|
||||||
// Created by MainasuK on 2022-4-29.
|
|
||||||
//
|
|
||||||
|
|
||||||
import os.log
|
|
||||||
import UIKit
|
|
||||||
import Combine
|
|
||||||
import GameplayKit
|
|
||||||
import CoreData
|
|
||||||
import CoreDataStack
|
|
||||||
import MastodonSDK
|
|
||||||
|
|
||||||
final class DiscoveryCommunityViewViewModel {
|
|
||||||
|
|
||||||
let logger = Logger(subsystem: "DiscoveryCommunityViewViewModel", category: "ViewModel")
|
|
||||||
|
|
||||||
var disposeBag = Set<AnyCancellable>()
|
|
||||||
|
|
||||||
// input
|
|
||||||
let context: AppContext
|
|
||||||
let viewDidAppeared = PassthroughSubject<Void, Never>()
|
|
||||||
let statusFetchedResultsController: StatusFetchedResultsController
|
|
||||||
|
|
||||||
// output
|
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
|
||||||
private(set) lazy var stateMachine: GKStateMachine = {
|
|
||||||
let stateMachine = GKStateMachine(states: [
|
|
||||||
State.Initial(viewModel: self),
|
|
||||||
State.Reloading(viewModel: self),
|
|
||||||
State.Fail(viewModel: self),
|
|
||||||
State.Idle(viewModel: self),
|
|
||||||
State.Loading(viewModel: self),
|
|
||||||
State.NoMore(viewModel: self),
|
|
||||||
])
|
|
||||||
stateMachine.enter(State.Initial.self)
|
|
||||||
return stateMachine
|
|
||||||
}()
|
|
||||||
|
|
||||||
let didLoadLatest = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
init(context: AppContext) {
|
|
||||||
self.context = context
|
|
||||||
self.statusFetchedResultsController = StatusFetchedResultsController(
|
|
||||||
managedObjectContext: context.managedObjectContext,
|
|
||||||
domain: nil,
|
|
||||||
additionalTweetPredicate: nil
|
|
||||||
)
|
|
||||||
// end init
|
|
||||||
|
|
||||||
context.authenticationService.activeMastodonAuthentication
|
|
||||||
.map { $0?.domain }
|
|
||||||
.assign(to: \.value, on: statusFetchedResultsController.domain)
|
|
||||||
.store(in: &disposeBag)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
deinit {
|
|
||||||
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
//
|
|
||||||
// DiscoveryCommunityViewModel.swift
|
|
||||||
// Mastodon
|
|
||||||
//
|
|
||||||
// Created by MainasuK on 2022-4-29.
|
|
||||||
//
|
|
||||||
|
|
||||||
import os.log
|
|
||||||
import UIKit
|
|
||||||
import Combine
|
|
||||||
import GameplayKit
|
|
||||||
import CoreData
|
|
||||||
import CoreDataStack
|
|
||||||
import MastodonSDK
|
|
||||||
|
|
||||||
final class DiscoveryCommunityViewModel {
|
|
||||||
|
|
||||||
let logger = Logger(subsystem: "DiscoveryCommunityViewModel", category: "ViewModel")
|
|
||||||
|
|
||||||
var disposeBag = Set<AnyCancellable>()
|
|
||||||
|
|
||||||
// input
|
|
||||||
let context: AppContext
|
|
||||||
let viewDidAppeared = PassthroughSubject<Void, Never>()
|
|
||||||
let statusFetchedResultsController: StatusFetchedResultsController
|
|
||||||
|
|
||||||
// output
|
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
|
||||||
private(set) lazy var stateMachine: GKStateMachine = {
|
|
||||||
let stateMachine = GKStateMachine(states: [
|
|
||||||
State.Initial(viewModel: self),
|
|
||||||
State.Reloading(viewModel: self),
|
|
||||||
State.Fail(viewModel: self),
|
|
||||||
State.Idle(viewModel: self),
|
|
||||||
State.Loading(viewModel: self),
|
|
||||||
State.NoMore(viewModel: self),
|
|
||||||
])
|
|
||||||
stateMachine.enter(State.Initial.self)
|
|
||||||
return stateMachine
|
|
||||||
}()
|
|
||||||
|
|
||||||
let didLoadLatest = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
init(context: AppContext) {
|
|
||||||
self.context = context
|
|
||||||
self.statusFetchedResultsController = StatusFetchedResultsController(
|
|
||||||
managedObjectContext: context.managedObjectContext,
|
|
||||||
domain: nil,
|
|
||||||
additionalTweetPredicate: nil
|
|
||||||
)
|
|
||||||
// end init
|
|
||||||
|
|
||||||
context.authenticationService.activeMastodonAuthentication
|
|
||||||
.map { $0?.domain }
|
|
||||||
.assign(to: \.value, on: statusFetchedResultsController.domain)
|
|
||||||
.store(in: &disposeBag)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
deinit {
|
|
||||||
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
//
|
|
||||||
// MastodonRegisterViewModel+Diffable.swift
|
|
||||||
// Mastodon
|
|
||||||
//
|
|
||||||
// Created by MainasuK on 2022-1-5.
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
|
||||||
import Combine
|
|
||||||
import MastodonAsset
|
|
||||||
import MastodonLocalization
|
|
||||||
|
|
||||||
extension MastodonRegisterViewModel {
|
|
||||||
private func configureAvatar(cell: MastodonRegisterAvatarTableViewCell) {
|
|
||||||
self.$avatarImage
|
|
||||||
.receive(on: DispatchQueue.main)
|
|
||||||
.sink { [weak self, weak cell] image in
|
|
||||||
guard let self = self else { return }
|
|
||||||
guard let cell = cell else { return }
|
|
||||||
let image = image ?? Asset.Scene.Onboarding.avatarPlaceholder.image
|
|
||||||
cell.avatarButton.setImage(image, for: .normal)
|
|
||||||
cell.avatarButton.menu = self.createAvatarMediaContextMenu()
|
|
||||||
cell.avatarButton.showsMenuAsPrimaryAction = true
|
|
||||||
}
|
|
||||||
.store(in: &cell.disposeBag)
|
|
||||||
}
|
|
||||||
|
|
||||||
private func configureTextFieldCell(
|
|
||||||
cell: MastodonRegisterTextFieldTableViewCell,
|
|
||||||
validateState: Published<ValidateState>.Publisher
|
|
||||||
) {
|
|
||||||
Publishers.CombineLatest(
|
|
||||||
validateState,
|
|
||||||
cell.textField.publisher(for: \.isFirstResponder)
|
|
||||||
)
|
|
||||||
.receive(on: DispatchQueue.main)
|
|
||||||
.sink { [weak cell] validateState, isFirstResponder in
|
|
||||||
guard let cell = cell else { return }
|
|
||||||
switch validateState {
|
|
||||||
case .empty:
|
|
||||||
cell.textFieldShadowContainer.shadowColor = isFirstResponder ? Asset.Colors.brandBlue.color : .black
|
|
||||||
cell.textFieldShadowContainer.shadowAlpha = isFirstResponder ? 1 : 0.25
|
|
||||||
case .valid:
|
|
||||||
cell.textFieldShadowContainer.shadowColor = Asset.Colors.TextField.valid.color
|
|
||||||
cell.textFieldShadowContainer.shadowAlpha = 1
|
|
||||||
case .invalid:
|
|
||||||
cell.textFieldShadowContainer.shadowColor = Asset.Colors.TextField.invalid.color
|
|
||||||
cell.textFieldShadowContainer.shadowAlpha = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.store(in: &cell.disposeBag)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
//
|
|
||||||
// MediaView+Configuration.swift
|
|
||||||
// Mastodon
|
|
||||||
//
|
|
||||||
// Created by MainasuK on 2022-1-12.
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
|
||||||
import Combine
|
|
||||||
import CoreDataStack
|
|
||||||
import MastodonUI
|
|
||||||
import AlamofireImage
|
|
||||||
|
|
||||||
extension MediaView {
|
|
||||||
public static func configuration(status: Status) -> [MediaView.Configuration] {
|
|
||||||
func videoInfo(from attachment: MastodonAttachment) -> MediaView.Configuration.VideoInfo {
|
|
||||||
MediaView.Configuration.VideoInfo(
|
|
||||||
aspectRadio: attachment.size,
|
|
||||||
assetURL: attachment.assetURL,
|
|
||||||
previewURL: attachment.previewURL,
|
|
||||||
durationMS: attachment.durationMS
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
let status = status.reblog ?? status
|
|
||||||
let attachments = status.attachments
|
|
||||||
let configurations = attachments.map { attachment -> MediaView.Configuration in
|
|
||||||
let configuration: MediaView.Configuration = {
|
|
||||||
switch attachment.kind {
|
|
||||||
case .image:
|
|
||||||
let info = MediaView.Configuration.ImageInfo(
|
|
||||||
aspectRadio: attachment.size,
|
|
||||||
assetURL: attachment.assetURL
|
|
||||||
)
|
|
||||||
return .init(
|
|
||||||
info: .image(info: info),
|
|
||||||
blurhash: attachment.blurhash
|
|
||||||
)
|
|
||||||
case .video:
|
|
||||||
let info = videoInfo(from: attachment)
|
|
||||||
return .init(
|
|
||||||
info: .video(info: info),
|
|
||||||
blurhash: attachment.blurhash
|
|
||||||
)
|
|
||||||
case .gifv:
|
|
||||||
let info = videoInfo(from: attachment)
|
|
||||||
return .init(
|
|
||||||
info: .gif(info: info),
|
|
||||||
blurhash: attachment.blurhash
|
|
||||||
)
|
|
||||||
case .audio:
|
|
||||||
let info = videoInfo(from: attachment)
|
|
||||||
return .init(
|
|
||||||
info: .video(info: info),
|
|
||||||
blurhash: attachment.blurhash
|
|
||||||
)
|
|
||||||
} // end switch
|
|
||||||
}()
|
|
||||||
|
|
||||||
configuration.load()
|
|
||||||
configuration.isReveal = status.isMediaSensitive ? status.isSensitiveToggled : true
|
|
||||||
|
|
||||||
return configuration
|
|
||||||
}
|
|
||||||
|
|
||||||
return configurations
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue