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 | |
// ViperAsyncIssue | |
// | |
// Created by Tomoya Hirano on 2019/09/27. | |
// Copyright © 2019 Tomoya Hirano. All rights reserved. | |
// | |
import UIKit |
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
let unified = "0023-FE0F-20E3" | |
var emoji = unified | |
.split(separator: "-") | |
.compactMap { Int($0, radix: 16) } | |
.compactMap { Unicode.Scalar($0) } | |
.reduce(into: "", { $0.append(String($1)) }) |
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
App Store Connect: Version (.+?) \((.+?)\) for (.+?) has completed processing.$ |
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 Item: Identifiable { | |
let id: String | |
} | |
struct ContentView : View { | |
@State var item: Item? = nil | |
var body: some View { |
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 Accelerate | |
/// This object provides easy color sampling of the `capturedImage` property of an ARFrame. | |
/// | |
/// - Warning: This class is NOT thread safe. The `rawRGBBuffer` property is shared between instances | |
/// and will cause a lot of headaches if 2 instances try to simultaneously access it. | |
/// If you need multi-threading, make the shared buffer an instance property instead. | |
/// Just remember to release it when you're done with it. | |
class CapturedImageSampler { |
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
```main.swift | |
import Foundation | |
print("a".appending("b")) | |
``` | |
``` | |
$ swift main.swift | |
Stack dump: | |
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret main.swift -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -color-diagnostics -module-name main |
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 Unity: UnityFrameworkListener { | |
static let shared = Unity() | |
private let unityFramework: UnityFramework | |
var view: UIView { unityFramework.appController()!.window } | |
override init() { | |
let frameworkPath = Bundle.main.bundlePath.appending("/Frameworks/UnityFramework.framework") | |
let bundle = Bundle(path: frameworkPath)! | |
unityFramework = bundle.principalClass!.getInstance() | |
super.init() |
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 | |
import Vision | |
class ViewController: UIViewController { | |
lazy var device = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front)! | |
lazy var input = try! AVCaptureDeviceInput(device: device) | |
lazy var output = AVCaptureVideoDataOutput() | |
lazy var session = AVCaptureSession() | |
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
extension Result { | |
init(_ successValue: Success?, _ failureValue: Failure?) { | |
if let failureValue = failureValue { | |
self = .failure(failureValue) | |
} else if let successValue = successValue { | |
self = .success(successValue) | |
} else { | |
preconditionFailure() | |
} | |
} |