Skip to content

Instantly share code, notes, and snippets.

@scalbatty
scalbatty / LikeButton.swift
Created February 14, 2023 19:26
A SwiftUI button style for a toggle button with bouncy touch feedback
struct ContentView: View {
@State var isLiked: Bool = false
var body: some View {
Button {
isLiked.toggle()
} label: {
Image(systemName: isLiked ? "heart.fill" : "heart")
}
.imageScale(.large)
@scalbatty
scalbatty / AnimatedCounter.swift
Created February 14, 2023 10:25
A "rolling counter" style label
struct AnimatedCounter: Animatable, View {
var value: CGFloat = 0
var maxOffset: CGFloat = 12
var animatableData: CGFloat {
get { value }
set { value = newValue }
}
@scalbatty
scalbatty / PanelCurve.swift
Created April 9, 2018 09:11
A playground for experimenting with the "panel curve" we use at Zenly
// A playground for experimenting with the "panel curve" we use at Zenly
import UIKit
import PlaygroundSupport
// This view displays a filled "panel" curve within the given frame
final class CurvedView: UIView {
// This is the fill color for the shape
private var _color: UIColor = .white
@scalbatty
scalbatty / hack-sign-in-dependencies.sh
Created December 8, 2017 10:00
Script to build a new Google Sign in dependencies that will work with Firebase
root=$PWD
binary=GoogleSignInDependencies
signInFrameworkDir=./google_signin_sdk_4_0_1
archs=(armv7 x86_64 arm64 i386)
duplicateClasses=(GTMLogger GTMNSDictionary+URLArguments GTMSessionFetcher GTMSessionFetcherService GTMSessionUploadFetcher)
hackDir=hack
framework=$binary.framework
@scalbatty
scalbatty / Katas.md
Created January 29, 2016 09:28
The list of exercises I use for katas in my team.

Code Kata

Stay in shape!

Here are some exercises that you cas use for your Kata sessions, rank by approximate difficulty.

Thanks to Evilz for the list!

  1. FizzBuzz : very very simple exercise, but a nice way to introduce TDD in your way of solving problemns
  • FooBarQix : a beefed-up version of FizzBuzz