This file contains hidden or 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
enum Fruit { | |
case apple | |
case orange | |
case banana | |
case grape | |
} | |
func functionA(_ fruit: Fruit) { | |
switch fruit { | |
case .apple: |
例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
- DMM.com(旧DMM.comラボ含む)
- DMM.comラボ16新卒エンジニア研修 - (2016/08/24)
- DMM.comの新卒技術研修がスタートしました! - (2019/04/25)
- GMOインターネット
- 「Web 基礎」という講義をしました - (2019/05/17)
- GMOペパボ
- 2013 年の新卒研修メニュー
- ペパボ新卒エンジニアの研修を開始している - (2013/05)
- 第二新卒研修をしていた - (2014/08)
This file contains hidden or 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 UIImageView { | |
static let imageCache = NSCache<AnyObject, AnyObject>() | |
func setImage(fromUrl: String?) { | |
//URLがnilだった場合はdefaultの画像をセットする | |
guard let urlString = fromUrl else { | |
self.image = UIImage(named: "default") | |
return |
This file contains hidden or 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
private lazy var onlyOnceRun: (()->Void)? = { | |
//ViewDidLayoutSubviewsの中で1度だけ実行されるコード | |
print("2回目以降は出力されないよ") | |
//1度実行された直後にnilを返すため2回目以降は実行されない | |
return nil | |
}() |
This file contains hidden or 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
//HEX値でUIColorを指定できるようにする | |
extension UIColor { | |
convenience init(hexcode: String, alpha: CGFloat) { | |
let string = hexcode.replacingOccurrences(of: "#", with: "") | |
let char = string.map{ String($0) } | |
let r = CGFloat(Int(char[0]+char[1], radix:16) ?? 0) / 255.0 | |
let g = CGFloat(Int(char[2]+char[3], radix:16) ?? 0) / 255.0 | |
let b = CGFloat(Int(char[4]+char[5], radix:16) ?? 0) / 255.0 | |