Skip to content

Instantly share code, notes, and snippets.

@arpitdsoni
arpitdsoni / asset-names-swift5.stencil
Created December 4, 2020 14:52
SwiftGen asset names template
// swiftlint:disable all
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
{% if catalogs %}
{% set enumName %}{{param.enumName|default:"AssetNames"}}{% endset %}
{% set forceNamespaces %}{{param.forceProvidesNamespaces|default:"false"}}{% endset %}
{% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %}
{% macro enumStringsBlock assets %}
{% for asset in assets %}
{% if asset.type != "group" %}
@arpitdsoni
arpitdsoni / PlaceHolderTextEditor.swift
Created February 22, 2021 01:03
SwiftUI TextEditor with placeholder and border.
struct PlaceHolderTextEditor: View {
let placeholder: String
@Binding var text: String
var body: some View {
ZStack(alignment: Alignment(horizontal: .leading, vertical: .top)) {
if text.isEmpty {
Text(placeholder)
.foregroundColor(Color(.label))
.padding(.top, 10)
}