tablemanager's People
tablemanager's Issues
Come fare un update condizionale?
TableManager/TableManager/ViewController.swift
Lines 79 to 84 in 391a6d7
Questa soluzione funziona molto bene in questo caso specifico. Non mi sembra però opportuno che sia il metodo populateTable
a decidere quale cella aggiornare, solitamente questa logica nasce da altre parti del codice. Immagina che dovrà esserci qualche altro parametro passato al metodo, per decidere chi/quando aggiornare.
TableManager/TableManager/Protocols/Protocols.swift
Lines 17 to 39 in 391a6d7
Visto che c'ero ho racchiuso un po' di logica per generare un IndexPath
a partire da un elemento all'interno del dataSource
Codice duplicato per passare informazioni da Controller a Cell
TableManager/TableManager/Cells/Field/CellField.swift
Lines 42 to 50 in 391a6d7
Introducendo il CellManager
è necessario duplicare le proprietà che il ViewController
passa alla Cell
. C'è sempre una sorta di codice duplicato tra Manager
e Cell
, mentre prima il ViewController
passava direttamente queste informazioni alla Cell
Il Manager deve "auto aggiornarsi"
TableManager/TableManager/Cells/Field/CellField.swift
Lines 61 to 71 in 391a6d7
Il Manager
non può limitarsi a passare i valori dalla Cell
al Controller
, ma deve anche preoccuparsi di mantenersi aggiornato. Questo succede perché il valore originale, disponibile nell'oggetto User
è disaccoppiato dal valore memorizzato nel Manager
.
Ho provato a passare tutto l'oggetto User
ma andrebbe implementata una logica ulteriore per individuare la proprietà da considerare. Inoltre questa Cell
generica non sarebbe poi adatta ad altri tipi di oggetti, in quanto accoppiata fortemente con User
.
Ho provato anche con protocolli/subclass, ma passare il nome del parametro tramite String
proprio non mi piace.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.