- やりたいことは、コマンドをasyncで非同期に呼び出せるようすること。
- バックグラウンドで処理を実行させ、キャンセルボタンで処理を中断できるようにする
- 問題として、
xcodebuildを行ったときに処理が完了しないが - 具体的には
process.isRunningがfalseにならない
| 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 |
| import Combine | |
| import SwiftUI | |
| // MARK: - Demo View | |
| /// A demo screen showcasing the `RandomMetaball2DView`. | |
| /// | |
| /// This screen expands to fill the entire safe area. | |
| struct RandomMetaballDemoScreen: View { | |
| var body: some 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 { |
| 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 |
| const OPENAI_API_KEY = ""; // <- PASTE YOUR SECRET KEY HERE | |
| const OPENAI_API_URL = "https://api.openai.com/v1/completions"; | |
| /** | |
| * Submits a prompt to GPT-3 and returns the completion | |
| * | |
| * @param {string} prompt Prompt to submit to GPT-3 | |
| * @param {float} temperature Model temperature (0-1) | |
| * @param {string} model Model name (e.g. text-davinci-002) |
| // | |
| // Runtime.swift | |
| // Swift Runtime [Swift 4] | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal |