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
// | |
// CalendarUtil.swift | |
// Musubi | |
// | |
// Created by はるふ on 2016/10/26. | |
// Copyright © 2016年 はるふ. All rights reserved. | |
// | |
import Foundation |
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 | |
enum Optional<T> { | |
case none | |
case some(T) | |
init() { | |
self = .none | |
} | |
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
MIT License | |
Copyright (c) 2017 はるふ(ha1f) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
// | |
// PlaceHolderedTextView.swift | |
// Musubi | |
// | |
// Created by はるふ on 2016/11/29. | |
// Copyright © 2016年 はるふ. All rights reserved. | |
// | |
import UIKit |
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 | |
import UIKit | |
private func arrayBetween(_ c1: String, _ c2: String) -> [UInt32] { | |
guard let s1 = c1.unicodeScalars.first?.value, | |
let s2 = c2.unicodeScalars.first?.value else { | |
return [] | |
} | |
return (s1 < s2 ? (s1...s2) : (s2...s1)).map { $0 } | |
} |
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
// | |
// LanguageDetector(Swift3.x).swift | |
// Musubi | |
// | |
// Created by はるふ on 2017/07/12. | |
// Copyright ©ha1f 2017年 line. All rights reserved. | |
// | |
import Foundation |
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
// | |
// Rgba.swift | |
// ha1f-chat | |
// | |
// Created by ST20591 on 2017/07/19. | |
// Copyright © 2017年 ha1f. All rights reserved. | |
// | |
import UIKit |
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 Dictionary { | |
func duplicated() -> Dictionary<Key, Value> { | |
return reduce(into: [Key: Value]()) { (dict, item) in | |
dict[item.key] = item.value | |
} | |
} | |
} |
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 UIViewController { | |
private class ExtendedBottomView: UIView { } | |
/// Create bottom View which covers from bottom of the screen to the | |
/// bottom edge of the bottomAccessoryView. | |
/// (useful on iPhone X only) | |
/// Make sure not to call more than once (typically, on viewDidLoad), | |
/// and bottomAccessoryView has added as subview. | |
/// | |
/// - parameter bottomAccessoryView: a target View to decide the |
OlderNewer