mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 15:27:32 +09:00
Dactyloidae iOS initial commit
This commit is contained in:
parent
daa6179d22
commit
7154a0497e
2123 changed files with 197052 additions and 0 deletions
28
mobile/ios/ReadingList/ReadingListResponse.swift
Normal file
28
mobile/ios/ReadingList/ReadingListResponse.swift
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Wrapper around NSURLResponse and the response json object to easily pass this to delegates. Also contains some higher level functions to access service specific headers.
|
||||
///
|
||||
/// TODO: In the Android code this is a subclass of MozResponse - Which has a bunch of other useful shortcuts. Maybe we should do that too? Or for the sake of simplicity, move some of those functions (which ones do we need?) into this class
|
||||
class ReadingListResponse {
|
||||
var response: HTTPURLResponse
|
||||
var json: [String: Any]?
|
||||
|
||||
init?(response: HTTPURLResponse, json: [String: Any]) {
|
||||
self.response = response
|
||||
self.json = json
|
||||
}
|
||||
|
||||
var lastModified: Int64? {
|
||||
get {
|
||||
if let lastModified = response.allHeaderFields["Last-Modified"] as? String {
|
||||
return Int64(lastModified)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue