DALIEvent
public class DALIEvent
A DALI event
-
Name of the event
Declaration
Swift
public var name: String { get set } -
Description of the event
Declaration
Swift
public var description: String? { get set } -
Location of the event
Declaration
Swift
public var location: String? { get set } -
Start time of the event
Declaration
Swift
public var start: Date { get set } -
Start time of the event
Declaration
Swift
public var end: Date { get set } -
The identifier used by the server
Declaration
Swift
public private(set) var id: String! -
Signifies when this event object contains information that has not been saved
Declaration
Swift
public private(set) var dirty: Bool -
A flag that indicates if this event can be edited
Declaration
Swift
public var editable: Bool { get } -
A flag that indicates if this event is happening now
Declaration
Swift
public var isNow: Bool { get }
-
Creates an event object
Declaration
Swift
public init(name: String, description: String?, location: String?, start: Date, end: Date)Parameters
nameThe name of the event
descriptionThe description of the event
locationThe location of the event
startThe start time
endEnd time
-
Creates the event on the server
Throws
DALIError.Createerror describing some error encounteredDeclaration
Swift
public func create(callback: @escaping (Bool, DALIError.General?) -> Void) throwsParameters
callbackA function that will be called when the job is done
-
Parses a given json object and returns an event object if it can find one
Declaration
Swift
public class func parse(_ object: JSON) -> DALIEvent?Parameters
objectThe JSON object you want parsed
Return Value
DALIEventthat was found. Will be nil if object is not event -
Get the event in JSON form. Converts all data in the event into a form the API would use
Declaration
Swift
public func json() -> JSON
-
Pulls all the events from the server
Declaration
Swift
public static func getAll(callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void)Parameters
callbackFunction called when done
eventsThe events returned by the API
errorThe error encountered (if any)
-
Observes all events. Will call callback every time something changes
Declaration
Swift
public static func observeAll(callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void) -> ObservationParameters
callbackThe function called when the updates occur
eventsThe updated events
errorThe error, if any, encountered
-
Observes all upcoming events. Will call callback every time something changes
Declaration
Swift
public static func observeUpcoming(callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void) -> ObservationParameters
callbackThe function to call when done
eventsThe events
errorThe error, if any, encountered
-
Observe future events
Declaration
Swift
public static func observeFuture(includeHidden: Bool = false, callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void) -> ObservationParameters
includeHiddenInclude events marked as hidden (admin only)
callbackThe function to call when update happens
eventsThe updated events
errorThe error, if any, encountered
-
Observes public events.
Declaration
Swift
public static func observePublicUpcoming(callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void) -> ObservationParameters
callbackThe function called when the data is updated
eventsThe events that have been updated
errorThe error, if any, encountered
-
Gets all upcoming events within a week from now
Declaration
Swift
public static func getUpcoming(callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void)Parameters
callbackFunction called when done
eventsThe events returned by the API
errorThe error encountered (if any)
-
Gets all upcoming events within a week from now that are public No authorization is needed for this route
Declaration
Swift
public static func getPublicUpcoming(callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void)Parameters
callbackFunction called when done
eventsThe events returned by the API
errorThe error encountered (if any)
-
Gets all events in the future
Declaration
Swift
public static func getFuture(includeHidden: Bool = false, callback: @escaping (_ events: [DALIEvent]?, _ error: DALIError.General?) -> Void)Parameters
includeHiddenInclude events that have been marked hidden (admin only)
callbackFunction called when done
eventsThe events returned by the API
errorThe error encountered (if any)
-
Enable voting on this event

Declaration
Swift
public func enableVoting(numSelected: Int, ordered: Bool, callback: @escaping (_ success: Bool, _ event: VotingEvent?, _ error: DALIError.General?) -> Void)Parameters
numSelectedNumber of options the user should select
orderedThe choices the user makes should be ordered (1st, 2nd, 3rd, …)
callbackFunction to call when done
successFlag to indicate that the event has been properly enabled for voting
eventThe new VotingEvent, if it was successful
errorThe error encountered if it was not successful
-
Checks in the current user to whatever event is happening now
Declaration
Swift
public static func checkIn(major: Int, minor: Int, callback: @escaping (_ success: Bool, _ error: DALIError.General?) -> Void)Parameters
majorThe major value of the bluetooth beacon
minorThe minor value of the beacon
callbackCalled when done
successThe operation was a success
errorThe error, if any, encountered
-
Enables checkin on the event, and gets back major and minor values to be used when advertizing
Declaration
Swift
public func enableCheckin(callback: @escaping (_ success: Bool, _ major: Int?, _ minor: Int?, _ error: DALIError.General?) -> Void)Parameters
callbackCalled when done
successThe operation was a success
majorThe major value of the bluetooth beacon
minorThe minor value of the beacon
errorThe error, if any, encountered
-
Gets a list of members who have checked in
Declaration
Swift
public func getMembersCheckedIn(callback: @escaping (_ members: [DALIMember], _ error: DALIError.General?) -> Void)Parameters
callbackCalled when done
membersThe members who have been checked in to the event
errorThe error, if any, encountered
-
Observe the list of members whom have checked in
Declaration
Swift
public func observeMembersCheckedIn(callback: @escaping (_ members: [DALIMember]) -> Void) -> ObservationParameters
callbackCalled when complete
memebersThe members who have checked in
View on GitHub
DALIEvent Class Reference