Skip to content

Instantly share code, notes, and snippets.

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

noppe noppefoxwolf

🦊
きつねかわいい!!!
View GitHub Profile
import UIKit
import TwitterVideoUploader
import STTwitter
import RxSwift
import MobileCoreServices
final class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
let 👝 = DisposeBag()
override func viewDidAppear(_ animated: Bool) {
@noppefoxwolf
noppefoxwolf / file0.swift
Created July 25, 2017 09:56
UITableViewの最後のセルのIndexPathを見つける ref: http://qiita.com/noppefoxwolf/items/05c4028d0c3fb6b44fef
extension UITableView {
var lastIndexPath: IndexPath? {
guard let dataSource = dataSource else { return nil }
return dataSource.lastIndexPath(in: self)
}
}
extension UITableViewDataSource {
func lastIndexPath(in tableView: UITableView) -> IndexPath? {
#if TARGET_OS_SIMULATOR
#import <Metal/Metal.h>
#import <CoreVideo/CoreVideo.h>
/// CAMetalLayer
@class CAMetalLayer;
@protocol CAMetalDrawable <MTLDrawable>
@property(readonly) id <MTLTexture> texture;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>WFWorkflowActions</key>
<array>
<dict>
<key>WFWorkflowActionIdentifier</key>
<string>is.workflow.actions.getcurrentsong</string>
<key>WFWorkflowActionParameters</key>
@noppefoxwolf
noppefoxwolf / playground.swift
Created October 5, 2018 05:17
Not implementable delegate in protocol extension.
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController, Interface {
lazy var tap = UITapGestureRecognizer(target: self, action: #selector(tapped))
override func viewDidLoad() {
super.viewDidLoad()
tap.delegate = self
view.addGestureRecognizer(tap)
--------------------------------------------
//
// ObjCClass.h
// ihvaiusdhv
//
// Created by Tomoya Hirano on 2019/02/18.
// Copyright © 2019 Tomoya Hirano. All rights reserved.
//
#import <Foundation/Foundation.h>
@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)
▿ 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: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") })
@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)