MapGuideManager.guide(from: nil, to:job.gps.location, with: job.companyName)
class MapGuideManager {
class func guide(from startPoint: CLLocationCoordinate2D? = nil, to destination: CLLocationCoordinate2D? = nil, with destinationTitle: String) {
import Foundation | |
import XCTest | |
import RegexBuilder | |
// MARK: - Regex I | |
final class regTests: XCTestCase { | |
#warning("《Create a Regex》") | |
// 1. /<reg>/ -> build time |
struct ToolbarDemoView: View { | |
@State var showDetail: Bool = false | |
var body: some View { | |
NavigationView { | |
ZStack { | |
Text("ToolbarDemoView") | |
} | |
.navigationTitle("Title") | |
.toolbar { |
import SwiftUI | |
struct SheetDemoView: View { | |
enum SheetMode: Identifiable { | |
case first | |
case second | |
var id: Int { hashValue } | |
} | |
extension JSONDecoder { | |
var dateDecodingFormatters: [DateFormatter]? { | |
get { return nil } | |
set { | |
guard let formatters = newValue else { return } | |
self.dateDecodingStrategy = .custom { decoder in | |
let container = try decoder.singleValueContainer() | |
let dateString = try container.decode(String.self) | |
for formatter in formatters { |
import Foundation | |
class AccountInfoWorker { | |
struct AccountInfo { /* properties */ } | |
typealias ApiResult = Result<AccountInfo, Error> | |
typealias ApiCompletion = (ApiResult) -> Void | |
func fetchAccountInfo(id: String, completion: @escaping ApiCompletion) { /* IMP */ } | |
} |
extension UITextField { | |
private static var _texts = [String: [String]]() | |
var texts: [String] { | |
get { | |
let tmpAddress = String(format: "%p", unsafeBitCast(self, to: Int.self)) | |
return UITextField._texts[tmpAddress] ?? [] | |
} | |
set { | |
let tmpAddress = String(format: "%p", unsafeBitCast(self, to: Int.self)) | |
UITextField._texts[tmpAddress] = newValue |
class BaseTableViewCell: UITableViewCell {
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupViews()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")