Base types for theming an app.

Overview

CostumeKit 🎩

Base types for theming an app.

CostumeKit is made of up a set of Swift protocols. They are meant to be implemented by you in your app.

Featured in Little Bites of Cocoa Bite #270: Implementing Theming with CostumeKit

Color 🎨

Includes Color and ColorPalette protocols.

Usage:

public enum MyAppColors : Color, ColorPalette {
  case white = "FFFFFF"
  case lightTeal = "3CB39E"
  case forestGreen = "216055"
  case black = "000000"
}

Font 🔠

Includes Font protocol, and one concrete SystemFont implementation for iOS system fonts.

Usage:

public struct MyAppFont : Font {
  public init(size: FontSize = .textStyle(.body)) {
    self.size = size
  }

  // Font

  public var size: FontSize

  // FontConvertible

  public var FontValue: UIFont {
    return UIFont(name: "SomeCustomFont", size: pointSize)!
  }
}

SVG 🌠

Includes SVG Protocol and SVGMetadata type.

Usage:

enum MyAppSVGs {
  case clockGlyph
  case bird
}

extension MyAppSVGs : SVG {
  public func metadata() -> SVGMetadata {
    switch self {
      case .clockGlyph: return SVGMetadata(name: "clock", size: CGSize(width: 100, height: 100), fullColor: false)
      case .bird: return SVGMetadata(name: "bird", size: CGSize(width: 58, height: 28), fullColor: true)
    }
  }
}

What you do with SVGMetadata is up to you. I recommend SwiftSVG from Michael Choe. Read more here to learn how to use it.

CostumeKit's goals are to be a generic solution, so no assumptions are made about how something should be retrieved from disk, parsed, etc. You'll need to implement these anyways, so nothing is forced on you.

Costume 🎩

Includes Costume protocol. Usage:

open class MyAppCostume : Costume {
  let spacing = CGFloat(8)

  public func wearRootBackground(_ view: UIView) {
    view.backgroundColor = Color.black.colorValue
  }

  public func wearHeadline(_ label: UILabel) {
    label.font = MyAppFont(size: .textStyle(.title1)).fontValue
    label.textColor = MyAppColors.forestGreen.colorValue
  }

  public var name: String { return "Default" }
  public var description: String { return "The default costume." }

  public init() { }
}

Cheers.

You might also like...
Repository with base samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Includes steps for encoding and packaging your own test content.

Video Everything Repository with minimal samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Content and License All t

A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.

MJExtension A fast, convenient and nonintrusive conversion framework between JSON and model. 转换速度快、使用简单方便的字典转模型框架 📜 ✍🏻Release Notes: more details Co

ARKit Base Project. Place virtual objects based on WWDC example project
ARKit Base Project. Place virtual objects based on WWDC example project

ARKit - Placing Virtual Objects in Augmented Reality Learn best practices for visual feedback, gesture interactions, and realistic rendering in AR exp

Handles some of the base configuration to make creating a UIAlertController with text entry even easier. Plus validation!
Handles some of the base configuration to make creating a UIAlertController with text entry even easier. Plus validation!

🍅 FancyTextEntryController A simpler/easier API for adding text fields to UIAlertControllers. Not a custom view, just uses good ol' UIAlertController

RandMyMod base on your own struct or class create one or a set of instance, which the variable's value in the instance is automatic randomized.
RandMyMod base on your own struct or class create one or a set of instance, which the variable's value in the instance is automatic randomized.

RandMyMod is an IOS Native Framework helps you generate one or a set of variable base on your own model. No matter your model is Class / Struct. Insta

Globant iOS Academy Base Project
Globant iOS Academy Base Project

The repository will be used for trainees to save course progress.

libuv base Swift web HTTP server framework

Notice Trevi now open a Trevi Community. Yoseob/Trevi project split up into respective Trevi, lime, middlewares and sys packages at our community. If

Base view Ctl

YoViewCtl Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation YoViewCt

An auto-layout base UITextView subclass which automatically grows with user input and can be constrained by maximal and minimal height - all without a single line of code

Deprecated This library is no longer maintained and is deprecated. The repository might be removed at any point in the future. MBAutoGrowingTextView A

Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. (Pure Swift, Supports Linux)

SwiftFoundation Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. Goals Provide a cross-platform in

A Kotlin multiplatform base project
A Kotlin multiplatform base project

PraxisKMM Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear OS,. Currently running on Android (Jetpack Compose) 🚧

Uuid-shortener - UUID shortening to any base, for usage in urls

UUIDShortener Allow to shorten UUID, specially when using in URLs ; along with V

BaseTableViewOriginal - Base TableView Original With Swift

BaseTableViewOriginal Example To run the example project, clone the repo, and ru

Docker images for Swift on Raspberry Pi and other ARM devices from balena's base images.

Swift on Balena Welcome to Swift on Balena – a set of Docker images for Swift on Raspberry Pi and other ARM devices. These images are based on balena'

A simplest & base on protocol & swifty way to browse photo or video with hero animation.
A simplest & base on protocol & swifty way to browse photo or video with hero animation.

JFHeroBrowser Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation JFHe

Base project for Devpass' Dev Sprints
Base project for Devpass' Dev Sprints

MVVM Challenge - Chuck Norris App 💪 In this challenge, we will apply MVVM architecture concepts to finalize the implementation of an iOS application.

Base projects for Devpass' Dev Sprints
Base projects for Devpass' Dev Sprints

Animations Challenge - Finance App 💰 In this challenge, you will develop micro-interactions, screen transitions, and reusable animations with best pr

Base projects for Devpass' Dev Sprints

Modularization Challenge - iOS ⚙️ In this challenge, we will refactor an iOS application separating the functionality into independent, interchangeabl

Base projects for Devpass' Dev Sprints

Reactive Challenge - iOS ⚡️ In this challenge, we will refactor an iOS application using Reactive Programming. Contributing Fork and clone this reposi

Owner
Jake Marsh
iOS Developer, Designer, Writer. I make littlebitesofcocoa.com, deallocatedobjects.com, conditionsapp.com.
Jake Marsh
iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion. You can use this app for learning purpose. You can use this app as a templet of any event related app.

technex-ios iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion for some reasons. You can use this app for learning purpo

Jogendra 12 May 9, 2022
System Color Picker - The macOS color picker as an app with more features

System Color Picker The macOS color picker as an app with more features Download Requires macOS 11 or later. Features Quickly copy, paste, and convert

Sindre Sorhus 758 Dec 24, 2022
An open-source colour picker app for macOS

An open-source colour picker app for macOS

Charlie Gleason 1.1k Dec 27, 2022
Base types for theming an app.

CostumeKit ?? Base types for theming an app. CostumeKit is made of up a set of Swift protocols. They are meant to be implemented by you in your app. F

Jake Marsh 301 Nov 21, 2022
An unintrusive & light-weight iOS app-theming library with support for animated theme switching.

Gestalt Gestalt is an unintrusive and light-weight framework for application theming with support for animated theme switching. Usage Let's say you wa

Vincent Esche 327 Nov 8, 2022
Turbo-iOS base project that's entirely driven from your backend Rails app.

Turbo-iOS base project that's entirely driven from your backend Rails app.

Dale Zak 109 Dec 11, 2022
Projeto base de uma app de Delivery utilizado nas Sprints da Devpass.

Delivery App Challenge ?? Neste desafio, implementaremos uma app de Delivery em equipe, dividindo tarefas e seguindo todas as boas práticos de desenvo

Devpass 7 Dec 21, 2022
SwiftAudioPlayer - Swift-based audio player with AVAudioEngine as its base

SwiftAudioPlayer Swift-based audio player with AVAudioEngine as its base. Allows for: streaming online audio, playing local file, changing audio speed

null 417 Jan 7, 2023
libuv base Swift web HTTP server framework

Notice Trevi now open a Trevi Community. Yoseob/Trevi project split up into respective Trevi, lime, middlewares and sys packages at our community. If

leeyoseob 46 Jan 29, 2022
Uncomplicated cryptography frameworks base on CommonCrypto

Keys - Keys of data encryption 中文介绍 Example let password = Password("Secret") let key = SymmetricKey() password.encrypt(data) let data = "Hello Wo

Xingzhi Zheng 47 Jun 12, 2022