This file contains hidden or 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
using (var blendShapes = subsystem.GetBlendShapeCoefficients(face.trackableId, Allocator.Temp)) { | |
foreach (var blendShape in blendShapes) { | |
var location = blendShape.blendShapeLocation.ToString(); | |
var key = new BlendShapeKey(location); | |
blendShapeProxy.AccumulateValue(key, blendShape.coefficient); | |
} | |
} |
This file contains hidden or 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 AVFoundation | |
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate { | |
lazy var session: AVCaptureSession = .init() | |
lazy var input: AVCaptureDeviceInput = try! AVCaptureDeviceInput(device: device) | |
lazy var device: AVCaptureDevice = AVCaptureDevice.default(for: .video)! | |
lazy var output: AVCaptureVideoDataOutput = .init() | |
override func viewDidLoad() { |
This file contains hidden or 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
name: Broadcast | |
configs: | |
Debug: debug | |
Release: release | |
targetTemplates: | |
Project: | |
platform: iOS | |
deploymentTarget: "14.0" | |
settings: | |
base: |
This file contains hidden or 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 ContentView: View { | |
@ObservedObject var vm: VM = .init() | |
var body: some View { | |
NavigationView { | |
List(vm.items, rowContent: { (item) in | |
NavigationLink( | |
destination: DestinationView(vm: vm), |
This file contains hidden or 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
struct State { | |
var title: String | |
init(hash: Int) { | |
// speacialTextが二箇所で使われてしまい、改修時に漏れそう | |
// またreducer以外の場所でロジックが実行されているので気持ち悪い | |
title = specialText(hash: hash) | |
} | |
} |
This file contains hidden or 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
class ViewController: UIViewController { | |
static let dispatchQueue = DispatchQueue(label: "test") | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
ViewController.dispatchQueue.async { | |
Thread.current.name = "test thread" | |
print("done") | |
} | |
} |
This file contains hidden or 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 | |
// a | |
// | |
// Created by Tomoya Hirano on 2021/06/15. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
This file contains hidden or 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
if (arFaceManager.subsystem is ARKitFaceSubsystem subsystem) { | |
using(var blendShapes = subsystem.GetBlendShapeCoefficients(face.trackableId, Allocator.Temp)) { | |
view.SetBlendShapes(blendShapes); | |
} | |
} | |
private void SetBlendShapes(NativeArray < ARKitBlendShapeCoefficient > blendShapes) { | |
foreach(var blendShape in blendShapes) { | |
float x = 0.0 f; | |
float fixedCoefficient = 0.0 f; |
This file contains hidden or 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
// swift-tools-version:5.5 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "AppPackage", | |
platforms: [.iOS(.v15)], | |
products: [ | |
.library(name: "AppModule", targets: ["AppModule", "DebugMenuModule"]), |