Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove object from list #7724

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

ericjordanmossman
Copy link
Contributor

@ericjordanmossman ericjordanmossman commented Mar 28, 2022

Adds a list remove method which takes an object instead of an index.
Related: #7663

@cla-bot cla-bot bot added the cla: yes label Mar 28, 2022
*/
public func remove(_ object: Element) {
guard let index = self.index(of: object) else {
throwRealmException("Object does not exist in List") // ???: Is this too harsh? Should method just return a bool or something?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an exception much? Should nothing happen if the object isn't present?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant