Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcoboerner/openswiftuiviews
Layout, drag and drop, scroll, relative positioning features and more that SwiftUI is missing
https://github.com/marcoboerner/openswiftuiviews
clipping coordinate-transformations drag-and-drop gestures ios relative-position scrollview swift swiftui
Last synced: about 2 months ago
JSON representation
Layout, drag and drop, scroll, relative positioning features and more that SwiftUI is missing
- Host: GitHub
- URL: https://github.com/marcoboerner/openswiftuiviews
- Owner: marcoboerner
- License: mit
- Created: 2022-03-01T22:55:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-23T16:22:07.000Z (about 1 year ago)
- Last Synced: 2023-10-23T17:31:37.169Z (about 1 year ago)
- Topics: clipping, coordinate-transformations, drag-and-drop, gestures, ios, relative-position, scrollview, swift, swiftui
- Language: Swift
- Homepage:
- Size: 258 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenSwiftUIViews
## This repository is a work in progress and should not be used directly yet.
### You can clone, fork, or copy parts of the code and make it work for your projects. Feedback, bug reports or pull requests, any sort of collaboration efforts are welcome. Once again:
* I do not recommend using it as a direct dependency
* The code will have bugs
* Using it as it is might cause unexpected behaviors
* I'm constantly changing it while developing another project
* Every change might be a breaking change, even bug fixes
* There are no tests
* The example app might not have example for all and is not always updated when the package changes
* This help file might not be up to date either## Other than that I'm developing this package to implement some of the features I'm missing in SwiftUI the most or that are not implemented the way I find them useful.
### OpenScrollView
#### As of early 2023 I recommend in most cases the native scroll view and scroll view reader with the UIKit scroll view override. See the example app for a basic implementation. Using simultaneous gestures, it seems other gestures (Not currently in the example app) or the scrolling are also no longer blocked if you use the right combination of gestures in recent iOS versions.
A _non gesture blocking_, _non clipping by default_ custom scroll view implementation with example code.
This is an attempt for a custom scroll view in SwiftUI that will not block other gestures or be blocked by other gestures unless specified with a view modifier. I tried to implement some of the other scroll view features like a scroll view reader and proxy as well.
Ideally I'd like to find a way to use this view together with the regular ScrollView reader but I wasn't able to figure out the internals of it to make it work.
It does work for my purposes but could probably be extended and made more generic and simplified.
[Related questions and answer on Stack Overflow](https://stackoverflow.com/a/64592385/12764795)
### OpenDragAndDrop
Similar to the drag and drop capabilities that SwiftUI provides but only meant for within the app. Allowing views to be dragged and dropped with drop detection and an attached dragged object.
### OpenAlignView
#### Introduced at WWDC 2022, there is now also a native version for that.
Allows to align the size of the frames of _multiple_ views from multiple stacks in rows and cols.
### OpenAlignOffset
#### Introduced at WWDC 2022, there is now also a native version for that.
Aligns the offset of _multiple_ views organized in rows and cols, aligning both axes.
### OpenRelativePosition and OpenRelativeOffset
Both allow the positioning of a view in another coordinate system. Relative position is using an internal position modifier, relative offset using an internal offset modifier.
[Related questions and answer on Stack Overflow](https://stackoverflow.com/a/65584150/12764795)