Skip to content

Instantly share code, notes, and snippets.

View notoroid's full-sized avatar

Kaname Noto notoroid

View GitHub Profile
@notoroid
notoroid / 03_motion-tabbar.swift
Last active January 14, 2021 05:43
Building a Beautiful Animated Motion Tab Bar Widget With SwiftUI.
import SwiftUI
struct TopFrameView: Shape {
func path(in rect: CGRect) -> Path {
let bezierPath = UIBezierPath()
bezierPath.move(to: CGPoint(x: 53.22, y: 4.36))
for (to, controlPoint1, controlPoint2) in [(CGPoint(x: 60.83, y: 13.06), CGPoint(x: 57.76, y: 7.77), CGPoint(x: 60.14, y: 11.68)), (CGPoint(x: 68.43, y: 22.84), CGPoint(x: 63, y: 17.4), CGPoint(x: 65.05, y: 20.96)), (CGPoint(x: 75.16, y: 23.98), CGPoint(x: 70.49, y: 23.98), CGPoint(x: 75.16, y: 23.98))] {
bezierPath.addCurve(to: to, controlPoint1: controlPoint1, controlPoint2: controlPoint2)
}
bezierPath.addLine(to: CGPoint(x: 0.84, y: 23.98))
@notoroid
notoroid / 02_ArchiveBench.swift
Created January 3, 2021 06:39
Apple M1 chip archive benchmark for macOS app
import SwiftUI
import Combine
import AppleArchive
import System
enum ArchiveBenchResult {
case failureError(error: Error)
case notExistsSourceFile
case notOpenReadFileStream
case notOpenWriteFileStream
@notoroid
notoroid / 01_sf-symbols-sample.swift
Last active December 30, 2020 05:25
SFSymbolsSample for SwiftUI
import SwiftUI
import DeviceGuru
enum DeviceStyleIcon: String {
case phoneHome = "phh" // iPhone and iPod touch devices with homebutton
case phone = "ph" // iPhone
case padHome = "pah" // iPad witn homebutton
case pad = "pa" // iPad
case none = "n" // none (AppleWatch, appleTV, mac)
}