All Projects → finn-no → Charcoal Ios

finn-no / Charcoal Ios

Licence: mit
A modern way to filter things in your iOS apps

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Charcoal Ios

Easygrid
EasyGrid - VanillaJS Responsive Grid
Stars: ✭ 77 (-24.51%)
Mutual labels:  filtering, library
Timeline Chart View
An android view to represent data over a timeline.
Stars: ✭ 100 (-1.96%)
Mutual labels:  library
Logcatch
android adb logcat viewer for Linux/Mac/Windows
Stars: ✭ 95 (-6.86%)
Mutual labels:  filtering
Colored
🎨 Mirror of colored library repository
Stars: ✭ 98 (-3.92%)
Mutual labels:  library
Gowebdav
A golang WebDAV client library and command line tool.
Stars: ✭ 97 (-4.9%)
Mutual labels:  library
Digitalkeyboard
手动实现简单的身份证数字键盘
Stars: ✭ 99 (-2.94%)
Mutual labels:  library
Easyddns
Easy to Use ESP8266 DDNS Update Client Library.
Stars: ✭ 96 (-5.88%)
Mutual labels:  library
Gifdec
small C GIF decoder
Stars: ✭ 100 (-1.96%)
Mutual labels:  library
Gl Catmull Clark
A javascript implementation of the Catmull-Clark subdivision surface algorithm
Stars: ✭ 100 (-1.96%)
Mutual labels:  library
Geotic
Entity Component System library for javascript
Stars: ✭ 97 (-4.9%)
Mutual labels:  library
React Markdown
Markdown editor (input) based on React
Stars: ✭ 98 (-3.92%)
Mutual labels:  library
Transit Map
Generate a schematic map (“metro map”) for a given (transit) network graph using Mixed Integer Programming.
Stars: ✭ 98 (-3.92%)
Mutual labels:  library
React Native Create Library
📓 Command line tool to create a React Native library with a single command
Stars: ✭ 1,362 (+1235.29%)
Mutual labels:  library
Go Daemon
A library for writing system daemons in golang.
Stars: ✭ 1,341 (+1214.71%)
Mutual labels:  library
Mime
The Hoa\Mime library.
Stars: ✭ 100 (-1.96%)
Mutual labels:  library
Octo
A fuzzing library in JavaScript. ✨
Stars: ✭ 96 (-5.88%)
Mutual labels:  library
Predicateflow
Write amazing, strong-typed and easy-to-read NSPredicate.
Stars: ✭ 98 (-3.92%)
Mutual labels:  library
Sunset.css
This library offers a collection of different CSS-powered transitions.
Stars: ✭ 99 (-2.94%)
Mutual labels:  library
Protobuf
Python implementation of Protocol Buffers data types with dataclasses support
Stars: ✭ 101 (-0.98%)
Mutual labels:  library
Ahk Rare
My collection of rare and maybe very useful functions
Stars: ✭ 101 (-0.98%)
Mutual labels:  library

CI Status Version Carthage Compatible License Platform Documentation Swift

Description

Charcoal is a declarative library that simplifies the creation of modern filtering experiences. It allows you in a flexible way to represent complex filtering flows in just a few steps. When building Charcoal we have taken major steps to ensure every UI element is refined to provide a great experience to your users, taking in account things such as accessibility and customization.

At FINN, filtering is one of the key elements of our native apps and we believe we are not alone on this, this is why we have taken the time and effort to share our countless hours of iterations and redesigns to share with you what we believe is one of the best filtering experiences, say hi to Charcoal.

Why Charcoal?

Charcoal /ˈtʃɑːkəʊl/: a porous black solid, consisting of an amorphous form of carbon, obtained as a residue when wood, bone, or other organic matter is heated in the absence of air. Used among other things as an effective component of filtering.

Features

  • [x] Out-of-the-box implementations of various filters
  • [x] Simple configuration and easy to use public API
  • [x] All-in-one solution for handling of complex filtering flows
  • [x] Beautiful design, UI animations and accessibility support
  • [x] Haptic feedback

Demo

Making a new Demo release

  1. Update Demo/CHANGELOG.md
  2. Update version for Demo target in Xcode
  3. Install fastlane with bundler if it is not already there. Run bundle install.
  4. Run sh Scripts/version.sh to update build number
  5. Run bundle exec fastlane and follow instructions

Installation

CocoaPods

Charcoal is available through CocoaPods. To install the core module of the framework, simply add the following line to your Podfile:

pod "Charcoal", git: "https://github.com/finn-no/charcoal-ios"

You will also need to include the FinniversKit dependency in your Podfile.

pod "FinniversKit", git: "https://github.com/finn-no/FinniversKit"

For using FINN-specific configuration in addition to core functionality:

pod 'Charcoal/FINN', git: "https://github.com/finn-no/charcoal-ios"

Carthage

Charcoal is also available through Carthage. To install it just write into your Cartfile:

github "finn-no/charcoal-ios"

FINNSetup.framework contains FINN-specific configuration and Charcoal.framework is suitable for building your custom implementation of filters.

Usage

  1. Create filter container with a list of filters, for example:
let container = FilterContainer(
    rootFilters: [
        // Multi-level list filter
        Filter(title: "Area", key: "area", subfilters: [
            Filter(title: "Oslo", key: "area", value: "Oslo"),
            Filter(title: "Bergen", key: "area", value: "Bergen"),
        ]),
        // Range slider with number inputs
        Filter.range(
            title: "Price",
            key: "price",
            lowValueKey: "price_from",
            highValueKey: "price_to",
            config: RangeFilterConfiguration(
                minimumValue: 1000,
                maximumValue: 100000,
                valueKind: .incremented(1000),
                hasLowerBoundOffset: false,
                hasUpperBoundOffset: true,
                unit: .currency,
                usesSmallNumberInputFont: false
            )
        ),
        // Map filter
        Filter.map(
            title: "Map",
            key: "map",
            latitudeKey: "latitude",
            longitudeKey: "longitude",
            radiusKey: "radius",
            locationKey: "location"
        )
    ],
    freeTextFilter: Filter.freeText(key: "query"),
    inlineFilter: Filter.inline(title: "", key: "inline", subfilters: inlineFilters),
    numberOfResults: 100
)
  1. Create CharcoalViewController, set optional delegates and data sources for handling selection changes, responding to user interactions with the map and free text search filters, etc.:
let viewController = CharcoalViewController()
viewController.mapDataSource = mapDataSource
viewController.searchLocationDataSource = searchLocationDataSource
viewController.freeTextFilterDataSource = freeTextFilterService
viewController.freeTextFilterDelegate = freeTextFilterService
viewController.selectionDelegate = self
viewController.textEditingDelegate = self
  1. Assign an instance of filter container to your view controller:
viewController.filterContainer = filterContainer
  1. If needed, pre-select some of the filters by using a set of URLQueryItem's, where name of the query item is the filter key and value is the selected filter value:
let selection = Set([
    URLQueryItem(name: "area", value: "Oslo"),
    URLQueryItem(name: "price_from", value: "10000")
])
viewController.set(selection: selection)

Changelogs

This project has a Gemfile that specify some development dependencies, one of those is pr_changelog which is a tool that helps you to generate changelogs from the Git history of the repo. You install this by running bundle install.

To get the changes that have not been released yet just run:

$ pr_changelog

If you want to see what changes were released in the last version, run:

$ pr_changelog --last-release

You can always run the command with the --help flag when needed.

Dependencies

Some of the UI elements in Charcoal are taken from FinniversKit, a framework which holds all the UI elements of the FINN iOS app.

Creating a new release

Setup

  • Install dependencies listed in Gemfile with bundle install (dependencies will be installed in ./bundler)
  • Fastlane will use the GitHub API, so make sure to create a personal access token here and place it within an environment variable called CHARCOAL_GITHUB_ACCESS_TOKEN.
    • When creating a token, you only need to give access to the scope repo.
    • There are multiple ways to make an environment variable, for example by using a .env file or adding it to .bashrc/.bash_profile). Don't forget to run source .env (for whichever file you set the environment variables in) if you don't want to restart your shell.
    • Run bundle exec fastlane verify_environment_variable to see if it is configured correctly.
  • Run bundle exec fastlane verify_ssh_to_github to see if ssh to GitHub is working.

Make release

  • Run bundle exec fastlane make_charcoal_version. Follow instructions, you will be asked for confirmation before all remote changes.
  • After the release has been created you can edit the description on GitHub by using the printed link.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].