• Stars
    star
    1,314
  • Rank 35,801 (Top 0.8 %)
  • Language
    Swift
  • License
    Other
  • Created about 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Spots logo

Spots is a cross-platform view controller framework for building component-based UIs. The internal architecture is built using generic view models that can be transformed both to and from JSON. So, moving your UI declaration to a backend is as easy as pie. Data source and delegate setup is handled by Spots, so there is no need for you to do that manually. The public API is jam-packed with convenience methods for performing mutation, it is as easy as working with a regular collection type.

Table of Contents

Spots Icon

Getting started with Spots

If you are looking for a way to get started with Spots, we recommend taking a look at our Getting started guide.

Origin Story

We wrote a Medium article about how and why we built Spots. You can find it here: Hitting the sweet spot of inspiration

Universal support

Apple's definition of a universal applications is iPhone and iPad. Spots takes this a step further with one controller tailored to each platform to support all your UI related update needs. Internally, everything conforms to the same shared protocol. What this means for you, is that get a unified experience when developing for iOS, tvOS or macOS.

Usage

Use the following links to dive a bit deeper into how Spots works.

How does it work?

At the top level of Spots, you have the SpotsController which is the replacement for your view controller.

Inside of the SpotsController, you have a SpotsScrollView that handles the linear layout of the components that you add to your data source. It is also in charge of giving the user a unified scrolling experience. Scrolling is disabled on all underlaying components except for components that have horizontal scrolling.

So how does scrolling work? Whenever a user scrolls, the SpotsScrollView computes the offset and size of its children. By using this technique you can easily create screens that contain lists, grids and carousels with a scrolling experience as smooth as proverbial butter. By dynamically changing the size and offset of the children, SpotsScrollView also ensures that reusable views are allocated and deallocated like you would expect them to. SpotsScrollView uses KVO on any view that gets added so if one component changes height or position, the entire layout will invalidate itself and redraw it like it was intended.

SpotsController supports multiple Component's, each represent their own UI container and hold their own data source. Components all share the same data model called ComponentModel, it includes layout, interaction and view model data. Component gets its super-powers from protocol extensions, powers like mutation, layout processing and convenience methods for accessing model information.

Key features

  • JSON based views that could be served up by your backend.
  • Live editing.
  • View based caching for controllers, table and collection views.
  • Supports displaying multiple collections, tables and regular views in the same container.
  • Features both infinity scrolling and pull to refresh (on iOS), all you have to do is to setup delegates that conform to the public protocols on SpotsController.
  • No need to implement your own data source, every Component has its own set of Items, which is maintained internally and is there at your disposal if you decide to make changes to them.
  • Easy configuration for registering views. This improves code reuse and helps to theme your app and ultimately keep your application consistent.
  • A rich public API for appending, prepending, inserting, updating or deleting Items.
  • Has built-in support for regular views inside of both collection and table views. Write one view and use it across your application, when and where you want to use it.
  • Supports view states such as normal, highlighted and selected.
  • View height caching that improves performance as each view has its height stored as a calculated value. on the view model.
  • Supports multiple views inside the same data source, no more ugly if-statements in your implementation;
  • Soft & hard updates to UI components.
  • Supports both views made programmatically and nib-based views. Spots handles this for you by using a view registry.

Installation

Spots is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Spots'

Spots is also available through Carthage. To install it, add the following to your Cartfile:

github "hyperoslo/Spots"

Changelog

Looking for a change log? You can find it here

Dependencies

  • Cache Used for ComponentModel and Item caching when initializing a SpotsController or CoreComponent object with a cache key.

Author

Hyper made this with ❀️. If you’re using this library we probably want to hire you! Send us an email at [email protected].

Contribute

We would love you to contribute to Spots, check the CONTRIBUTING file for more info.

Credits

License

Spots is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

Hue

🎨 Hue is the all-in-one coloring utility that you'll ever need.
Swift
3,463
star
2

Gray

πŸŒ“ Tailor your macOS Mojave experience
Swift
1,325
star
3

Blueprints

πŸŒ€ Blueprints - A framework that is meant to make your life easier when working with collection view flow layouts.
Swift
990
star
4

KeyboardCowboy

⌨️ The missing keyboard shortcut utility for macOS
Swift
740
star
5

Syncalicious

🍫 Syncalicious
Swift
356
star
6

Vaccine

πŸ’‰ Vaccine - Make your apps immune to recompile-disease
Swift
303
star
7

Family

🚸 A child view controller framework that makes setting up your parent controllers as easy as pie.
Swift
250
star
8

Tailor

πŸ‘”A super fast & convenient object mapper tailored for your needs
Swift
242
star
9

Versions

❇️Helping you find inner peace when comparing version numbers in Swift.
Swift
208
star
10

MarvinXcode

πŸ”¨A collection of nifty commands for your everyday workflow in Xcode
Swift
125
star
11

Differific

β›½ Differific - a fast and convenient diffing framework.
Swift
124
star
12

Coda-2-Modes

Modes for Coda 2
AppleScript
61
star
13

UserInterface

πŸš₯ UserInterface - a collection of convenience extensions specifically tailored to building user interfaces in Swift.
Swift
51
star
14

ToTheTop

πŸ”To the top - A small macOS application to help you scroll to the top.
Swift
36
star
15

Zcode

Work around Apples restriction with running Xcode 6.4 on El Capitan Developer Preview 2
Swift
25
star
16

NSString-ZENInflections

Returns camelCased, UpperCamelCased, dashed-case, snake_cased representations of an NSString
Objective-C
25
star
17

Inflection

The Optimus Prime of string inflection
Swift
22
star
18

MouseDef

🐭Move and resize windows by holding down modifier keys
Swift
21
star
19

ChangeMarks

Change Marks helps you to keep track of your most recent changes by giving them a different background color.
Objective-C
14
star
20

OSX-Configuration

My personal OS X configurations
Shell
10
star
21

ZenCode

πŸ”¨ZenCode for Xcode - A collection of nifty commands for your everyday workflow in Xcode.
Swift
9
star
22

Apps

Swift
7
star
23

Voodoo

πŸ’€ Voodoo is a set of Sourcery templates to make you do more with less.
Swift
7
star
24

Houston

Swift
6
star
25

WindowFlex

Helps you flex your Xcode window muscles
Objective-C
6
star
26

Storage

Swift
5
star
27

AXEssibility

Swift
5
star
28

Mapper

An object mapper for Swift
Swift
4
star
29

Marvin-Xcode-Extension

πŸ”¨A collection of nifty commands for your everyday workflow in Xcode 8
Swift
4
star
30

Xcode-Templates

πŸ”¨ Xcode templates
Swift
4
star
31

Goldfish

Something something secret ... goldfish.
Swift
3
star
32

TextMate-1-Bundle

Commands and Snippets I use everyday at work
3
star
33

coda-command-line

Coda 2 command line tool
Objective-C
3
star
34

XcodeConfiguration

3
star
35

C.mode

C mode for Coda 2
AppleScript
3
star
36

DirectoryObserver

Observing the file-system, easy as 1 2 3!
Swift
3
star
37

GoldenRetriever

Swift
2
star
38

dotfiles

My dotfiles
Vim Script
2
star
39

xcode-fish

Find and open xcworkspace or xcproject in Xcode.
Shell
2
star
40

LaunchArguments

Swift
2
star
41

xcode-espresso-tribute-theme

A light theme inspired by the Espresso - The Web Editor
2
star
42

xcode-ios-project

Ruby
2
star
43

MachPort

Swift
2
star
44

ZENFramework

Just another PHP MVC framework
PHP
2
star
45

HideDockAndStageManager

Swift
2
star
46

Windows

Swift
2
star
47

NSString-ZENVersions

Helping you find inner peace when comparing version numbers.
Objective-C
2
star
48

ApacheConf.mode

Apache configuration mode for Coda 2
1
star
49

theme-oh-my-sushi

oh-my-sushi
Shell
1
star
50

SidebarFlex

Objective-C
1
star
51

Retina

Swift
1
star
52

KeyCodes

Swift
1
star
53

StageManagerAppWindowGroupingBehavior

Swift
1
star
54

Swift.mode

1
star
55

Ruby.mode

Ruby mode for Coda 2
AppleScript
1
star
56

DockManager

Swift
1
star
57

xc

Swift
1
star
58

haml.mode

HAML mode for Coda 2
1
star
59

ERB.mode

Ruby ERB mode for Coda 2
AppleScript
1
star
60

emolator

TBD
1
star
61

DefaultKeyBinding

Custom keyboard shortcuts for OS X
1
star