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
  • 23:21 (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)
}
/* CFCGTypes.h
Copyright (c) 1998-2021, Apple Inc. and the Swift project authors
Portions Copyright (c) 2014-2021, Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
*/
#if !defined(__COREFOUNDATION_CFCGTYPES__)
@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 / Sample.json
Created April 4, 2021 03:07
Jazzy file exported
{
"key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
"key.length" : 8102,
"key.offset" : 0,
"key.substructure" : [
{
"key.kind" : "source.lang.swift.syntaxtype.comment.mark",
"key.length" : 18,
"key.namelength" : 0,
"key.nameoffset" : 0,
@startuml
[Player] << Public >>
[Player] --> PlaybackProtocol
[Player] --> PlayerViewControllerProtocol
[Player] --> ContainerProtocol
[Player] *-- [RootViewController]
PlaybackProtocol -- [Playback]
import Clappr
import UIKit
class UIPlaybackTypePlugin: UICorePlugin {
override class var name: String { "UIPlaybackTypePlugin" }
private var label: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false