マテリアルっぽいアニメーションをする UITableViewCell
です。
CALayer
と CAKeyframeAnimation
、 CAAnimationGroup
を使って作ってみました。
import UIKit | |
@IBDesignable | |
class TextField: UITextField { | |
// Settings | |
@IBInspectable var lineColor: UIColor = .lightGray { | |
didSet { | |
underLineView.backgroundColor = lineColor | |
} |
/// 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 { |
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 |
import Foundation | |
// MARK: - Entity | |
struct HogeEntity { | |
let title: String | |
} | |
struct FugaEntity { | |
let title: String |