Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

set(model: , at : ) bug with zero index, added @discardableResult (CollectionSection/TableSection) #15

Closed
wow-such-amazing opened this issue Sep 11, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@wow-such-amazing
Copy link

wow-such-amazing commented Sep 11, 2018

Is it expected behaviour, that index should be greater than 0?

	public func set(model: ModelProtocol, at index: Int) -> ModelProtocol? {
		guard index > 0, index < self.models.count else { return nil }
		let oldModel = self.models[index]
		self.models[index] = model
		return oldModel
	}
@wow-such-amazing
Copy link
Author

Also probably it should have @discardableResult?

@malcommac malcommac changed the title Probably mistypo bug in set(model: , at : ) set(model: , at : ) bug with zero index, added @discardableResult (CollectionSection/TableSection) Oct 13, 2018
@malcommac malcommac self-assigned this Oct 13, 2018
@malcommac malcommac added the bug Something isn't working label Oct 13, 2018
@malcommac malcommac added this to the 0.6.1 milestone Oct 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants