Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Releases: yurii-lysytsia/AirCollection

v 1.5.0

25 Oct 15:44
d59ae39
Compare
Choose a tag to compare

Notes

Added selectable and highlightable protocols to modify appearance when state did change (but implemented only for UITableViewCell and UICollectionViewCell. Create your own realisation if you would like implement it to another view). Also added protocol to implementing UIRefreshControl for UIScrollView and children (e.g. UITableView or UICollectionView)

Reusable view

  • Added HighlightableView for views that need observe highlight state;
  • Added SelectableView for views that need observe selection state;

Scroll view

  • Added ScrollRefreshControllerProtocol and ScrollRefreshPresenterProtocol for implementation UIRefreshControl.

Table view

  • Modified TableViewPresenterProtocol. Added tableRowShouldHighlight, tableDidHighlight, tableDidUnhighlight and tableRowShouldSelect delegate methods.

Collection view

  • Modified CollectionViewPresenterProtocol. Added collectionItemShouldHighlight, collectionItemDidHighlight, collectionItemDidUnhighlightItem and collectionItemShouldSelect delegate methods.

v 1.4.1

24 Oct 11:04
65858eb
Compare
Choose a tag to compare

Notes

Modified interaction with the UITextField and UITextView inside table view or collection view cells. It's easy to use with just a few lines of code now. Also you can modify it as you wish because it protocol.

Common

ReusableView

Features

  • Added TextFieldConfiguration for easy configure reusable view and TextFieldDelegate that replace original UITextFieldDelegate for convenient implementation;
  • Added child TextFieldPickerViewConfiguration that implement for text field which use UIPickerView instead keyboard;
  • Added child TextFieldPickerViewConfiguration that implement for text field which use UIPickerView instead keyboard. Also added TextFieldPickerViewDataSource and TextFieldPickerViewDelegate for it;
  • Added child TextFieldDatePickerConfiguration that implement for text field which use UIDatePicker instead keyboard. Also added TextFieldDatePickerDelegate for it;
  • Added TextFieldControllerProtocol for view and TextFieldPresenterProtocol for presenter. This will help use delegate by presenter without additional code;
  • Added TextViewConfiguration for easy configure reusable view and TextViewDelegate that replace original UITextViewDelegate for convenient implementation;
  • Added TextViewControllerProtocol for view and TextViewPresenterProtocol for presenter. This will help use delegate by presenter without additional code;

Refactoring

  • Fully refactored realisation of IdentificableView, NibLoadableView, ConfigurableView, ModelConfigurableView and their child protocols. Also added documentation for each method or property. Caution! ConfigurableView and NibLoadableView protocols no longer implement IdentificableView protocol so you need implement it manually;

Fixes

  • Text field UIDatePicker presentation style for iOS 14+;
  • Crash when one table or collection view cell used many different configuration of text field;

Table view

Features

  • Added default protocols method realisation for TableViewPresenterProtocol that implemented with TextFieldPresenterProtocol, DatePickerPresenterProtocol, PickerViewPresenterProtocol or TextViewControllerProtocol;
  • Added becomeTableViewRowFirstResponder(at:) and resignTableViewRowFirstResponder(at:) for collection view where cells is InputConfigurableView;

Fixes

  • Table view reusable header or footer view dynamic height dimension;

Deprecated

  • Removed forwardTableViewDelegate(). It called automatically when you call configureTableView(configurator:);

Collection view

Features

  • Added default protocols method realisation for CollectionViewPresenterProtocol that implemented with TextFieldPresenterProtocol, DatePickerPresenterProtocol, PickerViewPresenterProtocol or TextViewControllerProtocol;
  • Added indexPath(forSupplementaryView:,of:) method for gets index path for section header or footer;
  • Added becomeCollectionViewRowFirstResponder(at:) and resignCollectionViewRowFirstResponder(at:) for collection view where cells is InputConfigurableView;

Deprecated

  • Removed forwardCollectionViewDelegate(). It called automatically when you call configureCollectionView(configurator:);

v 1.4.0

20 Sep 19:52
Compare
Choose a tag to compare

Notes

Created new protocols for implementing text fields inside reusable view. Also added text field support for picker view and date picker instead keyboard

ReusableView

Features

  • Added new TextInputConfiguration and TextInputConfigurableModel instead InputModelConfigurableProtocol that implement only one property instead two
  • Added new TextInputConfigurableView instead InputModelConfigurableView. Now it's more agile and require to implement new protocols
  • Added TextFieldConfiguration instead TextFieldInputModelConfiguration
  • Added TextFieldPickerViewConfiguration that implement reusable view with text field where will be picker view instead keyboard
  • Added TextFieldDatePickerConfiguration that implement reusable view with text field where will be date picker instead keyboard
  • Added PickerViewControllerProtocol and DatePickerControllerProtocol for implementation to view controller
  • Added PickerViewPresenterProtocol and DatePickerPresenterProtocol for implementation to presenter

Fixed

  • Some fixes for TextViewInputModelConfigurable

TableView

Features

  • TableViewControllerProtocol support new text field protocols

CollectionView

Features

  • CollectionViewControllerProtocol support new text field protocols

v 1.3.1

14 Sep 18:13
ceacce1
Compare
Choose a tag to compare

Collection View

Renamed

  • UICollectionView.ElementKindSection has been renamed to CollectionViewElementKindSection

Fixes

  • Fixed collection view cell size calculating bug when CollectionViewItemSize.flexible

Features

  • Added new CollectionViewItemSize
/// Item width will calculate relative height or height will calculated relative widht multiplier. Don't use for both because it will fatal error.
case aspectRatio(multiplier: CGFloat)
  • Added two new already done scheme for CollectionViewItemSize
/// Flixible collection view items size. Size for item will be calulated automatically based on collection view width, items per row and aspect ratio. Than save to cache. Item width will be equal to collection view width minus left and right insets, interitem spacing and devided to items per row. Item height will be equal to item width multiply aspect ratio.
public static func flexibleHorizontallyItems(itemsPerRow: CGFloat, heightAspectRatioMultiplier: CGFloat) -> CollectionViewItemSize {
    return CollectionViewItemSize(width: .fillEquall(items: itemsPerRow), height: .aspectRatio(multiplier: heightAspectRatioMultiplier))
}
    
/// Flixible collection view items size. Size for item will be calulated automatically based on collection view height, items per row and aspect ratio. Than save to cache. Item height will be equal to collection view height minus top and bottom insets, line spacing and devided to items per row. Item width will be equal to item height multiply aspect ratio.
public static func flexibleVerticallyItems(itemsPerRow: CGFloat, widthAspectRatioMultiplier: CGFloat)  -> CollectionViewItemSize {
    return CollectionViewItemSize(width: .aspectRatio(multiplier: widthAspectRatioMultiplier), height: .fillEquall(items: itemsPerRow))
}

v 1.3.0

09 Sep 22:34
dab330a
Compare
Choose a tag to compare

TableView

Renamed

  • UITableView.RowHeight has been renamed to TableViewRowHeight
  • UITableView.ViewHeight has been renamed to TableViewHeaderFooterViewHeight

Fixes

  • Fixed bug when multiple times called updateTableView method and application terminate

Features

  • Added func updateTableView(deletions: [Int], insertions: [Int], modifications: [Int], forSection section: Int, with animation: UITableView.RowAnimation, completion: ((Bool) -> Void)?)for convenient way to update rows when Realm observer notify about changes
  • Added func indexPathForRow(with view: UIView) -> IndexPath? for convenient get IndexPath for subview of UITableViewCell

CollectionView

Renamed

  • UICollectionView.ItemSize has been renamed to CollectionViewItemSize
  • UICollectionView.ViewHeight has been renamed to CollectionViewSupplementaryViewHeight

Refactored

  • CollectionViewItemSize has been fully changed. Now it's a struct instead enum which contains width and height distribution for full customisation. Also contains some already done presets.
  • Added reusable items cache for more optimised calculating dynamic size

Fixes

  • Fixed bug when multiple times called updateCollectionView method and application terminate

Features

  • Added func updateCollectionView(deletions: [Int], insertions: [Int], modifications: [Int], forSection section: Int, completion: ((Bool) -> Void)?) for convenient way to update items when Realm observer notify about changes
  • Added func indexPathForItem(with view: UIView) -> IndexPath? for convenient get IndexPath for subview of UICollectionViewCell

v 1.2.0

03 Aug 10:47
Compare
Choose a tag to compare
  • Added dynamic size cache for collection view
  • Added new collection view item size preferences

v 1.1.0

30 Jul 20:33
Compare
Choose a tag to compare
  • Added TableViewDelegate
  • Added table view dynamic height

v 1.0.0

28 Jul 13:38
Compare
Choose a tag to compare
  • TableViewData
  • TableViewControllerProtocol
  • TableViewPresenterProtocol
  • CollectionViewData
  • CollectionViewControllerProtocol
  • CollectionViewPresenterProtocol

v 0.1.1

11 Feb 16:32
Compare
Choose a tag to compare

Added for Cocoa Pods