Skip to content

Instantly share code, notes, and snippets.

Avatar

Pavel Zak izakpavel

View GitHub Profile
@izakpavel
izakpavel / KaleidoscopeView.swift
Created Jan 21, 2021
An animation with a kaleidoscope effect
View KaleidoscopeView.swift
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
View Year2021View.swift
import SwiftUI
struct CircularEffect: AnimatableModifier {
var param: CGFloat
let count: Int
let radius: CGFloat
var animatableData: CGFloat {
get { return param }
set { param = newValue }
}
View LightningView.swift
//
// Lightnings fun
//
// BEWARE highly unoptimized!
//
// Created by Pavel Zak on 30/11/2020.
//
import SwiftUI
@izakpavel
izakpavel / RotatorView.swift
Created Nov 18, 2020
a SwiftUI recreation of an interesting animation by @beesandbombs
View RotatorView.swift
//
// 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 / LoadingIndicatorAppleEventStyle.swift
Created Oct 2, 2020
A loading indicator in the style of this years Apple Event animation. Created for the first #SwiftUIWeeklyChallenge
View LoadingIndicatorAppleEventStyle.swift
//
// ContentView.swift
// SwiftUIWeeklyChallenge01
//
// Created by @myridiphis on 02/10/2020.
//
// not very tidy, but enjoy changing many of magical constants
import SwiftUI
@izakpavel
izakpavel / AnimatablePairWithAnimatableVector.swift
Last active Feb 11, 2022
Mixing custom AnimatableVector in AnimatablePair
View AnimatablePairWithAnimatableVector.swift
//
// 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 {
View AnimatableVector2D.swift
//
// 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 / .lldbinit
Created Apr 16, 2020
example of a custom lldb command that prints Data as String
View .lldbinit
# 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))/'
View AnimatableVector.swift
//
// 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