This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
Releases: yurii-lysytsia/AirCollection
Releases · yurii-lysytsia/AirCollection
v 1.5.0
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
andScrollRefreshPresenterProtocol
for implementationUIRefreshControl
.
Table view
- Modified
TableViewPresenterProtocol
. AddedtableRowShouldHighlight
,tableDidHighlight
,tableDidUnhighlight
andtableRowShouldSelect
delegate methods.
Collection view
- Modified
CollectionViewPresenterProtocol
. AddedcollectionItemShouldHighlight
,collectionItemDidHighlight
,collectionItemDidUnhighlightItem
andcollectionItemShouldSelect
delegate methods.
v 1.4.1
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
- Added description for using table view and collection view cells;
- Added simple example project with common but often used methods;
ReusableView
Features
- Added
TextFieldConfiguration
for easy configure reusable view andTextFieldDelegate
that replace originalUITextFieldDelegate
for convenient implementation; - Added child
TextFieldPickerViewConfiguration
that implement for text field which useUIPickerView
instead keyboard; - Added child
TextFieldPickerViewConfiguration
that implement for text field which useUIPickerView
instead keyboard. Also addedTextFieldPickerViewDataSource
andTextFieldPickerViewDelegate
for it; - Added child
TextFieldDatePickerConfiguration
that implement for text field which useUIDatePicker
instead keyboard. Also addedTextFieldDatePickerDelegate
for it; - Added
TextFieldControllerProtocol
for view andTextFieldPresenterProtocol
for presenter. This will help use delegate by presenter without additional code; - Added
TextViewConfiguration
for easy configure reusable view andTextViewDelegate
that replace originalUITextViewDelegate
for convenient implementation; - Added
TextViewControllerProtocol
for view andTextViewPresenterProtocol
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
andNibLoadableView
protocols no longer implementIdentificableView
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 withTextFieldPresenterProtocol
,DatePickerPresenterProtocol
,PickerViewPresenterProtocol
orTextViewControllerProtocol
; - Added
becomeTableViewRowFirstResponder(at:)
andresignTableViewRowFirstResponder(at:)
for collection view where cells isInputConfigurableView
;
Fixes
- Table view reusable header or footer view dynamic height dimension;
Deprecated
- Removed
forwardTableViewDelegate()
. It called automatically when you callconfigureTableView(configurator:)
;
Collection view
Features
- Added default protocols method realisation for
CollectionViewPresenterProtocol
that implemented withTextFieldPresenterProtocol
,DatePickerPresenterProtocol
,PickerViewPresenterProtocol
orTextViewControllerProtocol
; - Added
indexPath(forSupplementaryView:,of:)
method for gets index path for section header or footer; - Added
becomeCollectionViewRowFirstResponder(at:)
andresignCollectionViewRowFirstResponder(at:)
for collection view where cells isInputConfigurableView
;
Deprecated
- Removed
forwardCollectionViewDelegate()
. It called automatically when you callconfigureCollectionView(configurator:)
;
v 1.4.0
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
Collection View
Renamed
UICollectionView.ElementKindSection
has been renamed toCollectionViewElementKindSection
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
TableView
Renamed
UITableView.RowHeight
has been renamed toTableViewRowHeight
UITableView.ViewHeight
has been renamed toTableViewHeaderFooterViewHeight
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 getIndexPath
for subview ofUITableViewCell
CollectionView
Renamed
UICollectionView.ItemSize
has been renamed toCollectionViewItemSize
UICollectionView.ViewHeight
has been renamed toCollectionViewSupplementaryViewHeight
Refactored
CollectionViewItemSize
has been fully changed. Now it's astruct
insteadenum
which containswidth
andheight
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 getIndexPath
for subview ofUICollectionViewCell
v 1.2.0
- Added dynamic size cache for collection view
- Added new collection view item size preferences
v 1.1.0
- Added
TableViewDelegate
- Added table view dynamic height
v 1.0.0
- TableViewData
- TableViewControllerProtocol
- TableViewPresenterProtocol
- CollectionViewData
- CollectionViewControllerProtocol
- CollectionViewPresenterProtocol
v 0.1.1
Added for Cocoa Pods