Spots Versions Save

:bamboo: Spots is a cross-platform view controller framework for building component-based UIs

7.5.0

6 years ago

In this release we focused on improving the component focus delegate, making it even easier to both access and observe focused components and views.

The focus delegate now has a new property .focusedView. This is the view that is currently in focus, it is optional because there might not be any views selected. SpotsController has also been slightly changed, the ComponentFocusDelegate properties .focusedComponent and .focusedView are now dynamic so that you can easily observe them using key value observing.

Example

observer = spotsController.observe(\.focusedView, options: [.new]) { (controller, value) in
    guard let view = value.newValue else {
        return
    }

    // Do something with the view.
}

The delegate methods related to focus updates on Component has also been improved and should be more reliable.

Merged pull requests:

  • Feature focused view and refactor focus delegate implementation #793 (zenangst)

7.4.3

6 years ago

This release is all about minor optimizations, seems like there is a lot of that these days. The layout algorithm for SpotsScrollView has been improved by moving the appropriate methods out of layoutViews.

When setting frames to views, the width is now floored before it gets set. This avoids using values with percentage in them.

The property sizeCache is now properly populated on iOS, this was only done on tvOS before.

Merged pull requests:

7.4.2

6 years ago

Minor patch release that fixes the initial setup of components when using the SpotsController. It will no default back to setting the focused item to 0 if both focused component and focused item index is set to nil.

Merged pull requests:

  • Set focused item index to zero if index is nil when updating the delegates #789 (zenangst)

7.4.1

6 years ago

This is a super tiny maintenance release that removes an unwanted print statement.

Merged pull requests:

7.4.0

6 years ago

Not all releases can include new fancy visual improvements, this release is all about future possibilities and some under-the-hood improvements that might seem a small thing but has the potential to improve the overall user experience in all types of scenarios.

The first improvement is that visibleIndexes now is exposed in the public API, this means that you as a developer can easily request the indexes of the visible views that are currently shown on screen. This can be accessed by calling .visibleIndexes on UserInterface.

component.userInterface?.visibleIndexes

The second improvement that is mentioned above is that when doing bulk updates, Spots will now call reload indexes for views that are not visible on screen. This means that the update methods on UICollectionView etc is called fewer times which in turn leads to less UI distortion when updating larger collections, it should also off-load the CPU as the user interface has to do less redrawing to achieve UI updates.

Merged pull requests:

7.3.0

6 years ago

This release includes two really nice improvements for tvOS.

First, accelerated scrolling is a lot nicer when working with one component that has a lot of items. The outer scroll view will no longer size according to the size of the components content size. Instead the component itself will handle the scrolling and the content size of the outer scroll view will be statically set to the frame of the component. In addition, the delegate methods on the scroll delegate will use the component as the scroll view instead of relying on the outer scroll view. This way we get the desired behavior without having to change the public API or change the client implementation to accommodate the different scenarios.

The second improvement involves indexing titles to display a more user friendly accelerated scrolling behavior. You are now free to implement title indexing that will show up on the right side of the screen when a user scrolls fast in a component with a large collection of items.

Merged pull requests:

  • Feature/support for collection view titles #785 (zenangst)
  • Refactor sizing implementation to fix accelerated scrolling on tvOS. #784 (zenangst)

7.2.1

6 years ago

Includes one under-the-hood optimization, but it is a good one!

When Spots determines what changes between components, it will create temporary one that is used for diffing. This method previously called layoutIfNeeded on the Component's view which led to UI stuttering when working with multiple components. The stutter occurred because layoutIfNeeded is called (and has to be called) on the main thread. However, the view is never displayed on screen, hence making the layout calls unnecessary. In this new version, these calls are only made for components that are meant for screen rendering.

Merged pull requests:

  • Add needsLayout to setup() & layout() methods on Component #783 (zenangst)

7.2.0

6 years ago

Spots now comes with built-in support for Injection (https://github.com/johnno1962/InjectionIII). The protocol UserInterface also gets a new method that will reload the visible views, it takes two arguments, the first is which animation that should be used, the other is a completion that will be invoked when the update is done.

Merged pull requests:

7.1.0

6 years ago

Spots now supports client models on ComponentModel, it works the same way as it does on Item. This opens up for all kinds of new possibilities as you can give your models data that is tailored to your application.

Merged pull requests:

  • Add a generic initializer for ComponentModel #781 (zenangst)
  • Implement support for custom models on ComponentModel's #780 (zenangst)

7.0.2

6 years ago

Merged pull requests:

  • Improve focus handling when navigating upwards with multiple horizontal components #779 (zenangst)