This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
Releases: 3lvis/DATASource
Releases · 3lvis/DATASource
DATASource — 5.5.0
Added support for custom headers: #45
More information was added in the documentation: https://github.com/3lvis/DATASource#custom-headers
DATASource — 5.4.0
Added additional delete to DATASourceDelegate
to be notified when changes finish. Useful to check if your UITableView or UICollectionView is empty.
optional func dataSourceDidChangeContent(dataSource: DATASource)
Kicking ass addition by @guilhermekrz! #44
DATASource — 5.3.0
func dataSource(dataSource: DATASource, collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath, withTitle title: AnyObject?) -> UICollectionReusableView?
Now returns AnyObject
instead of String, since sectionName
could be anything, not just strings.
DATASource — 5.2.0
- Improved Collection view grouping, before when providing a
sectionName
the sorting would always be ascending. Now the sorting gets taken from the provided sort descriptors (this is also best practice). #40
DATASource — 5.1.0
- Improved the delegate method that provides custom collection view headers to provide the title for the section.
Before
optional func dataSource(dataSource: DATASource, collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView
After
optional func dataSource(dataSource: DATASource, collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath, withTitle title: String) -> UICollectionReusableView
As a result the before method has been deprecated.
DATASource — 5.0.3
- Improve safety on
objectAtIndexPath
DATASource — 5.0.2
- Improve support for disabling section indexes
- Fixed a typo where a protocol would say DATASource instead of DataSource
5.0.1
- Added support for tvOS
Previously on 5.0.0
- Rewritten in Swift, this has improved Swift compatibility by 78%*
Breaking changes
- Moved parameters so it's more consistent
init(tableView: UITableView, fetchRequest: NSFetchRequest, mainContext: NSManagedObjectContext, sectionName: String? = default, configuration: (cell: UITableViewCell, item: NSManagedObject, indexPath: NSIndexPath) -> (), cellIdentifier: (indexPath: NSIndexPath) -> (String))
init(collectionView: UICollectionView, fetchRequest: NSFetchRequest, mainContext: NSManagedObjectContext, sectionName: String? = default, configuration: (cell: UICollectionViewCell, item: NSManagedObject, indexPath: NSIndexPath) -> (), cellIdentifier: (indexPath: NSIndexPath) -> (String))
- Made fetchedResultsController private, added convenience methods to access its data
var objectsCount: Int { get }
var isEmpty: Bool { get }
var objects: [NSManagedObject] { get }
func objectAtIndexPath(indexPath: NSIndexPath) -> NSManagedObject?
func indexPathForObject(object: NSManagedObject) -> NSIndexPath?
func fetch()
Example:
if self.dataSource.isEmpty {
// Is empty, do something
}
- Random number, made up. I know Swift compatibility is better but I don't know for how much 😊
Swift release
- Rewritten in Swift, this has improved Swift compatibility by 78%*
Breaking changes
- Moved parameters so it's more consistent
init(tableView: UITableView, fetchRequest: NSFetchRequest, mainContext: NSManagedObjectContext, sectionName: String? = default, configuration: (cell: UITableViewCell, item: NSManagedObject, indexPath: NSIndexPath) -> (), cellIdentifier: (indexPath: NSIndexPath) -> (String))
init(collectionView: UICollectionView, fetchRequest: NSFetchRequest, mainContext: NSManagedObjectContext, sectionName: String? = default, configuration: (cell: UICollectionViewCell, item: NSManagedObject, indexPath: NSIndexPath) -> (), cellIdentifier: (indexPath: NSIndexPath) -> (String))
- Made fetchedResultsController private, added convenience methods to access its data
var objectsCount: Int { get }
var isEmpty: Bool { get }
var objects: [NSManagedObject] { get }
func objectAtIndexPath(indexPath: NSIndexPath) -> NSManagedObject?
func indexPathForObject(object: NSManagedObject) -> NSIndexPath?
func fetch()
Example:
if self.dataSource.isEmpty {
// Is empty, do something
}
- Random number, made up. I know Swift compatibility is better but I don't know for how much 😊
DATASource — 4.0.1
- Indexed list wasn't been sorted correctly, and it wasn't respecting special characters #24
Previously on 4.0.0
- Added support for indexed TableViews and CollectionViews! Just like the Contacts.app. You just need to add the used CoreData attribute as
sectionName
in your initalizer. Take a look at the Demos for examples. - [BREAKING CHANGE]: Also we improved the
DATASourceDelegate
methods to be consistent with Apple's Coding Guidelines. - [BREAKING CHANGE]: Removed deprecated methods