Stencil is a simple and powerful template language for Swift.

Related tags

UI Stencil
Overview

Stencil

Build Status

Stencil is a simple and powerful template language for Swift. It provides a syntax similar to Django and Mustache. If you're familiar with these, you will feel right at home with Stencil.

Example

There are {{ articles.count }} articles.

<ul>
  {% for article in articles %}
    <li>{{ article.title }} by {{ article.author }}</li>
  {% endfor %}
</ul>
import Stencil

struct Article {
  let title: String
  let author: String
}

let context = [
  "articles": [
    Article(title: "Migrating from OCUnit to XCTest", author: "Kyle Fuller"),
    Article(title: "Memory Management with ARC", author: "Kyle Fuller"),
  ]
]

let environment = Environment(loader: FileSystemLoader(paths: ["templates/"]))
let rendered = try environment.renderTemplate(name: "article_list.html", context: context)

print(rendered)

Philosophy

Stencil follows the same philosophy of Django:

If you have a background in programming, or if you’re used to languages which mix programming code directly into HTML, you’ll want to bear in mind that the Django template system is not simply Python embedded into HTML. This is by design: the template system is meant to express presentation, not program logic.

The User Guide

Resources for Stencil template authors to write Stencil templates:

Resources to help you integrate Stencil into a Swift project:

Projects that use Stencil

Sourcery, SwiftGen, Kitura, Weaver, Genesis

License

Stencil is licensed under the BSD license. See LICENSE for more info.

Comments
  • Optimise Scanner performance

    Optimise Scanner performance

    This is a rebase of #207

    ✅ What I did:

    • squash of the commits
    • integrate the upstream changes about range reporting to fix the tests during the rebase process
    • remove Swift 3 from the build matrix

    ❌What I did not do:

    • benchmark if there is an actual performance improvement
    opened by Liquidsoul 28
  • [Review] Jinja2-like whitespace trim behavior

    [Review] Jinja2-like whitespace trim behavior

    This has been attempted at least twice in #85 and #32 .

    In #89 you expressed interest in the way this is done in Jinja2, I've attempted to recreate that here. This is still Review because I'm waiting on feedback before adding:

    • options to Environment to set the default trim behaviors
    • documentation, more test cases, etc.
    duplicate rock 
    opened by bejar37 24
  • Remove Dependency of PathKit for External Programs

    Remove Dependency of PathKit for External Programs

    There's no logical reason that a consuming program would need PathKit. An overloaded init could be included to support a plain String representation of a path that is internally converted to a PathKit Path.

    This would remove an unnecessary third-party dependency.

    public init(from paths: [String]) {
        ...
    }
    
    question 
    opened by HelloFillip 17
  • Lots of blank empty lines in output

    Lots of blank empty lines in output

    It appears if you use an if block, and it doesn't pass the truth test, it's still adding blank lines to the output. Have you found this to be correct?

    opened by malkomalko 16
  • Critical performance issue

    Critical performance issue

    After refactoring my app, I'm seeing extreme rendering times, as bad as 14s sometimes. I'm not entirely sure what causes this, but I wanted to report it already, as I believe the issue lies with Stencil.

    Here's what I have so far:

    • I'm using Stencil 0.11.
    • I didn't notice any issue in development. On macOS, 0.11 works fine and render times are < 100ms usually.
    • When deploying the same code to IBM Cloud, the render times become horrible (1-15s). This leads me to believe it's a Linux-specific issue. I'm not sure about that however, as I haven't been able to reproduce it on Linux via Docker, only when deploying to cloud.
    • I did not have this issue before when I was using 0.10.1.
    • I was able to reproduce the issue to a lesser extent on macOS as well. If I use the latest master, my render times jump over 1s as well.
    • I've added logging all throughout my handlers as well as Kitura and didn't notice any issues there. Almost all of the delay is caused by Stencil. I went as far as Template.render but haven't narrowed it down further yet.
    • All my templates uses inheritance. I'm having other issues with inheritance on master as well, so perhaps it related?

    I would really appreciate any help in tracking down and resolving this issue as I need to release this app in the next few weeks.

    I've also tried reverting back to 0.10, but that's giving me a compilation error on Linux I've yet to resolve:

    PathKit.swift:299:11: error: cannot convert value of type 'ObjCBool' to expected argument type 'Bool'

    opened by svanimpe 14
  • Editor and IDE support

    Editor and IDE support

    I think the success of a project like Stencil depends in part on its editor and IDE support. I started out using Stencil with a Django plugin (to get some syntax highlighting at least), but found that less than ideal, which is why I built something specifically for Stencil. Earlier this year I wrote a TextMate bundle (https://github.com/svanimpe/stencil.tmbundle) and used that to build a VS Code extension (https://github.com/svanimpe/vscode-stencil). The latter has proven quite popular, with over 500 installs.

    Unfortunately, I don't have the time to follow the repository closely and read every single commit to check if a change requires an update to the grammar. If possible, I would like to donate my work to the Stencil project.

    Are you interested in this?

    opened by svanimpe 13
  • Subscript syntax for Variables

    Subscript syntax for Variables

    This allows users to refer to variables (and properties) using indirection.

    Let's say for example we have the following context:

    [
      "object": [
        "name": "John",
        "role": "Developer",
        "location": "Somewhere"
      ],
      "visible": ["name", "role"]
    ]
    

    A user can then write:

    {% for property in visible %}
     - {{property}}: {{ object.$property }}
    {% endfor %}
    

    To produce:

    - name: John
    - role: Developer
    
    enhancement 
    opened by djbe 12
  • Trim newlines

    Trim newlines

    This fixes #22 and is an alternative to #32 The lexer removes white space and trailing newlines from block tokens if they are on their own line.

    {% for item in items %}
    - {{item.name}}
    {% endfor %}
    

    will now be rendered

    - item 1
    - item 2
    - item 3
    
    duplicate rock 
    opened by yonaskolb 12
  • Trim whitespace

    Trim whitespace

    This takes the work that @bejar37 started in #92 and builds upon it.

    In addition to the Jinja2 trimming symbols, this adds a trimBehavior: TrimBehaviour on Environment. This defaults to .none but can be customized. It also comes with a built in .smart case that removes whitespace before a block, and whitespace and a single newline after a block.

    opened by yonaskolb 10
  • Add Package.swift for Swift 4.2

    Add Package.swift for Swift 4.2

    This allows Stencil to be compiled with Swift 4.2

    We should wait for new releases including https://github.com/kylef/PathKit/pull/56 and https://github.com/kylef/Spectre/pull/37

    Also once Swift 4.2 is officially released we can add a CI job for it.

    opened by keith 10
  • Added filter to apply dynamic filters

    Added filter to apply dynamic filters

    filter:arg will resolve its argument as filter expression which will allow to apply dynamic filters.

    The use case for that can be using Sourcery to generated code for Codable protocols and use different key coding strategies applied for different data models. It will allow to specify strategy as one of Stencil filters in a type annotation, i.e. uppercaseFirstLetter or camelCaseToSnakeCase, or even filter with arguments.

    Currently in template I have to check annotations against hardcoded set of filters to be able to apply them. With this change this template code

    {% if strategy == "upperFirstLetter" %}{{ variable.name|replace:"_",""|upperFirstLetter }}{% else %}{{ variable.name|replace:"_",""|camelToSnakeCase }}{% endif %}
    

    becomes this

    {{ variable.name|replace:"_",""|filter:strategy }}
    

    and allows to use any registered filter without changing anything in template.

    opened by ilyapuchka 10
  • Question: Is there a better way to render blocks?

    Question: Is there a better way to render blocks?

    I'm trying to duplicate the functionality of Django-render-block. Basically I want the ability to only render a specific block in a template. I'm relatively new to Swift, so wasn't expecting much, but to my surprise, I got it to work like so

    public extension Template {
        func render(block: String, _ context: Context) throws -> String {
            let context = context
            var append = false
            var collectedTokens = [Token]()
            
            for token in tokens {
                if token.contents.description.starts(with: "block \(block)") {
                    append = true
                }
                
                if token.contents.description == "endblock \(block)" {
                    break
                }
                
                if append {
                    collectedTokens.append(token)
                }
            }
    
            let parser = TokenParser(tokens: collectedTokens, environment: context.environment)
            let nodes = try parser.parse()
            return try renderNodes(nodes, context)
        }
    }
    

    Obviously this is very crude and relies on a textual representation of the token, but it does exactly what I need and as a bonus it worked with custom tags. Is there a better more elegant way to achieve this?

    opened by wombat2k 0
  • Question: Is there a way to nest tags

    Question: Is there a way to nest tags

    I'm trying to create a stencil for a document that consists of two columns and where I want the left column to be left justify and the right column right justified. ie:

    abcd     efgh
    abc       fgh
    abcd     efgh
    abc       fgh 
    

    I could write a custom tag that would take the width of the page and the two parameters and this would work fine. The problem I run into is that each string would itself need to be a tag/variable (the left side are localised strings, the right side is data coming from app.

    Any idea on how to do this?

    opened by otusweb 1
  • How can I loop through an array passed as the context?

    How can I loop through an array passed as the context?

    For example, if I have:

    {% include "myTemplate.stencil" array1 %} {# "array1" is an array #}
    

    And in myTemplate.stencil, how can I loop though it?

    {% for item in ??? %}
        ...
    {% endfor %}
    

    I can't seem to use the array properties either, like {{ count }}.

    opened by Sweeper777 1
  • Windows newlines breaks the template engine?

    Windows newlines breaks the template engine?

    I have this code (note the windows new lines \r\n in index):

    let base = """
    Hello World
    {% block content %}
    This is base
    {% endblock %}
    """
    let index = "{% extends \"base.stencil\" %}\r\n{% block content %}\r\nThis is Index\r\n{% endblock %}"
    let env = Environment(loader: DictionaryLoader(templates: ["base.stencil": base, "index.stencil": index]))
    do {
        print(try env.renderTemplate(name: "index.stencil"))
    } catch {
        print(error)
    }
    

    This prints:

    Hello World
    
    This is base
    

    As if everything after the first line of index got ignored. I know it's weird to have windows new lines on macOS, but I don't think the behaviour of the template engine should depend on what kind of newlines I use, right?

    opened by Sweeper777 0
  • Added the option to throw when variable not found in context

    Added the option to throw when variable not found in context

    The existing behaviour substitutes a variable that could not be resolved for an empty string without throwing any error.

    This PR adds the option to throw when a variable that could not be resolved is used in a template (which means it was not defined in the context).

    This is helpful to prevent errors in templates, for example if introducing a typo when referring to a variable.

    opened by acecilia 8
Releases(0.15.1)
  • 0.15.1(Jul 31, 2022)

  • 0.15.0(Jul 29, 2022)

    Breaking

    • Drop support for Swift < 5. For Swift 4.2 support, you should use Stencil 0.14.2.
      David Jennes #323

    Enhancements

    • Added support for trimming whitespace around blocks with Jinja2 whitespace control symbols. eg {%- if value +%}.
      Miguel Bejar Yonas Kolb #92 #287
    • Added support for adding default whitespace trimming behaviour to an environment.
      Yonas Kolb #287
    • Blocks now can be used repeatedly in the template. When block is rendered for the first time its content will be cached and it can be rendered again later using {{ block.block_name }}.
      Ilya Puchka #158 #182
    • Added break and continue tags to break or continue current loop.
      Ilya Puchka #175
    • You can now access outer loop's scope by labeling it: {% outer: for ... %}... {% for ... %} {{ outer.counter }} {% endfor %}{% endfor %}.
      Ilya Puchka #175
    • Boolean expressions can now be rendered, i.e {{ name == "John" }} will render true or false depending on the evaluation result.
      Ilya Puchka David Jennes #164 #325
    • Enable dynamic member lookup using a new DynamicMemberLookup marker protocol. Conform your own types to this protocol to support dynamic member from with contexts.
      Ilya Puchka #219 #246
    • Allow providing lazily evaluated context data, using the LazyValueWrapper structure.
      David Jennes #324

    Bug Fixes

    Internal Changes

    Source code(tar.gz)
    Source code(zip)
  • 0.14.2(Nov 3, 2021)

  • 0.14.1(Apr 11, 2021)

  • 0.14.0(Aug 17, 2020)

    Breaking

    • Drop support for Swift < 4.2. For Swift 4 support, you should use Stencil 0.13.1.
      David Jennes #294

    Enhancements

    • Added support for dynamic filter using filter filter. With that you can define a variable with a name of filter , i.e. myfilter = "uppercase" and then use it to invoke this filter with {{ string|filter:myfilter }}.
      Ilya Puchka #203

    Deprecations

    None

    Bug Fixes

    • Fixed using parenthesis in boolean expressions, they now can be used without spaces around them.
      Ilya Puchka #254
    • Throw syntax error on empty variable tags ({{ }}) instead fatalError.
      Ilya Puchka #263

    Internal Changes

    Source code(tar.gz)
    Source code(zip)
  • 0.13.1(Aug 16, 2020)

  • 0.13.0(Sep 25, 2018)

    Breaking

    Enhancements

    • You can now use parentheses in boolean expressions to change operator precedence.
      Ilya Puchka #165
    • Added method to add boolean filters with their negative counterparts.
      Ilya Puchka #160
    • Now you can conditionally render variables with {{ variable if condition }}, which is a shorthand for {% if condition %}{{ variable }}{% endif %}. You can also use else like {{ variable1 if condition else variable2 }}, which is a shorthand for {% if condition %}{{ variable1 }}{% else %}{{ variable2 }}{% endif %}
      Ilya Puchka #243
    • Now you can access string characters by index or get string length the same was as if it was an array, i.e. {{ 'string'.first }}, {{ 'string'.last }}, {{ 'string'.1 }}, {{ 'string'.count }}.
      Ilya Puchka #245

    Bug Fixes

    • Fixed the performance issues introduced in Stencil 0.12 with the error log improvements.
      Ilya Puchka #230
    • Now accessing undefined keys in NSObject does not cause runtime crash and instead renders empty string.
      Ilya Puchka #234
    • for tag: When iterating over a dictionary the keys will now always be sorted (in an ascending order) to ensure consistent output generation.
      David Jennes #240

    Internal Changes

    Source code(tar.gz)
    Source code(zip)
  • 0.12.1(Aug 30, 2018)

  • 0.12.0(Aug 26, 2018)

    Enhancements

    • Added an optional second parameter to the include tag for passing a sub context to the included file.
      Yonas Kolb #214
    • Variables now support the subscript notation. For example, if you have a variable key = "name", and an object item = ["name": "John"], then {{ item[key] }} will evaluate to "John".
      David Jennes #215
    • Adds support for using spaces in filter expression.
      Ilya Puchka #178
    • Improvements in error reporting.
      Ilya Puchka #167

    Bug Fixes

    Source code(tar.gz)
    Source code(zip)
  • 0.11.0(Apr 5, 2018)

    Enhancements

    • Added support for resolving superclass properties for not-NSObject subclasses
    • The {% for %} tag can now iterate over tuples, structures and classes via their stored properties.
    • Added split filter
    • Allow default string filters to be applied to arrays
    • Similar filters are suggested when unknown filter is used
    • Added indent filter
    • Allow using new lines inside tags
    • Added support for iterating arrays of tuples
    • Added support for ranges in if-in expression
    • Added property forloop.length to get number of items in the loop
    • Now you can construct ranges for loops using a...b syntax, i.e. for i in 1...array.count

    Bug Fixes

    • Fixed rendering {{ block.super }} with several levels of inheritance
    • Fixed checking dictionary values for nil in default filter
    • Fixed comparing string variables with string literals, in Swift 4 string literals became Substring and thus couldn't be directly compared to strings.
    • Integer literals now resolve into Int values, not Float
    • Fixed accessing properties of optional properties via reflection
    • No longer render optional values in arrays as Optional(..)
    • Fixed subscription tuples by value index, i.e. {{ tuple.0 }}
    Source code(tar.gz)
    Source code(zip)
  • 0.10.1(Nov 17, 2017)

  • 0.10.0(Oct 28, 2017)

    Enhancements

    • Adds counter0 to for loop context allowing you to get the current index of the for loop 0 indexed.
    • Introduces a new DictionaryLoader for loading templates from a Swift Dictionary.
    • Added in expression in if tag for strings and arrays of hashable types
    • You can now access the amount of items in a dictionary using the count property.

    Bug Fixes

    • Fixes a potential crash when using the {% for %} template tag with the incorrect amount of arguments.
    • Fixes a potential crash when using incomplete tokens in a template for example, {%%} or {{}}.
    • Fixes evaluating nil properties as true
    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Apr 18, 2017)

    Enhancements

    • for block now can contain where expression to filter array items. For example {% for item in items where item > 1 %} is now supported.

    • if blocks may now contain else if (elif) conditions.

      {% if one or two and not three %}
        one or two but not three
      {% elif four %}
        four
      {% else %}
        not one, two, or four
      {% endif %}
      
    • for block now allows you to iterate over array of tuples or dictionaries.

      {% for key, value in thing %}
        <li>{{ key }}: {{ value }}</li>
      {% endfor %}
      

    Bug Fixes

    • You can now use literal filter arguments which contain quotes. #98
    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Feb 18, 2017)

    Breaking

    • It is no longer possible to create Context objects. Instead, you can pass a dictionary directly to a Templates render method.

      - try template.render(Context(dictionary: ["name": "Kyle"]))
      + try template.render(["name": "Kyle"])
      
    • Template loader are no longer passed into a Context, instead you will need to pass the Loader to an Environment and create a template from the Environment.

      let loader = FileSystemLoader(paths: ["templates/"])
      
      - let template = loader.loadTemplate(name: "index.html")
      - try template.render(Context(dictionary: ["loader": loader]))
      + let environment = Environment(loader: loader)
      + try environment.renderTemplate(name: "index.html")
      
    • Loaders will now throw a TemplateDoesNotExist error when a template is not found.

    • Namespace has been removed and replaced by extensions. You can create an extension including any custom template tags and filters. A collection of extensions can be passed to an Environment.

    Enhancements

    • Environment is a new way to load templates. You can configure an environment with custom template filters, tags and loaders and then create a template from an environment.

      Environment also provides a convenience method to render a template directly.

    • FileSystemLoader will now ensure that template paths are within the base path. Any template names that try to escape the base path will raise a SuspiciousFileOperation error.

    • New {% filter %} tag allowing you to perform a filter across the contents of a block.

      {% filter lowercase %}
        This Text Will Be Lowercased.
      {% endfilter %}
      
    • You can now use {{ block.super }} to render a super block from another {% block %}.

    • Environment allows you to provide a custom Template subclass, allowing new template to use a specific subclass.

    • If expressions may now contain filters on variables. For example {% if name|uppercase == "TEST" %} is now supported.

    Deprecations

    • Template initialisers have been deprecated in favour of using a template loader such as FileSystemLoader inside an Environment.

    • The use of whitespace inside variable filter expression is now deprecated.

      - {{ name | uppercase }}
      + {{ name|uppercase }}
      

    Bug Fixes

    • Restores compatibility with ARM based platforms such as iOS. Stencil 0.7 introduced compilation errors due to using the Float80 type which is not available.
    Source code(tar.gz)
    Source code(zip)
  • 0.7.1(Nov 30, 2016)

  • 0.7.0(Nov 29, 2016)

    New documentation website: https://stencil.fuller.li

    Breaking

    • TemplateLoader has been renamed to FileSystemLoader. The loadTemplate(s) methods are now throwing and now take labels for the name and names arguments.
    • Many internal classes are no longer public. Some APIs were previously accessible due to earlier versions of Swift requiring the types to be public to be able to test. Now we have access to @testable these can correctly be private.
    • {% ifnot %} tag is now deprecated, please use {% if not %} instead.

    Enhancements

    • Variable lookup now supports introspection of Swift types. You can now lookup values of Swift structures and classes inside a Context.

    • If tags can now use prefix and infix operators such as not, and, or, ==, !=, >, >=, < and <=.

        {% if one or two and not three %}
      
    • You may now register custom template filters which make use of arguments.

    • There is now a default filter.

      Hello {{ name|default:"World" }}
      
    • There is now a join filter.

      {{ value|join:", " }}
      
    • {% for %} tag now supports filters.

      {% for user in non_admins|default:admins %}
        {{ user }}
      {% endfor %}
      

    Bug Fixes

    • Variables ({{ variable.5 }}) that reference an array index at an unknown index will now resolve to nil instead of causing a crash. #72
    • Templates can now extend templates that extend other templates. #60
    • If comparisons will now treat 0 and below numbers as negative.
    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Sep 13, 2016)

  • 0.6.0-beta.1(Apr 4, 2016)

    Enhancements

    • Namespaces are now included in contexts so that template tags can make use of the namespace and pass it down to subsequent temples.
    Source code(tar.gz)
    Source code(zip)
  • 0.5.3(Feb 26, 2016)

  • 0.5.1(Dec 8, 2015)

  • 0.5.0(Dec 8, 2015)

    Breaking Change
    • This version moves filters and tags to "namespaces", please consult the README for more information.
    Enhancements
    • Stencil can now be used with the Swift Package Manager (SPM).
    • Stencil now support Linux.
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Oct 30, 2015)

  • 0.3.0(Oct 26, 2015)

    This release adds Swift 2.0 support along with changing the complete API so that instead of returning a Result-like type, we will either throw or return the appropriate value.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Oct 26, 2015)

    This release adds support for Swift 1.2.

    Enhancements
    • Adds the following template tags used for inheritance:
      • {% include "foo.html" %}
      • {% extends "base.html" %}
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Oct 26, 2015)

  • 0.1.0(Oct 26, 2015)

Owner
Stencil Project
GitHub Organization to host the Stencil project, a Swift library to render jinja-like templates
Stencil Project
Convenient domain specific language for writing programmatic UI built over UIKit and more.

XYKit Swifty and convenient domain specific language for creating programmatic UI in a more declarative way and more than that. Built on top of UIKit

Denis Goloborodko 1 Nov 5, 2021
Powerful and easy-to-use vector graphics Swift library with SVG support

Macaw Powerful and easy-to-use vector graphics Swift library with SVG support We are a development agency building phenomenal apps. What is Macaw? Mac

Exyte 5.9k Jan 1, 2023
Swift programming language hackathon. Implementation of the main logic of working with an ATM in the Playground environment.

Hackaton-ATM-PJ04 Swift programming language hackathon. Implementation of the main logic of working with an ATM in the Playground environment. The tas

Raman Kozar 2 Oct 4, 2022
macOS GUI Library for the Nim Programming Language

NimCocoa NimCocoa is an experimental implementation of a Native GUI for the Nim programming language running on macOS. Rather than rely on low level c

null 32 Dec 8, 2022
A Powerful , Extensible CSS Parser written in pure Swift.

A Powerful , Extensible CSS Parser written in pure Swift. Basic Usage From CSS: #View { "width" : 118; "height" : 120.5; "color1" : "#888888"; "co

null 273 Sep 9, 2022
React.js like Mixin. More powerful Protocol-Oriented Programming.

Mixin ?? Why? Swift is Protocol-Oriented Programming, and it's more powerful by default implementations of extensions of protocols. You can mixin meth

Wan-Huang Yang 45 Dec 28, 2021
Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it.

SwiftUI TagView Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it. Usage: Just copy the

Ahmadreza 16 Dec 28, 2022
🏞 A simple iOS photo and video browser with optional grid view, captions and selections written in Swift5.0

Introduction ?? MediaBrowser can display one or more images or videos by providing either UIImage objects, PHAsset objects, or URLs to library assets,

Kyle Yi 631 Dec 29, 2022
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.5k Jan 5, 2023
TSnackBarView is a simple and flexible UI component fully written in Swift

TSnackBarView is a simple and flexible UI component fully written in Swift. TSnackBarView helps you to show snackbar easily with 3 styles: normal, successful and error

Nguyen Duc Thinh 3 Aug 22, 2022
TDetailBoxView is a simple and flexible UI component fully written in Swift

TDetailBoxView is a simple and flexible UI component fully written in Swift. TDetailBoxView is developed to help users quickly display the detail screen without having to develop from scratch.

Nguyen Duc Thinh 2 Aug 18, 2022
TSwitchLabel is a simple and flexible UI component fully written in Swift.

TSwitchLabel is a simple and flexible UI component fully written in Swift. TSwitchLabel is developed for you to easily use when you need to design a UI with Label and Switch in the fastest way without having to spend time on develop from scratch.

Nguyen Duc Thinh 2 Aug 18, 2022
A simple and elegant UIKit for iOS.

HamsterUIKit A simple and elegant UIKit(Chart) for iOS, written in Swift. ?? Curve and bar Charts. ?? Protocols are designed based on UIKit(UITableVie

Howard Wang 30 Oct 2, 2022
Swift based simple information view with pointed arrow.

InfoView View to show small text information blocks with arrow pointed to another view.In most cases it will be a button that was pressed. Example To

Anatoliy Voropay 60 Feb 4, 2022
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift

SKPhotoBrowser Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift features Display one or more images by providi

keishi suzuki 2.4k Jan 6, 2023
🍞 Toast for Swift - Toaster Android-like toast with very simple interface

Toaster Android-like toast with very simple interface. (formerly JLToast) Screenshots Features Queueing: Centralized toast center manages the toast qu

Suyeol Jeon 1.6k Jan 3, 2023
Simple battery shaped UIView

BatteryView Simple battery shaped UIView. Usage let batteryView = BatteryView(frame: smallRect) batteryView.level = 42 // anywhere in 0...100 batteryV

Yonat Sharon 50 Sep 19, 2022
A simple, customizable view for efficiently collecting country information in iOS apps.

CountryPickerView CountryPickerView is a simple, customizable view for selecting countries in iOS apps. You can clone/download the repository and run

Kizito Nwose 459 Dec 27, 2022
Simple parallax header for UIScrollView

MXParallaxHeader ⚠️ This project is no longer maintained, see #124 ⚠️ MXParallaxHeader is a simple header class for UIScrollView. In addition, MXScrol

Maxime Epain 1.7k Dec 9, 2022