Skip to content

Instantly share code, notes, and snippets.

View noppefoxwolf's full-sized avatar
🦊
きつねかわいい!!!

noppe noppefoxwolf

🦊
きつねかわいい!!!
View GitHub Profile
struct ContentView: View {
var body: some View {
NavigationView {
List {
NavigationLink(destination: Text("text")) {
Text("ok")
}
}
}
}
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 {
@noppefoxwolf
noppefoxwolf / popover.swift
Created October 22, 2019 17:56
Popover dismiss issue
import SwiftUI
struct Item: Identifiable {
let id: String
}
struct ContentView : View {
@State var item: Item? = nil
var body: some View {
@noppefoxwolf
noppefoxwolf / gist:c46d331c6ab555c45ac77d53c81610a0
Created October 19, 2019 16:30
AppStoreConnectのメールのregex
App Store Connect: Version (.+?) \((.+?)\) for (.+?) has completed processing.$
@noppefoxwolf
noppefoxwolf / emoji.swift
Last active October 14, 2019 07:19
Unified string to emoji.
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)) })
@noppefoxwolf
noppefoxwolf / gist:511a1646cd4ef53a1cbc4379a8d1b2ed
Created September 27, 2019 06:07
Generambaのswift_viperテンプレートでクラッシュするパターン
//
// ViewController.swift
// ViperAsyncIssue
//
// Created by Tomoya Hirano on 2019/09/27.
// Copyright © 2019 Tomoya Hirano. All rights reserved.
//
import UIKit
@noppefoxwolf
noppefoxwolf / gist:80c6f07c28719e0e071c4ba34e7e899a
Created September 27, 2019 05:02
Generambaのswift_viperテンプレートで起こりうるクラッシュ
class RootViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .red
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
let vc = ViewController.make()
present(vc, animated: true, completion: nil)
@noppefoxwolf
noppefoxwolf / gist:6404f2d396c7aff7638703be18369447
Created April 15, 2019 17:23
AppleMusicAPIからgolangのコード吐くやつ
import Foundation
import SwiftSoup
let base = "https://developer.apple.com"
func getURL(from url: String, viewBox: String) -> [String] {
let url = URL(string: url)!
let data = try! Data(contentsOf: url)
let doc: Document = try! SwiftSoup.parse(String(data: data, encoding: .utf8)!)
let taskTopics = try! doc.select("div").filter({ $0.hasClass("task-topic") })
▿ Swift.AnyCollection<(label: Swift.Optional<Swift.String>, value: Any)>
▿ _box: Swift._CollectionBox<Swift.LazyMapCollection<Swift.Set<__C.NSObject>, (label: Swift.Optional<Swift.String>, value: Any)>> #0
▿ super: Swift._AnyCollectionBox<(label: Swift.Optional<Swift.String>, value: Any)>
- super: Swift._AnySequenceBox<(label: Swift.Optional<Swift.String>, value: Any)>
▿ _startIndex: Swift._IndexBox<Swift.Set<__C.NSObject>.Index> #1
▿ _base: Swift.Set<__C.NSObject>.Index
▿ _value: Swift.SetIndexRepresentation<__C.NSObject>._cocoa
▿ _cocoa: Swift._CocoaSetIndex
▿ cocoaSet: 8 members #2
@noppefoxwolf
noppefoxwolf / gist:4636bdd5d542863668c04c8b0fa1b85a
Last active March 20, 2019 06:48
Swift download manager I/F 構想
enum UnZipPolicy {
case none
case unzip(isRemoveSrc: Bool)
}
let manager = Manager()
manager.maxConcurrentTasksCount = 4
manager.timeout = 150
manager.automaticallyUnzip = .unzip(isRemoveSrc: true)