Skip to content

Instantly share code, notes, and snippets.

View c-villain's full-sized avatar
🎸
🤟🏻

Alexander Kraev c-villain

🎸
🤟🏻
View GitHub Profile
@c-villain
c-villain / progressLoader.txt
Last active September 15, 2023 07:27
progress loader
//
// ProgressNew.swift
// Test2
//
// Created by Alexander Kraev on 14.09.2023.
//
import SwiftUI
struct ProgressNew: View {
@c-villain
c-villain / MemoryAddress.swift
Created January 10, 2023 22:16 — forked from nyg/MemoryAddress.swift
Get the memory address of both class and structure instances in Swift.
// https://stackoverflow.com/a/45777692/5536516
import Foundation
struct MemoryAddress<T>: CustomStringConvertible {
let intValue: Int
var description: String {
let length = 2 + 2 * MemoryLayout<UnsafeRawPointer>.size
@c-villain
c-villain / ContentView.swift
Created January 5, 2022 22:01
List vs LazyVStack
//
// ContentView.swift
// ListVsLazyVStack
//
// Created by Alexander Kraev on 05.01.2022.
//
import SwiftUI
@main
@c-villain
c-villain / Frame.swift
Created December 30, 2021 21:13
Must-have SwiftUI frame extensions
extension View {
// MARK: Vertical Center
func vCenter() -> some View {
self
.frame(maxHeight: .infinity, alignment: .center)
}
// MARK: Vertical Top
func vTop() -> some View {