Skip to content

Instantly share code, notes, and snippets.

@shirakaba
shirakaba / Creating an Expo app in 2023.md
Created July 12, 2023 08:08
Creating an Expo app in 2023

Creating an Expo app in 2023

12th July, 2023. I'm going to try creating an iOS app called Paranovel, using Expo. My environment for mobile app dev (Xcode, Ruby, etc.) should be in reasonably good shape already as I frequently develop with React Native and NativeScript.

Creating the app

Go to https://docs.expo.dev, and see the Quick Start: npx create-expo-app paranovel

This runs with no problem, then I get this macOS system popup:

import SwiftUI
struct RepeatingViews: View {
@State private var disappearEast: Bool = false
@State private var appearEast: Bool = false
@State private var moveEast: Bool = false
@State private var disappearSugarBeet: Bool = false
@State private var appearSugarBeet: Bool = false
@State private var moveSugarBeet: Bool = false
@alexwidua
alexwidua / ContentView.swift
Created July 4, 2023 17:07
SwiftUI Grid Animation
import SwiftUI
// 1. Use looped H/VStacks to create a grid
// 2. Conditionally increase spacing to grow/shrink the grid
// 3. Calculate the distance of each dot to the center and use the value to stagger the animation
//4. Add random delay on top of the staggered delay value
struct ContentView: View {
// const & state
@nilshoenson
nilshoenson / Shader.metal
Last active August 25, 2024 07:19
A wave animation built with shaders in SwiftUI.
#include <metal_stdlib>
#include <SwiftUI/SwiftUI_Metal.h>
using namespace metal;
// Create a horizontal bar
float bar(vector_float2 uv, float start, float height) {
return step(uv.y, height + start) - step(uv.y, start);
}
// Create waves animation using GLSL

概要

  • やりたいことは、コマンドをasyncで非同期に呼び出せるようすること。
    • バックグラウンドで処理を実行させ、キャンセルボタンで処理を中断できるようにする

image

問題点

  • 問題として、xcodebuildを行ったときに処理が完了しないが
  • 具体的にはprocess.isRunningfalseにならない
@Koshimizu-Takehito
Koshimizu-Takehito / メタボールっぽいやつ2.swift
Created May 7, 2023 03:23
メタボールっぽいやつ2.swift
import SwiftUI
import Combine
extension ParticlesView {
init(count: Int) {
self.init(scales: Array(repeating: false, count: count))
}
}
struct ParticlesView: View {
struct AfterFiveIntroAnimation: View {
@State private var appearText = false
@State private var goLeft = false
@State private var goRight = false
@State private var showStartPageScreen = false
@Namespace var startPageAppear
var body: some View {
VStack {
@SwiftyAlex
SwiftyAlex / whatnotview.swift
Last active February 18, 2023 18:21
lil animation ❤️
import SwiftUI
struct WhatNotView<
OffCircleContent: View,
OnCircleContent: View,
OffTrailingContent: View,
OnTrailingContent: View
>: View {
@State var toggle: Bool = false
@ScaledMetric var scale: CGFloat = 1
//
// Blobs.swift
// SwiftUI Demos
//
// Created by Morten Just on 1/31/23.
//
import SwiftUI
struct Blobs: View {
//
// DarkModeMasker.swift
// SwiftUI Demos
//
// Created by Morten Just on 1/22/23.
// https://twitter.com/joshguospace/status/1617101052192649216?s=12
import SwiftUI
import Charts