Skip to content

1.2.0

Compare
Choose a tag to compare
@danielsaidi danielsaidi released this 16 Jan 16:04
· 337 commits to master since this release

This is a huge update, that completely rewrites how action sheet appearances are handled. Instead of the old appearance model, Sheeeeeeeeet now relies on the iOS appearance proxy model as much as possible.

The old appearance model is still around, but has been marked as deprecated, and will be removed in 1.4.0. Make sure that you switch over to the new appearance model as soon as possible. Have a look at the example app and [here][Appearance] to see how you should customize the action sheet appearance from now on.

In short, item appearance customizations are handled in three different ways now:

  • Item appearances such as colors and fonts, are customized with cell properties, for instance: ActionSheetSelectItemCell.appearance().titleColor = .green.
  • Item heights are now customized by setting the height property of every item type you want to customize, for instance: ActionSheetTitle.height = 22.
  • Action sheet margins, insets etc. are now customized by setting the properties of each ActionSheet instance. If you want to change the default values for all action sheets in your app, you have to subclass ActionSheet.

All built-in action sheet items now have their own cells. Your custom items only have to use custom cells if you want to apply custom item appearances to them.

Sheeeeeeeeet now contains several new views, which are used by the action sheets:

  • ActionSheetTableView
  • ActionSheetItemTableView
  • ActionSheetButtonTableView
  • ActionSheetBackgroundView
  • ActionSheetStackView

The new classes make it easy to modify the appearance of these views, since they have appearance properties as well. For instance, to change the corner radius of the table views, just type: ActionSheetTableView.appearance().cornerRadius = 8.

ActionSheet has two new extensions:

  • items<T>(ofType:)
  • scrollToFirstSelectedItem(at:)

This new version has also rebuilt all unit tests from scratch. They are now more robust and easier to maintain.