surfstudio / reactivedatadisplaymanager Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Checked on Xcode 11.6
Actual result: failed with Content and frame layout guides before iOS 11.0
Expected result: build running on simulator or device
--
Possible workarounds
Content layout Guides
in Main.storyboard/StackScene/Stack/View/ScrollViewNeeds possibility to moving generator.
For example I can move generator on 5 positions.
It means that I get current position of generator, and then I increase this position on 5
I have code, that works only iOS 11+, because it uses UIContextualAction
. Maybe we should support this feature only for iOS 11+?
Add possibility to remove all cell generators from current section
At this moment possible only remove all cell generators from all sections
There isn't any example code for use.
BaseCollectionDataDisplayManager
must have open access level.
PaginableBaseTableDataDisplayManager
calls lastCellShowingEvent
for every section.
Maybe will be better to make calling lastCellShowingEvent
only for last section?
mmmm??
ReactiveStackViewDataDislay manager?
Short version of CollectionPluginsChecker looks like this:
final class CollectionPluginsChecker {
weak var delegate: CollectionDelegate?
...
func asyncCheckPlugins() {
DispatchQueue.main.async {
self.checkPlugins()
}
}
...
func checkPlugin(for generator: SelectableItem?) {
let plugin = delegate?.collectionPlugins.plugins.first(where: { $0 is CollectionSelectablePlugin })
...
guard generator != nil && plugin == nil && eventsNotEmpty else { return }
assertionFailure("❗️Include the CollectionSelectablePlugin.")
}
}
CollectionPluginsChecker has weak reference to CollectionDelegate instance, so it is possible that CollectionDelegate is already deallocated when checkPlugin()
is being called, which leads to an unexpected AssertionFailure. This situation can occur when CollectionManager is removed right after calling ddm.forceRefill()
. checkPlugins
inside forceRefill
is called asynchronously and CollectionManager with its delegate are deallocated before one of checkPlugin
calls.
The described case can be easily fixed with a strong reference to the delegate here.
Needs to proxying DataSource/TableView/ScrollView methods to events
Adds possibility to update concrete section
Add possibility to make any actions with adapter inside beginUpdate()
- endUpdate()
If I inherit class CustopTableDataDisplayManager: BaseTableDataDisplayManager
I am not able to access to tableView. And what if I want to reload one section in tableView?
Now I should do something like this
class CustopTableDataDisplayManager: BaseTableDataDisplayManager {
// MARK: - Properties
private var tableView: UITableView?
// MARK: - Initialization and deinitialization
required init(collection: UITableView) {
super.init(collection: collection)
tableView = collection
}
//MARK: - Public methods
func reloadSection(with sectionGenerator: TableHeaderGenerator) {
// ...
}
}
Maybe making tableView
property in BaseTableDataDisplayManager
: public fileprivate(set)
level of access would be better?
Now we have a problem with the number of generators if we need to create a table with a large number of cells
It seems that for CollectionBatchUpdatesAnimator
and for similar classes init-method was missed. Can you add it on next update?)
public class CollectionBatchUpdatesAnimator: Animator<UICollectionView> {
public override func perform(in collection: UICollectionView, animated: Bool, operation: () -> Void) {
if animated {
collection.performBatchUpdates(operation)
} else {
operation()
}
}
}
I think we need to change access from public
to open
in our DDMs to allow more flexible customizations
Add adapter for UICollectionView with all operations
Example:
SomeCell.color(.white).edgeInsets(.top(10), .right(16)).onAppear { }
We need to add something similar to BaseTableDataDisplayManager but only for UICollectionView
BaseGenerator should just configure cell conformable to some protocol.
For example
let generator = BaseGenerator<ShopCell>()
public protocol Configurable {
associatedtype Model
func comfigure(with model: Model)
}
Add
in TableCellGenerator.identifier
has UITableViewCell.Type
type.
But in some rare case we cant return current cell type.
May be needs to change the type to String?
Modifier
protocol has various methods with optional Animation
parameters. In its implementations Animation
becomes either UITableView.RowAnimation
or CollectionItemAnimation
.
The problem appears when using UITableView modifiers with animation parameter .none
. .none
can be treated both as Optional.none
and UITableView.RowAnimation.none
. Following IDE warning:
Even without ambiguity – it is not clear what should users choose if they need no animation - nil
or .none
.
Since UITableView.RowAnimation
already has .none
case, is it possible to make animation
parameter non-optional? In UIColectionView modifiers it can still be optional.
Problem
We are not using Event
s by its intended purpose. I haven't seen any project that uses more that one subscriber for any Event
yet.
Solution
I suggest using plain Swift closures instead.
Needs refactor existing code
Add support for extendable cells.
Extended
and Collapsed
cell statesAfter merging some old PRs tests have started to fail.
I thought the basic idea of non reusable generator was not to update the cell configuration in generate(tableView: UITableView, for indexPath: IndexPath) method , but in all NonReusableGenerators we have this. And now we have to update generator model everytime when we change smth in that cell to prevent reset data while scrolling, i don't think it should be like this.
How about removing it ?
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.