This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PlaygroundSupport | |
/// ボタン | |
struct RoundButton: View { | |
/// サイズ | |
static let size: CGSize = .init(width: 32, height: 44) | |
/// 画像 | |
let image: Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PlaygroundSupport | |
/// ボタン | |
struct RoundButton: View { | |
/// サイズ | |
static let size: CGSize = .init(width: 32, height: 32) | |
/// 画像 | |
let image: Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import PlaygroundSupport | |
/// ID | |
/// - Note: DIDかハンドル | |
let identifier = "(ID)" | |
/// パスワード | |
/// - Note: https://staging.bsky.app/settings/app-passwords で取得する | |
let appPassword = "(パスワード)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import CoreMotion | |
import PlaygroundSupport | |
struct ContentView: View { | |
/// モーションマネージャー | |
private let motionManager: CMMotionManager = .init() | |
/// 角度 | |
@State var angle: Angle = .init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import CoreMotion | |
import PlaygroundSupport | |
struct ContentView: View { | |
/// モーションマネージャー | |
private let motionManager: CMMotionManager = .init() | |
/// 加速度データ | |
@State var acceleration: CMAcceleration = .init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import Combine | |
import PlaygroundSupport | |
/// アニメーション対応のシェイプ | |
struct AnimatableShape: Shape { | |
/// ポイントデータ | |
var points: AnimatableCGPointVector | |
/// アニメーション対象 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import PlaygroundSupport | |
final class MyViewController: UIViewController { | |
override func loadView() { | |
let view = UIView(frame: .init(x: 0, y: 0, width: 375, height: 667)) | |
view.backgroundColor = .lightGray | |
self.view = view | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SeekBar.swift | |
// | |
// Created by Honma Masaru on 2023/02/12. | |
// | |
import SwiftUI | |
/// シークバー | |
struct SeekBar<Bound>: View where Bound: BinaryFloatingPoint, Bound.Stride: BinaryFloatingPoint { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import RegexBuilder | |
import PlaygroundSupport | |
enum ColorCode { | |
/// 6文字および8文字のカラーコードの正規表現 | |
/// /^#?([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})?$/ | |
private static let hexCapture = Capture { Repeat(count: 2) { .hexDigit } } | |
private static let pattern8 = Regex { | |
Optionally { "#" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// XORShiftのRandomNumberGenerator | |
// 参考: https://ja.wikipedia.org/wiki/Xorshift | |
struct XORShift: RandomNumberGenerator { | |
private var y: UInt64 | |
init(seed: UInt64 = 2463534242) { | |
y = seed > 0 ? seed : 2463534242 |
NewerOlder