Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixHerrmann committed Jun 24, 2021
1 parent e6ed055 commit 7044aa9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ open class FHDiffableCollectionViewController<SectionIdentifierType, ItemIdentif
}

private var _supplementaryViewProvider: FHDataSource.SupplementaryViewProvider = { (collectionView, kind, indexPath) in
let reuseableHeaderView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "defaultHeader", for: indexPath)
reuseableHeaderView.backgroundColor = .systemIndigo
return reuseableHeaderView
let reusableHeaderView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "defaultHeader", for: indexPath)
reusableHeaderView.backgroundColor = .systemIndigo
return reusableHeaderView
}

private lazy var _dataSource: FHDataSource = {
Expand Down Expand Up @@ -108,7 +108,7 @@ open class FHDiffableCollectionViewController<SectionIdentifierType, ItemIdentif
/// }
/// ```
///
/// - Important: Do not forget to register the reuseable cell before the first snapshot is applied!
/// - Important: Do not forget to register the reusable cell before the first snapshot is applied!
///
/// collectionView.register(CustomCell.self, forCellReuseIdentifier: /*your identifier*/) // e.g. in viewDidLoad()
open var cellProvider: UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>.CellProvider {
Expand All @@ -124,17 +124,17 @@ open class FHDiffableCollectionViewController<SectionIdentifierType, ItemIdentif
/// ```swift
/// override var supplementaryViewProvider: UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>.SupplementaryViewProvider? {
/// return { (collectionView, kind, indexPath) in
/// let supplementaryView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: /*your identifier*/, for: indexPath) as? CustomReuseableView
/// let supplementaryView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: /*your identifier*/, for: indexPath) as? CustomReusableView
/// /*customize your supplementary view here*/
/// return supplementaryView
/// }
/// }
/// ```
///
/// - Important: Do not forget to register the reuseable view before the first snapshot is applied!
/// - Important: Do not forget to register the reusable view before the first snapshot is applied!
///
/// ```swift
/// collectionView.register(CustomReuseableView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: /*your identifier*/) // e.g. in viewDidLoad()
/// collectionView.register(CustomReusableView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: /*your identifier*/) // e.g. in viewDidLoad()
/// ```
open var supplementaryViewProvider: UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>.SupplementaryViewProvider? {
return _supplementaryViewProvider
Expand All @@ -143,7 +143,7 @@ open class FHDiffableCollectionViewController<SectionIdentifierType, ItemIdentif
/// The data source for the collection view.
///
/// Override this property only if a custom **UICollectionViewDiffableDataSource** should be applied.
/// For cell configuration overried the ``cellProvider`` property.
/// For cell configuration override the ``cellProvider`` property.
/// For supplementary view configuration override the ``supplementaryViewProvider`` property.
///
/// ```swift
Expand All @@ -166,13 +166,13 @@ open class FHDiffableCollectionViewController<SectionIdentifierType, ItemIdentif

// MARK: - Public Methods

/// This method applys a new snapshot to the collection view.
/// This method applies a new snapshot to the collection view.
///
/// This is the equivalent for `reloadData()` or `performBatchUpdates(_:)`.
///
/// - Parameters:
/// - sections: The sections for the collection view.
/// - animatingDifferences: A boolean value to deactive the animation. Default value is `true`.
/// - animatingDifferences: A boolean value to deactivate the animation. Default value is `true`.
/// - completion: The completion block for when the update is finished. Default value is `nil`.
open func applySnapshot(_ sections: [FHSection], animatingDifferences: Bool = true, completion: (() -> Void)? = nil) {
var snapshot = FHSnapshot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ open class FHDiffableTableViewController<SectionIdentifierType, ItemIdentifierTy

open override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
let sectionIdentifiers = snapshot().sectionIdentifiers
guard let sectionIdenifier = sectionIdentifiers[safe: section], sectionIdentifiers.count > 1 else {
guard let sectionIdentifier = sectionIdentifiers[safe: section], sectionIdentifiers.count > 1 else {
return nil
}
return "\(sectionIdenifier)"
return "\(sectionIdentifier)"
}
}

Expand All @@ -31,7 +31,7 @@ open class FHDiffableTableViewController<SectionIdentifierType, ItemIdentifierTy

// MARK: - Private Properties

private var _cellProvicer: FHDataSource.CellProvider = { (tableView, indexPath, itemIdentifier) in
private var _cellProvider: FHDataSource.CellProvider = { (tableView, indexPath, itemIdentifier) in
let cell = tableView.dequeueReusableCell(withIdentifier: "default", for: indexPath)
cell.textLabel?.text = "\(itemIdentifier)"
return cell
Expand All @@ -58,17 +58,17 @@ open class FHDiffableTableViewController<SectionIdentifierType, ItemIdentifierTy
/// }
/// ```
///
/// - Important: Do not forget to register the reuseable cell before the first snapshot is applied!
/// - Important: Do not forget to register the reusable cell before the first snapshot is applied!
///
/// tableView.register(CustomCell.self, forCellReuseIdentifier: /*your identifier*/) // e.g. in viewDidLoad()
open var cellProvider: UITableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>.CellProvider {
return _cellProvicer
return _cellProvider
}

/// The data source for the table view.
///
/// Override this property only if a custom **UITableViewDiffableDataSource** should be applied.
/// For cell configuration overried the ``cellProvider`` property.
/// For cell configuration override the ``cellProvider`` property.
///
/// ```swift
/// lazy var customDataSource = CustomDataSource(tableView: tableView, cellProvider: cellProvider)
Expand All @@ -86,7 +86,7 @@ open class FHDiffableTableViewController<SectionIdentifierType, ItemIdentifierTy

// MARK: - Public Methods

/// This method applys a new snapshot to the table view.
/// This method applies a new snapshot to the table view.
///
/// This is the equivalent for `reloadData()` or `performBatchUpdates(_:)`
///
Expand Down

0 comments on commit 7044aa9

Please sign in to comment.