Skip to content

Instantly share code, notes, and snippets.

View helbertgs's full-sized avatar
🏠
Working from home

Helbert Gomes helbertgs

🏠
Working from home
  • Waterloo, Ontario - CA
  • 01:14 (UTC -04:00)
  • X @helbertgs
View GitHub Profile
@helbertgs
helbertgs / ContentView.swift
Created October 10, 2023 03:14 — forked from chriseidhof/ContentView.swift
Variadic Views
import SwiftUI
struct MyValue: _ViewTraitKey {
static var defaultValue: Int = 0
}
extension View {
func myValue(_ value: Int) -> some View {
_trait(MyValue.self, value)
}
@helbertgs
helbertgs / HowTo use xcconfig or plist with SPM.md
Created November 10, 2022 18:36 — forked from 4np/HowTo use xcconfig or plist with SPM.md
How to use a .xcconfig file and a .plist with a Swift Package Manager based project.

How to use a .xcconfig file and a .plist file with SPM

Worth a read for some more context.

Create a Package.xcconfig file

Create the file in the root of the project (where your Package.swift file lives as well), and use the following contents:

/// Package.xcconfig
@helbertgs
helbertgs / Makefile
Created August 22, 2022 12:34 — forked from uhooi/Makefile
Makefile for iOS App development
PRODUCT_NAME := Foo
SCHEME_NAME := ${PRODUCT_NAME}
WORKSPACE_NAME := ${PRODUCT_NAME}.xcworkspace
UI_TESTS_TARGET_NAME := ${PRODUCT_NAME}UITests
TEST_SDK := iphonesimulator
TEST_CONFIGURATION := Debug
TEST_PLATFORM := iOS Simulator
TEST_DEVICE ?= iPhone 11 Pro Max
TEST_OS ?= 13.3
@helbertgs
helbertgs / morse-code-possibilities.js
Created April 1, 2022 23:43 — forked from shalomsam/morse-code-possibilities.js
Given 3 morse code characters determines the letter associated with it. Any of the morse can be substituted for ? and this code will respond with possibilities
function possibilities (signals) {
var atoms = {
".": "E",
"-": "T",
"I": {
".": "S",
"-": "U"
},
"A": {
".": "R",
@helbertgs
helbertgs / SwiftUI Interface.swift
Created August 11, 2021 05:24 — forked from Cosmo/SwiftUI Interface.swift
SwiftUI Interface (Module Names removed)
// swift-interface-format-version: 1.0
// swift-compiler-version: Apple Swift version 5.1.1 (swiftlang-1100.2.274.2 clang-1100.2.32.1)
// swift-module-flags: -target arm64e-apple-ios13.2 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -Osize -module-name SwiftUI
import Combine
import CoreData
import CoreFoundation
import CoreGraphics
import CoreText
import Darwin
import Foundation
@helbertgs
helbertgs / SwiftUI-SymbolTable.swift
Created July 23, 2021 12:51 — forked from Cosmo/SwiftUI-SymbolTable.swift
Name List / Symbol Table of SwiftUI
(extension in :Animatable< where A.AnimatableData == EmptyAnimatableData>.animatableData.getter : EmptyAnimatableData
(extension in :Animatable< where A.AnimatableData == EmptyAnimatableData>.animatableData.modify : EmptyAnimatableData
(extension in :Animatable< where A.AnimatableData == EmptyAnimatableData>.animatableData.setter : EmptyAnimatableData
(extension in :Animatable< where A: VectorArithmetic>.animatableData.getter : A
(extension in :Animatable< where A: VectorArithmetic>.animatableData.modify : A
(extension in :Animatable< where A: VectorArithmetic>.animatableData.setter : A
(extension in :Button< where A == PrimitiveButtonStyleConfiguration.Label>.init(PrimitiveButtonStyleConfiguration) -> Button<PrimitiveButtonStyleConfiguration.Label>
(extension in :Button< where A == Text>.init(_: LocalizedStringKey, action: () -> ()) -> Button<Text>
(extension in :Button< where A == Text>.init<A where A1: StringProtocol>(_: A1, action: () -> ()) -> Button<Text>
(extension in :CoreGraphics.CGFloat.magnitudeSqu
@helbertgs
helbertgs / ExtensionCompatibleSample.swift
Created June 9, 2020 14:30 — forked from WorldDownTown/ExtensionCompatibleSample.swift
An example of Extension based on RxSwift in Swift.
public struct Extension<Base> {
public let base: Base
public init(_ base: Base) {
self.base = base
}
}
public protocol ExtensionCompatible {
associatedtype Compatible
var ex: Extension<Compatible> { get set }
@helbertgs
helbertgs / Fastfile
Created February 17, 2020 18:42 — forked from pogramos/Fastfile
Custom fastfile lanes
# Customize this file, documentation can be found here:
# https://docs.fastlane.tools/actions/
# All available actions: https://docs.fastlane.tools/actions
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane