let myScrollView = MyScrolView()
if let cell = tableView.cellForRow(at: indexPath) as? CreateTodoTableViewCell {
cell.selectedProject = indexPath.row
}
class Time {
var seconds:Double = 0
init(seconds: Double) {
self.seconds = seconds
}
var minutes: Double {
get {
return (seconds / 60)
}
set {
self.seconds = (newValue * 60)
}
}
var hours: Double {
get {
return (seconds / (60 * 60))
}
set {
self.seconds = (newValue * (60 * 60))
}
}
var days: Double {
get {
return (seconds / (60 * 60 * 24))
}
set {
self.seconds = (newValue * (60 * 60 * 24))
}
}
}
struct Container: Decodable {
let messages : [Message]
}
struct Message : Decodable {
private enum CodingKeys : String, CodingKey {
case userId
case id
case title
case body
}
let userId, id: Int
let title, body: String
}
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .iso8601
decoder.decode(Container.self, from: data)
// здесь data это Data
let searchController = UISearchController(searchResultsController: nil)
override func viewDidLoad() {
super.viewDidLoad()
tableView.tableFooterView = UIView()
setupTopBar()
}
func setupTopBar() {
navigationController?.navigationBar.prefersLargeTitles = true
settingsBarButtonItem.target = self
navigationItem.rightBarButtonItem = settingsBarButtonItem
searchController.searchResultsUpdater = self
navigationItem.searchController = searchController
searchController.dimsBackgroundDuringPresentation = false
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
navigationItem.hidesSearchBarWhenScrolling = false
}