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 | |
struct Response: Decodable { | |
let main: Main | |
struct Main: Decodable { | |
let sub: Sub | |
struct Sub: Decodable { | |
let a: UInt |
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 String { | |
/// String[index] | |
/// | |
/// - Parameter i: Index of String | |
public subscript(i: Int) -> String { | |
let index = self.index(startIndex, offsetBy: i) | |
return String(self[index]) | |
} |
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 | |
var total: String = "" | |
for i: UInt8 in 0...255 { | |
let data1: [UInt8] = [i] | |
let value = Data.init(bytes: data1) | |
let char = String.init(data: value, encoding: .utf8) | |
if let char = char { | |
total += char | |
} |
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 | |
enum PresentDestination { | |
case viewControllerA | |
case viewControllerB(content: Content) | |
var viewController: UIViewController { | |
switch self { | |
case .viewControllerA: | |
return ViewControllerA.initiateWithNavigation() |
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
// 1ファイルで両方書いてある場合、Build成功 | |
// 1ファイル1Protocolで書いてある場合、Build失敗 | |
protocol ViewProtocol: class { | |
associatedtype Presenter: PresenterProtocol | |
var presenter: Presenter! { get } | |
} | |
protocol PresenterProtocol: class { | |
associatedtype View: ViewProtocol | |
weak var view: View? { 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
// Xcode 9.3.1のプロジェクト | |
// build時はiPhone 8 Plusを選択していた | |
// | |
Akari% simulators --project SimTest9.3.xcodeproj --scheme SimTest9.3 --beforeClean true --devices iPhone SE,iPhone X,iPhone 9 Plus,iPhone 4s --osVersion 9.3,11.3 | |
=== start === | |
Build settings from command line: | |
SDKROOT = iphonesimulator11.3 | |
=== BUILD TARGET SimTest9.3 OF PROJECT SimTest9.3 WITH CONFIGURATION Debug === |
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
999277% simulators --project HogeApp.xcodeproj --scheme HogeApp --beforeClean true --devices "iPhone X" --osVersion 11.2 --showBuildLog true | |
Build settings from command line: | |
SDKROOT = iphonesimulator11.3 | |
Build Preparation | |
Build task concurrency set to 2 via user default IDEBuildOperationMaxNumberOfConcurrentCompileTasks | |
=== BUILD TARGET HogeApp OF PROJECT HogeApp WITH CONFIGURATION Debug === | |
Check dependencies |
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 | |
final class CircleLineGraphView: UIView { | |
private enum CircleType { | |
case background | |
case main(percentage: CGFloat) | |
} | |
private enum CircleAlignment { | |
case outside | |
case center |
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 | |
let youtubeURLs: [String] = [ | |
"https://www.youtube.com/get_video_info?video_id=e0okrDbEsXM", | |
"https://www.youtube.com/get_video_info?video_id=Dwh9hpBWtYQ", | |
"https://www.youtube.com/get_video_info?video_id=aNyNLEoPx4k"//, | |
// "https://www.youtube.com/get_video_info?video_id=mM5_T-F1Yn4", | |
// "https://www.youtube.com/get_video_info?video_id=XYra2ovcWxE" | |
] |
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
final class ViewController: UIViewController { | |
// MARK: - Private Property | |
private var dependency: Int! | |
// MARK: - Initilizer | |
static func initiate(dependency: Int) -> ViewController { | |
let viewController = UIStoryboard.instantiateInitialViewController(from: self) | |
viewController.dependency = dependency | |
return viewController | |
} |
OlderNewer