Worth a read for some more context.
Create the file in the root of the project (where your Package.swift
file lives as well), and use the following contents:
/// Package.xcconfig
// swift-tools-version:4.0 | |
import PackageDescription | |
#if os(Linux) | |
import Glibc | |
#else | |
import Darwin.C | |
#endif | |
enum Enviroment: String { |
Worth a read for some more context.
Create the file in the root of the project (where your Package.swift
file lives as well), and use the following contents:
/// Package.xcconfig
import UIKit | |
import AVFoundation | |
var tb = mach_timebase_info() // イニシャライザ | |
mach_timebase_info(&tb) // こっちは関数呼び出し | |
let tsc = mach_absolute_time() | |
let t = Double(tsc) * Double(tb.numer) / Double(tb.denom) / 1000000000.0 | |
let seconds = AVAudioTime.seconds(forHostTime: tsc) | |
let cmtime = CMTime(seconds: seconds, preferredTimescale: 1000000000) |
import Darwin.C | |
import Dispatch | |
signal(SIGINT, SIG_IGN) | |
let source = DispatchSource.makeSignalSource(signal: SIGINT, queue: .main) | |
var count = 0 | |
source.setEventHandler { |
// Advanced SwiftUI Transitions | |
// https://swiftui-lab.com | |
// https://swiftui-lab.com/advanced-transitions | |
import SwiftUI | |
struct CrossEffectDemo: View { | |
let animationDuration: Double = 2 | |
let images = ["photo1", "photo2", "photo3", "photo4"] | |
@State private var idx = 0 |
import Foundation | |
import AVFoundation | |
import CoreMedia | |
class Converter { | |
static func configureSampleBuffer(pcmBuffer: AVAudioPCMBuffer) -> CMSampleBuffer? { | |
let audioBufferList = pcmBuffer.mutableAudioBufferList | |
let asbd = pcmBuffer.format.streamDescription | |
var sampleBuffer: CMSampleBuffer? = nil |
/// This code defines an init method for the Binding type. This method accepts three parameters: | |
/// | |
/// An object of any type T | |
/// A key path to a property of type Value on that object | |
/// An optional UndoManager object | |
/// | |
/// The init method sets the Binding value to the value of the property specified by the key path. It also sets the set value of the Binding to a closure that updates the value of the property at the key path and registers an undo operation with the provided UndoManager, if one is given. | |
/// | |
/// This allows the Binding object to be used to access and update the value of the specified property on the provided object, and to register undo operations for those updates with the UndoManager. |