sampettersson / placement Goto Github PK
View Code? Open in Web Editor NEWLayout protocol & ViewThatFits backport for iOS 14-15
License: MIT License
Layout protocol & ViewThatFits backport for iOS 14-15
License: MIT License
replacingUnspecifiedDimensions(by:)
A default parameter exists for replacingUnspecifiedDimensions(by:) that is not in Placement.
The default implementation of updateCache(_ cache: subviews:) should call makeCache.
Both issues are fixed in this PR
I was just investigating this library, but I am unable to access the documentation.
Has there been any consideration to expanding support to other SwiftUI platforms such as watchOS or tvOS? I have some base restructuring code that even makes projects easily maintainable and editable from Swift Playgrounds on iPad if you'd be interested.
placementLayoutValue(key: value)
does not get propagated properly to PlacementLayoutSubview
on iOS 16 when prefersLayoutProtocol
is set to false.
It seems the logic is set up to always use layoutValue(key: value)
when on iOS 16. But the retrieval of these values doesn't seem to be pulled from the same location when attached to PlacementLayoutSubview
.
first of all, I appreciate your wondrous works.
I've made a small library that lays elements out in flow.
https://github.com/FluidGroup/swiftui-WrapLayout
Then I noticed the latest version 1.5.0 that runs something different against 1.4.1.
Actually, laying out does not work correctly.
For now, it's still just head up for you. I will investigate more about what's going on inside.
Example:
Given we have a parameter columnCount
that we pass into a PlacementLayout
through init(columnCount: Int)
, I would expect the layout to invalidate and call makeCache(subviews:)
so that a cache can be made taking new parameters into consideration. Layout has this behavior but PlacementLayout does not.
AutoflowDenseGridPlacementLayout(columnCount: columnCount) {
ForEach(Array(items.enumerated()), id: \.element) { index, item in
ZStack {
Color.red
Text("\(index)")
.foregroundColor(.white)
}
.placementLayoutValue(key: PAutoflowGridItemSizeValueKey.self, value: item.size)
}
}
.padding(16)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.