Skip to content

Commit

Permalink
Removed empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Mar 1, 2024
1 parent bb0272b commit 3b7a589
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Zotero/Scenes/Detail/PDF/Views/Annotation View/AnnotationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class AnnotationView: UIView {
enum Kind {
case cell, popover
}

enum Action {
case tags
case options(UIButton?)
Expand All @@ -23,20 +23,20 @@ final class AnnotationView: UIView {
case setCommentActive(Bool)
case done
}

enum AccessibilityType {
case cell
case view
}

struct Comment {
let attributedString: NSAttributedString?
let isActive: Bool
}

private let layout: AnnotationViewLayout
let actionPublisher: PublishSubject<AnnotationView.Action>

private var header: AnnotationViewHeader!
private var topSeparator: UIView!
private var highlightContent: AnnotationViewHighlightContent?
Expand All @@ -52,9 +52,9 @@ final class AnnotationView: UIView {
var tagString: String? {
return self.tags.textLabel.text
}

// MARK: - Lifecycle

init(layout: AnnotationViewLayout, commentPlaceholder: String) {
self.layout = layout
actionPublisher = PublishSubject()
Expand All @@ -65,31 +65,31 @@ final class AnnotationView: UIView {
translatesAutoresizingMaskIntoConstraints = false
setupView(commentPlaceholder: commentPlaceholder)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: - Actions

@discardableResult
override func resignFirstResponder() -> Bool {
commentTextView.resignFirstResponder()
}

func updatePreview(image: UIImage?) {
guard let imageContent, !imageContent.isHidden else { return }
imageContent.setup(with: image)
}

private func scrollToBottomIfNeeded() {
guard let scrollView, let scrollViewContent, scrollViewContent.frame.height > scrollView.frame.height else { return }
let yOffset = scrollView.contentSize.height - scrollView.bounds.height + scrollView.contentInset.bottom
scrollView.setContentOffset(CGPoint(x: 0, y: yOffset), animated: true)
}

// MARK: - Setups

func setup(with annotation: HtmlEpubAnnotation, comment: Comment?, selected: Bool, availableWidth: CGFloat, library: Library, currentUserId: Int) {
let color = UIColor(hex: annotation.color)
let canEdit = library.metadataEditable && selected
Expand Down Expand Up @@ -332,7 +332,7 @@ final class AnnotationView: UIView {
tagsButton.rx.tap.flatMap({ Observable.just(Action.tags) }).bind(to: actionPublisher)
header.menuTap.flatMap({ Observable.just(Action.options($0)) }).bind(to: actionPublisher)
}

private func setupObserving() {
var disposables: [Disposable] = buildDisposables()
if let doneTap = header.doneTap {
Expand Down

0 comments on commit 3b7a589

Please sign in to comment.