This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor layout and fix macOS resize issue
- Loading branch information
1 parent
3e51554
commit 8281bdb
Showing
11 changed files
with
214 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
Sources/AttributedText/AttributedTextViewWrapper+AppKit.swift
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
Sources/AttributedText/AttributedTextViewWrapper+UIKit.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#if canImport(SwiftUI) && !os(watchOS) && !targetEnvironment(macCatalyst) | ||
|
||
import SwiftUI | ||
|
||
@available(macOS 11.0, iOS 14.0, tvOS 14.0, *) | ||
final class TextViewStore: ObservableObject { | ||
@Published var intrinsicContentSize: CGSize? | ||
|
||
weak var view: TextViewWrapper.View? | ||
|
||
func onContainerSizeChange(_ containerSize: CGSize?) { | ||
guard let containerSize = containerSize, | ||
let view = self.view else { return } | ||
|
||
view.maxWidth = containerSize.width | ||
} | ||
|
||
func didInvalidateIntrinsicContentSize() { | ||
guard let view = self.view else { return } | ||
|
||
intrinsicContentSize = view.intrinsicContentSize | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.