Skip to content

Instantly share code, notes, and snippets.

View izakpavel's full-sized avatar

Pavel Zak izakpavel

View GitHub Profile
@izakpavel
izakpavel / LightningView.swift
Created December 3, 2020 07:34
Lightnings in SwiftUI
//
// Lightnings fun
//
// BEWARE highly unoptimized!
//
// Created by Pavel Zak on 30/11/2020.
//
import SwiftUI
@izakpavel
izakpavel / RotatorView.swift
Created November 18, 2020 09:08
a SwiftUI recreation of an interesting animation by @beesandbombs
//
// RotatorView.swift
//
// Created by Pavel Zak on 16/11/2020.
// original idea by: https://twitter.com/beesandbombs/status/1326312738033983489?s=20
//
import SwiftUI
func pow(_ x: Int, _ y: Int) -> Int {
@izakpavel
izakpavel / KaleidoscopeView.swift
Created January 21, 2021 05:33
An animation with a kaleidoscope effect
import SwiftUI
struct HalfShape: Shape {
let left: Bool
func path(in rect: CGRect) -> Path {
return Path { path in
let width = rect.width
let height = rect.height
@izakpavel
izakpavel / AnimatablePairWithAnimatableVector.swift
Last active February 11, 2022 16:28
Mixing custom AnimatableVector in AnimatablePair
//
// Mixing custom AnimatableVector in AnimatablePair
//
// Created by Pavel Zak on 26/05/2020.
// Copyright © 2020 Pavel Zak. All rights reserved.
//
import SwiftUI
struct AnimatableVector2D: VectorArithmetic {
//
// AnimatableVector2D.swift
//
// this is derivation of generic AnimatableVector presented at: https://nerdyak.tech/development/2020/01/12/animating-complex-shapes-in-swiftui.html
//
// Created by Pavel Zak on 18/05/2020.
//
import SwiftUI
@izakpavel
izakpavel / Year2021View.swift
Created December 31, 2020 09:22
2021 WELCOME
import SwiftUI
struct CircularEffect: AnimatableModifier {
var param: CGFloat
let count: Int
let radius: CGFloat
var animatableData: CGFloat {
get { return param }
set { param = newValue }
}
//
// AnimatableVector.swift
//
// usage and explanation at: https://nerdyak.tech/development/2020/01/12/animating-complex-shapes-in-swiftui.html
//
// Created by Pavel Zak on 10/01/2020.
// Copyright © 2020 Pavel Zak. All rights reserved.
//
import SwiftUI
@izakpavel
izakpavel / LoadingIndicatorAppleEventStyle.swift
Created October 2, 2020 10:07
A loading indicator in the style of this years Apple Event animation. Created for the first #SwiftUIWeeklyChallenge
//
// ContentView.swift
// SwiftUIWeeklyChallenge01
//
// Created by @myridiphis on 02/10/2020.
//
// not very tidy, but enjoy changing many of magical constants
import SwiftUI
@izakpavel
izakpavel / .lldbinit
Created April 16, 2020 10:25
example of a custom lldb command that prints Data as String
# example of a custom lldb command that prints Data as String
# store in your home (~) directory
command regex printData 's/(.+)/expr print(String(data: %1, encoding: .utf8))/'