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 Array where Element == List { | |
func canMove(into otherContainer: List) -> Bool { | |
return allSatisfy({ $0.canMove(into: otherContainer) }) | |
} | |
} |
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
// | |
// ReviewRequestManager.swift | |
// | |
// Created by yosshi4486 on 2021/07/22. | |
// | |
import StoreKit | |
/// The global variable to get current app version. | |
/// |
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
let string = "🤩" | |
let bounds = CGRect(x: 0, y: 0, width: 30, height: 30) | |
let image = UIGraphicsImageRenderer(size: bounds.size).image { context in | |
let attributes: [NSAttributedString.Key: Any] = [ | |
.font: UIFont.preferredFont(forTextStyle: .body), | |
.foregroundColor: UIColor.label | |
] |
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
class ViewController: UIViewController { | |
var leftTextView: UITextView! | |
var rightTextView: UITextView! | |
lazy var textStorage = NSTextStorage(string: """ | |
「ではみなさんは、そういうふうに川だと云いわれたり、乳の流れたあとだと云われたりしていたこのぼんやりと白いものがほんとうは何かご承知ですか。」先生は、黒板に吊つるした大きな黒い星座の図の、上から下へ白くけぶった銀河帯のようなところを指さしながら、みんなに問といをかけました。 | |
カムパネルラが手をあげました。それから四五人手をあげました。ジョバンニも手をあげようとして、急いでそのままやめました。たしかにあれがみんな星だと、いつか雑誌で読んだのでしたが、このごろはジョバンニはまるで毎日教室でもねむく、本を読むひまも読む本もないので、なんだかどんなこともよくわからないという気持ちがするのでした。 | |
ところが先生は早くもそれを見附みつけたのでした。 | |
「ジョバンニさん。あなたはわかっているのでしょう。」 |
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
// | |
// ViewController.swift | |
// UITextViewPractices | |
// | |
// Created by yosshi4486 on 2021/10/13. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
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
class CustomInputView: UIView, UIKeyInput { | |
private let label = UILabel() | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
label.tintColor = .label | |
label.font = .preferredFont(forTextStyle: .body, compatibleWith: nil) | |
label.text = "" |
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
/// A class that checks and notifies an internect connectivity changes. | |
class NetworkConnectivityManager { | |
/// The static singleton instance. You can use this throught `NetworkConnectivityManager.shared`. | |
/// | |
/// Creating several manager instances doesn't make sense, so we design it as singleton. | |
static let shared = NetworkConnectivityManager() | |
/// The static notification name that the notification is post when a network status change. The object is [NWPath.Status](https://developer.apple.com/documentation/network/nwpath/status) | |
static let networkConnectivityDidChangeNotificationName = Notification.Name(rawValue: "_networkConnectivityDidChangeNotification") |
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
// | |
// SynchronizingKeyValueStore.swift | |
// | |
// Created by yosshi4486 on 2022/08/30. | |
// | |
import Foundation | |
/// A key value store that stores a key-value into both local and cloud. Subclass this class and override methods for your application. | |
/// |