Skip to content

Instantly share code, notes, and snippets.

@buh
buh / ReadFrame.swift
Last active June 6, 2024 12:32
SwiftUI view extension to read the frame and bind it to the reader.
//
// Created by Alexey Bukhtin on 26/03/2021.
//
import SwiftUI
extension View {
/// Reads the view frame and bind it to the reader.
/// - Parameters:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 21, 2024 21:39
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@vincent-peng
vincent-peng / Data+HexEncodedString.swift
Last active November 26, 2023 14:28
Convert Data to hex string in Swift
// http://stackoverflow.com/a/40089462
extension Data {
func hexEncodedString() -> String {
return map { String(format: "%02hhx", $0) }.joined()
}
}
import Foundation
extension String
{
var length: Int {
get {
return countElements(self)
}
}