DataService
protocol DataService : AnyObject, Observable, ServiceProvider
Provides stored data functionality
-
Callback handler type
Declaration
Swift
typealias Completion = (Bool) -> Void
-
Beaches
Declaration
Swift
var beaches: [Beach] { get }
-
Brands
Declaration
Swift
var brands: [String : String] { get }
-
Blocked photos
Declaration
Swift
var blockedPhotos: [Int] { get set }
-
Blocked posts
Declaration
Swift
var blockedPosts: [Int] { get set }
-
Blocked users
Declaration
Swift
var blockedUsers: [Int] { get set }
-
Countries
Declaration
Swift
var countries: [Country] { get }
-
Dive sites
Declaration
Swift
var divesites: [DiveSite] { get }
-
Dismissed timestamps
Declaration
Swift
var dismissed: Timestamps? { get set }
-
Email stash during signup
Declaration
Swift
var email: String { get set }
-
If-None-Match cache
Declaration
Swift
var etags: [String : String] { get set }
-
Build that last completed the fixUser API
Declaration
Swift
var fixed: String { get set }
-
Golf courses
Declaration
Swift
var golfcourses: [GolfCourse] { get }
-
Hotels
Declaration
Swift
var hotels: [Hotel] { get }
-
Group hotels by brand?
Declaration
Swift
var hotelsGroupBrand: Bool { get set }
-
Rankings filter
Declaration
Swift
var lastRankingsQuery: RankingsQuery { get set }
-
Locations
Declaration
Swift
var locations: [Location] { get }
-
Displayed types
Declaration
Swift
var mapDisplay: ChecklistFlags { get set }
-
Get all places
Declaration
Swift
var visibles: [Mappable] { get }
-
Notified timestamps
Declaration
Swift
var notified: Timestamps? { get set }
-
Restaurants
Declaration
Swift
var restaurants: [Restaurant] { get }
-
Login token
Declaration
Swift
var token: String { get set }
-
Triggered timestamps
Declaration
Swift
var triggered: Timestamps? { get set }
-
UN Countries
Declaration
Swift
var uncountries: [UNCountry] { get }
-
Updated timestamps
Declaration
Swift
var updated: Timestamps? { get set }
-
User info
Declaration
Swift
var user: UserJSON? { get set }
-
User visits
Declaration
Swift
var visited: Checked? { get set }
-
WHSs
Declaration
Swift
var whss: [WHS] { get }
-
World map
Declaration
Swift
var worldMap: WorldMap { get }
-
Block a photo
Declaration
Swift
func block(photo id: Int)
Parameters
id
Photo ID
-
Block a post
Declaration
Swift
func block(post id: Int)
Parameters
id
Post ID
-
Block a user
Declaration
Swift
func block(user id: Int) -> Bool
Parameters
id
User ID
-
Set user and mark fixed
Parameters
data
API results
-
Get country
Declaration
Swift
func get(country id: Int?) -> Country?
Parameters
id
country ID
Return Value
Country if found
-
Get location
Declaration
Swift
func get(location id: Int?) -> Location?
Parameters
id
location ID
Return Value
Location if found
-
Get location photos
Declaration
Swift
func get(locationPhotos id: Int) -> [Photo]
Parameters
id
location ID
Return Value
Photos if found
-
Get location posts
Declaration
Swift
func get(locationPosts id: Int) -> [Post]
Parameters
id
location ID
Return Value
Posts if found
-
Get filtered locations
Parameters
filter
Filter
Return Value
Locations if found
-
Get place
Parameters
item
list and ID
Return Value
Place if found
-
Get visible place
Parameters
item
list and ID
Return Value
Place if found
-
Get places
Parameters
list
Checklist
Return Value
Places in list
-
Get matching places
Parameters
matching
String
Return Value
Places matching
-
Get milestones
Declaration
Swift
func get(milestones list: Checklist) -> Milestones?
Parameters
list
Checklist
Return Value
Milestones if found
-
Get user photo pages
Declaration
Swift
func getPhotosPages(user id: Int) -> Results<PhotosPageInfo>
Parameters
id
User ID
Return Value
Photo pages if found
-
Get photo
Declaration
Swift
func get(photo: Int) -> Photo
Parameters
photo
ID
Return Value
Photo
-
Get post
Declaration
Swift
func get(post: Int) -> Post?
Parameters
post
ID
Return Value
Post if exists
-
Get user posts
Parameters
id
User ID
Return Value
Posts if found
-
Get user photos by location
Parameters
id
User ID
location
Location
Return Value
Photos if found
-
Get rankings pages
Declaration
Swift
func get(rankings query: RankingsQuery) -> Results<RankingsPageInfo>
Parameters
query
Filter query
Return Value
Rankings pages if found
-
Get user scorecard
Parameters
list
Checklist
id
userID
Return Value
Scorecard if found
-
Get user
Parameters
id
User ID
Return Value
User if found
-
Get WHS
Declaration
Swift
func get(whs id: Int) -> WHS?
Parameters
id
WHS ID
Return Value
WHS if found
-
Does WHS have children?
Declaration
Swift
func hasChildren(whs id: Int) -> Bool
Parameters
id
WHS ID
Return Value
Parentage
-
Visited children list
Declaration
Swift
func visitedChildren(whs id: Int) -> [WHS]
Parameters
id
WHS ID
Return Value
Visited children
-
Set beaches
Declaration
Swift
func set(beaches: [PlaceJSON])
Parameters
beaches
API results
-
Set brands
Declaration
Swift
func set(brands: [BrandJSON])
Parameters
brands
API results
-
Set countries
Declaration
Swift
func set(countries: [CountryJSON])
Parameters
countries
API results
-
Set dive sites
Declaration
Swift
func set(divesites: [PlaceJSON])
Parameters
divesites
API results
-
Set golf courses
Declaration
Swift
func set(golfcourses: [PlaceJSON])
Parameters
golfcourses
API results
-
Set hotels
Declaration
Swift
func set(hotels: [HotelJSON])
Parameters
hotels
API results
-
Set places visited state
Declaration
Swift
func set(items: [Checklist.Item], visited: Bool)
Parameters
items
Places
visited
Visited state
-
Set locations
Declaration
Swift
func set(locations: [LocationJSON])
Parameters
locations
API results
-
Set location photos
Declaration
Swift
func set(location id: Int, photos: PhotosInfoJSON)
Parameters
id
Location ID
photos
API results
-
Set location posts
Declaration
Swift
func set(location id: Int, posts: [PostJSON])
Parameters
id
Location ID
photos
API results
-
Set milestones
Declaration
Swift
func set(milestones: SettingsJSON)
Parameters
milestones
API results
-
Set photo
Declaration
Swift
func set(photo: PhotoReply)
Parameters
photo
API result
-
Set photos page
Declaration
Swift
func set(photos page: Int, user id: Int, info: PhotosPageInfoJSON)
Parameters
page
Index
id
User ID
info
API results
-
Set post
Declaration
Swift
func set(post: PostReply)
Parameters
post
API results
-
Set user posts
Declaration
Swift
func set(posts: [PostJSON])
Parameters
id
Location ID
posts
API results
-
Set restaurants
Declaration
Swift
func set(restaurants: [RestaurantJSON])
Parameters
restaurants
API results
-
Set rankings query
Declaration
Swift
func set(rankings query: RankingsQuery, info: RankingsPageInfoJSON)
Parameters
query
Query
info
API results
-
Set scorecard
Declaration
Swift
func set(scorecard: ScorecardWrapperJSON)
Parameters
scorecard
API results
-
Set UN countries
Declaration
Swift
func set(uncountries: [LocationJSON])
Parameters
uncountries
API results
-
Set user
Parameters
data
API results
-
Set WHSs
Declaration
Swift
func set(whss: [WHSJSON])
Parameters
whss
API results
-
Update location features
Declaration
Swift
func set(world map: GeoJSON)
Parameters
map
GeoJSON file
-
Delete user photo
Declaration
Swift
func delete(photo photoId: Int)
Parameters
photoId
Photo ID
-
Delete all user photos
Declaration
Swift
func delete(photos userId: Int)
Parameters
userId
User ID
-
Delete user post
Declaration
Swift
func delete(post postId: Int)
Parameters
postId
Post ID
-
Delete all user posts
Declaration
Swift
func delete(posts userId: Int)
Parameters
userId
User ID
-
Delete all rankings for checklist
Declaration
Swift
func delete(rankings: Checklist)
Parameters
rankings
Checklist
-
Resolve Realm crossthread reference
Parameters
reference
Reference
Return Value
Mappable if found
-
Update rankings
Declaration
Swift
func update(rankings: Checklist, then: @escaping Completion)
Parameters
rankings
Checklist
then
Completion
-
Update scorecard
Declaration
Swift
func update(scorecard: Checklist, then: @escaping Completion)
Parameters
rankings
Checklist
then
Completion
-
Update page stamp
Declaration
Swift
func update(stamp: RankingsPageInfo?)
Parameters
stamp
Page
-
isLoggedIn
Extension methodIs there a logged in user?
Declaration
Swift
var isLoggedIn: Bool { get }
-
isVisitsLoaded
Extension methodAre visits loaded?
Declaration
Swift
var isVisitsLoaded: Bool { get }
-
logOut()
Extension methodLog out current user
Declaration
Swift
func logOut()
-
statusKey
Extension methodType of change generated
Declaration
Swift
var statusKey: StatusKey { get }
-
notification
Extension methodName of change
Declaration
Swift
var notification: Notification.Name { get }
-
notify(change:object:)
Extension methodNotify change listeners
Declaration
Swift
func notify(change: DataServiceChange, object: Any? = nil)
Parameters
change
DataServiceChange
object
Attachment if any
-
observer(of:handler:)
Extension methodCreate data change observer
Declaration
Swift
func observer(of change: DataServiceChange, handler: @escaping NotificationHandler) -> Observer
Parameters
of
DataServiceChange
handler
Handler
Return Value
Observer