Skip to content

Instantly share code, notes, and snippets.

View hayabusabusa's full-sized avatar
🏠
Working from home

Shunya Yamada hayabusabusa

🏠
Working from home
  • LY Corporation
  • Japan
View GitHub Profile
@hayabusabusa
hayabusabusa / README.md
Last active April 16, 2019 10:04
CALayer の練習 マテリアルデザインっぽいアニメーションをする Cell

Ripple animation UITableViewCell

マテリアルっぽいアニメーションをする UITableViewCell です。

CALayerCAKeyframeAnimationCAAnimationGroup を使って作ってみました。

@hayabusabusa
hayabusabusa / AnimationTextField.swift
Last active April 18, 2019 16:28
Animation UITextField
import UIKit
@IBDesignable
class TextField: UITextField {
// Settings
@IBInspectable var lineColor: UIColor = .lightGray {
didSet {
underLineView.backgroundColor = lineColor
}
@hayabusabusa
hayabusabusa / http_request_protocol.dart
Last active February 18, 2020 01:32
Flutter: Network Layer
/// HttpMethod:
/// リクエストのメソッドを定義
/// Enum は Swift っぽくかける Util を使用
class HttpMethod extends Enum<String> {
const HttpMethod(String val): super(val);
static const HttpMethod GET = const HttpMethod('GET');
static const HttpMethod POST = const HttpMethod('POST');
static const HttpMethod PUT = const HttpMethod('PUT');
static const HttpMethod DELETE = const HttpMethod('DELETE');
/// HttpRequest:
/// Dart の基本の Request クラスを HttpRequestProtocol で拡張したもの
class HttpRequest extends Request {
final HttpRequestProtocol service;
HttpRequest(this.service)
: super(
service.method.value,
Uri.parse('${service.baseUrl}${service.path}${service.queryParameters}')
);
//
// FirebaseProvider.swift
// MlKitSample
//
import Foundation
import Firebase
import FirebaseMLCommon
final class FirebaseMLKitProvider {
@hayabusabusa
hayabusabusa / StoryboardViewController.swift
Last active August 21, 2019 04:18
Discord ( Init ViewController )
import UIKit
final class StoryboardViewController: UIViewController {
// MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
}
}
import UIKit
final class CodeViewController: UIViewController {
// MARK: - UI
lazy var titleLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.font = UIFont.boldSystemFont(ofSize: 18)
import UIKit
import PlaygroundSupport
// MARK: - Settings
let allSize: CGFloat = 200
let radius: CGFloat = 24.0
let smallRadius: CGFloat = 20.0
let nanoRadius: CGFloat = 16.0
@hayabusabusa
hayabusabusa / BadgeButton.swift
Created October 28, 2019 08:24
バッジ付きのUIButton
import UIKit
@IBDesignable
class BadgeButton: UIButton {
// MARK: IBInspectable
@IBInspectable var cornerRadius: CGFloat = 8 {
didSet {
layer.cornerRadius = cornerRadius
@hayabusabusa
hayabusabusa / TypeErase.swift
Created March 30, 2020 09:08
Swift Type Erase test playground.
import Foundation
// MARK: - Entity
struct HogeEntity {
let title: String
}
struct FugaEntity {
let title: String