This file contains 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
#Atom-settings |
This file contains 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
//: Playground - noun: a place where people can play | |
import UIKit | |
func mergeSort<T: Comparable>(array: inout Array<T>, low: Int, high: Int){ | |
guard low < high else { | |
return | |
} | |
This file contains 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内 | |
// 1. ページ数 | |
let pageCount = 2 | |
// 3. StackViewの作成 | |
let contentView = UIStackView() | |
// 2. 紐づけたScroll View |
This file contains 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 PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
protocol APIClient { | |
associatedtype GetDataType | |
func get() | |
} |
This file contains 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
// | |
// TouchWebViewController.swift | |
// | |
// Created by 秋勇紀 on 2018/11/17. | |
// Copyright © 2018 勇者野良猫の部屋. All rights reserved. | |
// | |
import UIKit | |
import WebKit | |
class TouchWebViewController: UIViewController { |
This file contains 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 | |
protocol Redirectable where Self: UIViewController { | |
associatedtype Input | |
associatedtype Result | |
associatedtype Next | |
var nextVC: Next { get set } | |
func inject(input: Input) |
This file contains 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
// ペアノ自然数 | |
indirect enum N { | |
// N + 1 | |
case S(N) | |
// 0 | |
case Z | |
// デバッグ用、ペアノ自然数 -> アラビア数字 | |
func print() -> Int { | |
var selfValue: N = self |
This file contains 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 | |
// test | |
//. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
This file contains 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 SomeClass { | |
#if DEBUG | |
@available(*, deprecated, message: "Replace before releasing") | |
static func waitingReplace<X>(_ x: X) -> X { | |
return x | |
} | |
#else | |
@inline(__always) | |
@available(*, unavailable, message: "Replace before releasing") | |
static func waitingReplace<X>(_: X) -> X { |
This file contains 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 Foundation | |
class SomeCallable { | |
var completion: () -> Void = { } | |
func call(completion: @escaping () -> Void) { | |
// Do something | |
self.completion = completion | |
} | |
} | |
class SomeClass { | |
var value: Int = 1 |
OlderNewer