Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vision OS compile fixes #3

Merged
merged 2 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Sources/Runestone/TextView/Appearance/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,19 @@
}

public extension Theme {
#if os(visionOS)
var gutterHairlineWidth: CGFloat { 0.5 }
var pageGuideHairlineWidth: CGFloat { 0.5 }
#else
var gutterHairlineWidth: CGFloat {
1 / UIScreen.main.scale
}

var pageGuideHairlineWidth: CGFloat {
1 / UIScreen.main.scale
}

#endif

Check failure on line 82 in Sources/Runestone/TextView/Appearance/Theme.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
var markedTextBackgroundCornerRadius: CGFloat {
0
}
Expand Down
6 changes: 6 additions & 0 deletions Sources/Runestone/TextView/Core/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@
textInputView.selectedTextRange = newValue
}
}

Check failure on line 200 in Sources/Runestone/TextView/Core/TextView.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
#if !os(visionOS)
/// The custom input accessory view to display when the receiver becomes the first responder.
override public var inputAccessoryView: UIView? {
get {
Expand All @@ -214,6 +216,8 @@
override public var inputAssistantItem: UITextInputAssistantItem {
textInputView.inputAssistantItem
}
#endif

Check failure on line 220 in Sources/Runestone/TextView/Core/TextView.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
/// Returns a Boolean value indicating whether this object can become the first responder.
override public var canBecomeFirstResponder: Bool {
!textInputView.isFirstResponder && isEditable
Expand Down Expand Up @@ -606,7 +610,9 @@
#endif
private let tapGestureRecognizer = QuickTapGestureRecognizer()
private var _inputAccessoryView: UIView?
#if !os(visionOS)
private let _inputAssistantItem = UITextInputAssistantItem()
#endif
private var isPerformingNonEditableTextInteraction = false
private var delegateAllowsEditingToBegin: Bool {
guard isEditable else {
Expand Down
7 changes: 6 additions & 1 deletion Sources/Runestone/TextView/PageGuide/PageGuideView.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import UIKit

final class PageGuideView: UIView {
var hairlineWidth: CGFloat = 1 / UIScreen.main.scale {
#if os(visionOS)
var hairlineWidth: CGFloat = 0.5
#else
var hairlineWidth: CGFloat = 1 / UIScreen.main.scale {
didSet {
if hairlineWidth != oldValue {
setNeedsLayout()
}
}
}
#endif

Check failure on line 15 in Sources/Runestone/TextView/PageGuide/PageGuideView.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
var hairlineColor: UIColor? {
get {
hairlineView.backgroundColor
Expand Down
Loading