Comments (5)
I like that idea quite a bit.
I would suggest hacking and sending a pull request, code is always better than a suggestion 😄
from mantle.
I'm playing with this and a few other additions in a project I'm working on. I'll see how well they stand up to use, and if they work OK I'll look into contributing.
from mantle.
Exactly the reason a pull request is always preferred.
I'm going to close this in the anticipation of a future pull request. Would love to see what you come up with!
from mantle.
I know this just got closed, but if a pull request is going to be created, I suggest the method be made inverse. Perhaps MTLModel
can provide (NSSet *)propertyKeysForEquality
that subclasses can override to remove elements that aren't desired for equality testing.
from mantle.
I think this should be handled with an application-level override of -isEqual:
, since we could go on forever about all the different ways that people would like to override MTLModel
's default behaviors. Subclassing and overriding works quite well, and generally reduces the complexity of the MTLModel
interface.
Suppose I have some properties that hold cached data — stuff that can be derived but at a time penalty, so I'm cacheing it in the model. I'd like to exclude such properties from equality calculations.
In this particular case, it sounds like you would want to exclude those properties from most things, including copying and archiving. That can be done with a +propertyKeys
override.
from mantle.
Related Issues (20)
- Potential leak of memory reported by Xcode static analysis HOT 1
- FR: Add xcframework in a zip file in tag version on github HOT 1
- Map multiple json field when key name is same HOT 2
- Parsing array with objects of different subclasses
- FR: Add precompiled xcframework in assets. HOT 4
- fix build for Xcode 12.5 HOT 1
- Document is so difficult to understand and still so complex to use HOT 2
- Should auto transform json value type to property type without create transformer HOT 2
- JsonToModel error HOT 2
- The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. HOT 9
- Getting crash in iOS 15
- Can't install version 2.2.0 using pods HOT 7
- Handling null values when mapping to a BOOL property HOT 4
- Mantle crashes on iOS 16 due to WorkflowKit containing an unprefixed Mantle copy HOT 6
- strncpy code security issue HOT 2
- Error when activating code coverage HOT 2
- dSYM files of Mantle HOT 3
- Redefinition of enumerator 'MTLModelEncodingBehaviorExcluded' HOT 1
- Excuse me. Is there any plan to release the next release? When is the release planned? HOT 1
- Support the optional property attributes in mtl_copyPropertyAttributes HOT 1
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.
from mantle.