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 AVFAudio | |
class MIDIFilePlayConductor: ObservableObject { | |
var midiPlayer: AVMIDIPlayer? | |
var soundfontURL: URL? = Bundle.main.url(forResource: "CT8MGM", withExtension: "sf2") | |
@Published var currentPosition: Double = 0 | |
@Published var duration: Double = 0 | |
@Published var isPlaying: Bool = false |
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 | |
struct ContinuousLongPressView: View { | |
@GestureState private var isDetectingLongPress = false | |
var longPress: some Gesture { | |
LongPressGesture(minimumDuration: 1) | |
.updating($isDetectingLongPress) { value, gestureState, _ in | |
gestureState = value | |
}.onEnded { value in |
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 | |
struct GradientProgressStyle<Stroke: ShapeStyle, Background: ShapeStyle>: ProgressViewStyle { | |
var stroke: Stroke | |
var fill: Background | |
var caption: String = "" | |
var cornerRadius: CGFloat = 10 | |
var height: CGFloat = 20 | |
var animation: Animation = .easeInOut | |
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 WebKit | |
import Combine | |
/* | |
https://stackoverflow.com/questions/66581811/call-evaluatejavascript-from-a-swiftui-button | |
*/ | |
class WebViewData: ObservableObject { | |
var functionCaller = PassthroughSubject<String, Never>() |
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
extension MKMapView { | |
/** | |
``delta`` is the zoom factor | |
- 2 will zoom out x2 | |
- .5 will zoom in by x2 | |
*/ | |
func setZoomByDelta(delta: Double, animated: Bool) { | |
var _region = region; | |
var _span = region.span; |
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
@media (prefers-color-scheme: dark) { | |
* { | |
color-scheme: light dark; | |
filter: invert(0%); | |
-webkit-filter: invert(0%) | |
} | |
img { | |
-webkit-filter: invert(1); | |
filter: invert(1); |
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
// | |
// CalendarData.swift | |
// | |
// Created by yoonbumtae on 2023/02/04. | |
// | |
import UIKit | |
enum CalendarDataError: Error { | |
case metadataGeneration |
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 | |
struct Day { | |
/// Date 인스턴스. | |
let date: Date | |
/// 화면에 표시될 숫자. | |
/// 예) Date 인스턴스가 2022년 1월 25일이라면 -> 25 | |
let number: String | |
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
// | |
// ViewController.swift | |
// MultipeerChat | |
// | |
// Created by yoonbumtae on 2023/01/08. | |
// | |
import UIKit | |
import MultipeerConnectivity |
NewerOlder