FlaneurFormView

public final class FlaneurFormView: UIView

View in charge of displaying form elements.

It is quite poorly designed as many problems arose late in the implementation:

  • Instead of a form, it would probably make more sense to use a table view controller
  • Using a IGListKit-backed collection view is a terrible idea, it should be a simple table view
  • Since

    Since we design a form, we should skip reusable cells and just keep stong references of every cell: we wouldn’t need a cache anymore

    objc.io’s Swit Talks addressed the problems of reusable form components design in a series. It is a good inspiration to redesign this component.

    Also, FlaneurImagePicker is actually a form component library. It would probably make sense that other form components belong to the same library, that should then be renamed FlaneurForm or something similar.

    • Undocumented

      Declaration

      Swift

      public let collectionView: UICollectionView =
    • Initializes and returns a newly allocated navigation bar object with the specified frame rectangle.

      Declaration

      Swift

      public override init(frame: CGRect)

      Parameters

      frame

      The frame rectangle for the view, measured in points.

    • Returns an object initialized from data in a given unarchiver.

      Declaration

      Swift

      public required init?(coder: NSCoder)

      Parameters

      coder

      An unarchiver object.

    • Calls this exactly once.

      Declaration

      Swift

      public func configure(viewController: UIViewController)

      Parameters

      viewController

      the view controller presenting the form.

    • Adds a form element.

      See also

      FlaneurFormElement

      Declaration

      Swift

      public func addFormElement(_ formElement: FlaneurFormElement, cacheValue: String? = nil)

      Parameters

      formElement

      the form element to add to the form.

      cacheValue

      the cache value in case the form element is textual (this is terrible design).

    • Undocumented

      Declaration

      Swift

      public func objects(for listAdapter: ListAdapter) -> [ListDiffable]
    • Undocumented

      Declaration

      Swift

      public func listAdapter(_ listAdapter: ListAdapter, sectionControllerFor object: Any) -> ListSectionController
    • Undocumented

      Declaration

      Swift

      public func emptyView(for listAdapter: ListAdapter) -> UIView?
    • Undocumented

      Declaration

      Swift

      public func listAdapter(_ listAdapter: ListAdapter, willDisplay sectionController: ListSectionController)
    • Undocumented

      Declaration

      Swift

      public func listAdapter(_ listAdapter: ListAdapter, didEndDisplaying sectionController: ListSectionController)
    • Undocumented

      Declaration

      Swift

      public func listAdapter(_ listAdapter: ListAdapter, willDisplay sectionController: ListSectionController, cell: UICollectionViewCell, at index: Int)
    • Undocumented

      Declaration

      Swift

      public func listAdapter(_ listAdapter: ListAdapter, didEndDisplaying sectionController: ListSectionController, cell: UICollectionViewCell, at index: Int)
    • Undocumented

      Declaration

      Swift

      public func scrollCurrentFieldToVisible()