You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Twitter folks,
What's your take on making this library platform-independent?
Specifically, it now relies on UIKit which prevents it from being used on macOS.
Is supporting macOS on the radar? Both UITextView and NSTextView relies on the same NSTextStorage and NSTextContainer classes so I think this should be possible without a major refactor.
Would you accept a contribution that tries to make the library work on macOS?
Cheers 👋
The text was updated successfully, but these errors were encountered:
Short answer is that we don’t have a plan to make it works on AppKit natively for now.
There are a few reasons. First, AppKit’s NSTextView and UIKit’s UITextView are both using same NSTextStorage and NSTextContainer as you mentioned, however both APIs are not same and behaviors are not same. This is because NSTextView is actually very, very old component that is built since original Nextstep era, yet also UITextView is built for touch interactions for iOS.
Another reason is that there is Mac Catalyst which allows UIKit app runs on macOS, which covers our use case of macOS support (I know that is not what you want probably, though.)
I believe, however, some techniques that Twitter Text Editor is using can be used as-is with NSTextView such as how it provides APIs to apply attributes. Therefore in future at some point, probably some potion of API set can be platform independent and can be exported from Twitter Text Editor for AppKit, like when SwiftUI API provides seamless API for both platform for example. Yet, just I think it’s not now.
niw
changed the title
One line summary of the issue
What's your take on making this library platform-independent?
Mar 21, 2021
Gotcha, thanks @niw.
I'm gonna keep fingers crossed for making libraries like this work on macOS too. In the meantime, I might play around with porting some of the functionalities to macOS. I'll let you know if I have something to share or contribute :)
Hello Twitter folks,
What's your take on making this library platform-independent?
Specifically, it now relies on UIKit which prevents it from being used on macOS.
Is supporting macOS on the radar? Both UITextView and NSTextView relies on the same NSTextStorage and NSTextContainer classes so I think this should be possible without a major refactor.
Would you accept a contribution that tries to make the library work on macOS?
Cheers 👋
The text was updated successfully, but these errors were encountered: