Meeting
public struct Meeting : Comparable, Identifiable
extension SwiftBMLSDK_Parser.Meeting: Equatable
extension SwiftBMLSDK_Parser.Meeting: Hashable
extension SwiftBMLSDK_Parser.Meeting: CustomStringConvertible
extension SwiftBMLSDK_Parser.Meeting: CustomDebugStringConvertible
extension SwiftBMLSDK_Parser.Meeting: Encodable
extension SwiftBMLSDK_Parser.Meeting: SwiftBMLSDK_MeetingProtocol
This struct holds a single parsed meeting instance.
Note
There is a platform-dependent extension that adds the directAppURI computed property to this type.
-
Declaration
Swift
public static func < (lhs: SwiftBMLSDK_Parser.Meeting, rhs: SwiftBMLSDK_Parser.Meeting) -> BoolParameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
Return Value
True, if lhs < rhs
-
This struct holds a parsed format information instance.
See moreDeclaration
Swift
public struct Format : CustomStringConvertible, CustomDebugStringConvertible, Hashable, Comparable
-
This is how many seconds there are, in a week.
Declaration
Swift
public static let oneWeekInSeconds: TimeInterval
-
This specifies the organization for the meeting.
See moreDeclaration
Swift
public enum Organization : String, Codable
-
The distance of this meeting, from the search center, or a specified “distance from” refinement. -1, if invalid.
Declaration
Swift
public let distanceInMeters: CLLocationDistance -
This is the unique ID (within the found set) for the data source server.
Declaration
Swift
public let serverID: Int -
This is a unique ID (within the data source server) for this meeting.
Declaration
Swift
public let localMeetingID: Int -
This is a 1-based weekday index, with 1 being Sunday, and 7 being Saturday.
Declaration
Swift
public let weekday: Int -
This is the time of day that the meeting starts (date-independent).
Declaration
Swift
public let startTime: Date -
This is the duration, in seconds, of the meeting.
Declaration
Swift
public let duration: TimeInterval -
This is the local timezone of this meeting.
Declaration
Swift
public let timeZone: TimeZone -
This is the name of the meeting.
Declaration
Swift
public let name: String -
This is the organization to which this meeting belongs.
Declaration
Swift
public let organization: Organization -
This contains an array of formats that apply to the meeting.
Declaration
Swift
public let formats: [Format]
-
This is the physical location of this meeting, or a location used to determine local timezone. It is optional.
Declaration
Swift
public let coords: CLLocationCoordinate2D? -
This is any additional comments for the meeting. It is optional.
Declaration
Swift
public let comments: String? -
This is the name for an in-person venue. It is optional.
Declaration
Swift
public let inPersonVenueName: String? -
This is a physical address of an in-person meeting. It is optional.
Declaration
Swift
public let inPersonAddress: CNPostalAddress? -
This is any additional text, describing the location. It is optional.
Declaration
Swift
public let locationInfo: String? -
This is a URL for a virtual meeting. It is optional.
Declaration
Swift
public let virtualURL: URL? -
This is a phone number for a virtual meeting. It is optional.
Declaration
Swift
public let virtualPhoneNumber: String? -
This is any additional text, describing the virtual meeting. It is optional.
Declaration
Swift
public let virtualInfo: String?
-
This is a unique ID (within the found set) for this meeting, based on the two local IDs.
Declaration
Swift
public var id: UInt64 { get } -
The meeting type.
Declaration
Swift
public var meetingType: MeetingType { get } -
The meeting type, as a sortable value.
Declaration
Swift
public var sortableMeetingType: SortableMeetingType { get } -
The start time, in the meeting’s local timezone, as a military-style integer (HHMM).
Returns -1 if the time could not be calculated.
Declaration
Swift
public var integerStartTime: Int { get } -
The next meeting start time, expressed in the user’s current timezone, as a military-style integer (
HHMM).This interprets the next absolute occurrence of the meeting in the user’s local timezone, without mutating the receiver.
Declaration
Swift
public var adjustedIntegerStartTime: Int { get }Return Value
The adjusted start time as
HHMM, or-1if it cannot be derived. -
Returns the meeting location as a CLLocation.
Note
This may return nil, as not all meetings have a location.
Declaration
Swift
public var location: CLLocation? { get } -
This returns the address of an in-person meeting, in a localized format.
Note
The venue name is not a part of this.
Declaration
Swift
public var localizedInPersonAddressString: String? { get }Return Value
A locality-relevant address string.
-
This returns the meeting start day index, localized to the user’s environment.
Declaration
Swift
public var localWeekdayIndex: Int { get } -
This returns the meeting start day as a string, localized to the user’s environment.
Declaration
Swift
public func localWeekdayString(style inStyle: Calendar.WeekdayStyle = .standaloneFull) -> StringParameters
inStyleThe style of weekday display. Optional, and default is
.standaloneFull. Values are:- .full
- .short
- .veryShort
- .standaloneFull
- .standaloneShort
- .standaloneVeryShort
Return Value
The localized string.
-
This returns a localized weekday/time string for the receiver’s next occurrence (for example,
"Wednesday 7:30 PM"or"Wednesday 1930").The next occurrence is computed as an absolute
Dateusing the receiver’s local meeting weekday, start time, andtimeZone. That absolute date is then formatted in either the meeting’s local timezone or a caller-supplied display timezone.Declaration
Swift
public func localizedWeekdayTimeString( style inStyle: LocalWeekdayTimeStyle = .userPreferredTime, locale inLocale: Locale = .autoupdatingCurrent, calendar inCalendar: Calendar = .autoupdatingCurrent, timeZone inTimeZone: TimeZone = .autoupdatingCurrent, adjusted inIsAdjusted: Bool = false, includeDuration inIncludeDuration: Bool = false ) -> StringParameters
inStyleThe style of string the user wants. Optional. Default is the user’s preferred time format. You can also force 24-hour format.
inLocaleThe locale used for formatting. Optional. Default is
.autoupdatingCurrent.inCalendarThe calendar used for formatting. Optional. Default is
.autoupdatingCurrent.inTimeZoneThe timezone to use when
inIsAdjustedistrue. Optional. Default is.autoupdatingCurrent.inIsAdjustedIf
true, format the result ininTimeZone. Iffalse(the default), format in the meeting’s local timezone.inIncludeDurationOptional (default is
false). Iftrue, the string will display the time as a range, such as"Wednesday 7:30 PM-8:30 PM".Return Value
The formatted weekday/time string for the next start.
-
This returns the distance between the instance, and another location, provided as coordinates.
Declaration
Swift
public func distanceFrom(_ inCoords: CLLocationCoordinate2D) -> CLLocationDistanceParameters
inCoordsThe coordinates we are measuring from.
Return Value
The distance, in meters (always positive). -1, if no distance possible.
-
Public Equatable Conformance
Declaration
Swift
public static func == (lhs: SwiftBMLSDK_Parser.Meeting, rhs: SwiftBMLSDK_Parser.Meeting) -> BoolParameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
-
Public Hashable Conformance
Declaration
Swift
public func hash(into inOutHasher: inout Hasher)Parameters
inOutHasher(INOUT) -The hasher to be loaded.
-
Public CustomStringConvertible Conformance
Declaration
Swift
public var description: String { get }
-
Public CustomDebugStringConvertible Conformance
Declaration
Swift
public var debugDescription: String { get }
-
Encoder
The reason for the “flat” encoding, is that many ML parsers like fairly simple data, without nesting. Nested structures, like the coordinates and the formats, are converted to top-level basic data types, so that a JSON file, made from the encoder, is simple and flat.
Formats are encoded into a TDV string, with the fields being tab-separated, and the formats being linefeed-separated.
If a value is not valid, it is not included in the encoding.
Declaration
Swift
public func encode(to inEncoder: Encoder) throwsParameters
inEncoderThe encoder to load with our values.
-
Use this for the distance string generator.
Declaration
Swift
public typealias DistanceUnitWidth = Measurement<UnitLength>.FormatStyle.UnitWidth -
These are the supported display widths for localized distance strings.
See moreDeclaration
Swift
public enum DistanceStringWidth -
Internal Enum for the time localization.
See moreDeclaration
Swift
public enum LocalWeekdayTimeStyle
-
True, if the meeting has a virtual component.
Declaration
Swift
public var hasVirtual: Bool { get } -
True, if the meeting has an in-person component.
Declaration
Swift
public var hasInPerson: Bool { get } -
This returns the start time as seconds from midnight.
It returns -1, if there was a problem.
Declaration
Swift
public var startTimeInSecondsFromMidnight: TimeInterval { get } -
This returns the start time and weekday as date components.
Declaration
Swift
public var dateComponents: DateComponents? { get } -
This returns the address as a basic readable address.
Declaration
Swift
public var basicInPersonAddress: String { get }
-
Returns the linear distance, in meters, between the input coordinate, and the meeting’s coordinate.
Note
May return nil, as not all meetings have a valid coordinate.
Declaration
Swift
public func distanceInMeters(from inFrom: CLLocationCoordinate2D) -> CLLocationDistance?Parameters
inFromThe coordinates of the location we are comparing to the meeting’s location.
Return Value
An optional (may be nil) float, with the exact distance between the meeting’s location, and the input. It is always positive (or 0), if not nil.
-
Returns the number of seconds until the meeting starts (non-mutating. If the cache has not been updated, then this is not accurate).
Declaration
Swift
public var nextMeetingIn: TimeInterval { get } -
Returns the distance from the receiver’s coordinates to the supplied location.
Declaration
Swift
public func distanceFrom(location inLocation: CLLocationCoordinate2D) -> Measurement<UnitLength>Parameters
inLocationThe location from which the distance is measured.
Return Value
The distance as a
Measurement<UnitLength>, stored in meters. -
Returns the distance from the receiver’s coordinates to the supplied location as a localized display string.
This uses Swift’s modern measurement-formatting API, and formats the distance using a road/travel-oriented presentation for the current locale. The caller can control both the display width and the allowed fractional precision.
Typical width values are:
.abbreviated: Compact output, such as1.2 mior850 m.wide: More explicit output, such as1.2 miles.narrow: Very compact output where supported by the locale
The precision is supplied as a closed integer range representing the minimum and maximum number of fraction digits to display. For example:
0...1: Show zero or one fractional digit0...2: Show zero, one, or two fractional digits1...1: Always show exactly one fractional digit
If the calculated distance is exactly zero, this returns an empty string.
Declaration
Swift
public func distanceStringFrom( location inLocation: CLLocationCoordinate2D, width inWidth: Measurement<UnitLength>.FormatStyle.UnitWidth = .abbreviated, precision inPrecision: ClosedRange<Int> = 0...1 ) -> StringParameters
inLocationThe location from which the distance is measured.
inWidthThe localized unit-width style used for formatting. Optional. Default is
.abbreviated.inPrecisionThe minimum and maximum number of fraction digits to display. Optional. Default is
0...1.Return Value
A localized distance string, or an empty string if the distance is zero.
-
Returns the distance from the receiver’s coordinates to the supplied location as a localized string, using an SDK-defined width style.
Declaration
Swift
public func distanceStringFrom( location inLocation: CLLocationCoordinate2D, width inWidth: DistanceStringWidth = .abbreviated, precision inPrecision: ClosedRange<Int> = 0...1 ) -> StringParameters
inLocationThe location from which the distance is measured.
inWidthThe localized unit-width style used for formatting. Optional. Default is
.abbreviated.inPrecisionThe minimum and maximum number of fraction digits to display. Optional. Default is
0...1.Return Value
A localized distance string.
-
Returns the number of seconds until the meeting starts.
Declaration
Swift
public func meetingStartsIn() -> TimeIntervalReturn Value
The number of seconds, before the next start.
-
Declaration
Swift
public func isMeetingInProgress() -> BoolReturn Value
true, if the meeting is currently in progress.
-
Returns the receiver interpreted in the meeting’s local timezone.
Declaration
Swift
var meetingLocalComponents: DateComponents { get }Return Value
Date components in the meeting’s local timezone.
-
Returns the next real-world occurrence of the receiver, expressed as an absolute
Date.This version avoids
Calendar.nextDate(...)for better performance. It computes the next occurrence manually from the receiver’s local weekday and local start time, interpreted in the receiver’stimeZone.Declaration
Swift
func nextOccurrenceDateFast( from inReferenceDate: Date = Date(), calendar inCalendarIdentifier: Calendar.Identifier = Calendar.autoupdatingCurrent.identifier ) -> DateParameters
inReferenceDateThe point in time from which the next occurrence should be calculated. Optional. Default is
Date().inCalendarIdentifierThe calendar used for date math. Optional. Default is the current autoupdating.
Return Value
The next upcoming occurrence of this meeting as an absolute
Date. -
Returns the previous real-world occurrence of the receiver, expressed as an absolute
Date.This version avoids
Calendar.nextDate(...)for better performance. It computes the next occurrence manually from the receiver’s local weekday and local start time, interpreted in the receiver’stimeZone.Declaration
Swift
func previousOccurrenceDateFast( from inReferenceDate: Date = Date(), calendar inCalendarIdentifier: Calendar.Identifier = Calendar.autoupdatingCurrent.identifier ) -> DateParameters
inReferenceDateThe point in time from which the next occurrence should be calculated. Optional. Default is
Date().inCalendarIdentifierThe calendar used for date math. Optional. Default is the current autoupdating.
Return Value
The next upcoming occurrence of this meeting as an absolute
Date. -
Returns a numeric sort key for the receiver’s next occurrence.
Declaration
Swift
func sortingKeyFast( from inReferenceDate: Date = Date(), calendar inCalendarIdentifier: Calendar.Identifier = Calendar.autoupdatingCurrent.identifier ) -> TimeIntervalParameters
inReferenceDateThe point in time from which the next occurrence should be calculated. Optional. Default is
Date().inCalendarIdentifierThe calendar used for date math. Optional. Default is the current autoupdating.
Return Value
A sortable numeric key.
-
This enum helps us to create direct (as in opening the app directly) URLs, for various services.
See moreDeclaration
Swift
public enum DirectVirtual : CaseIterable -
This returns the enum.
Declaration
Swift
public var directApp: DirectVirtual? { get } -
If the URL for the virtual meeting is one that can open an app on the user’s device, a direct URL scheme version of the URL is returned.
Declaration
Swift
public var directAppURI: URL? { get } -
If we have a valid direct phone URL, it is returned here.
Declaration
Swift
public var directPhoneURI: URL? { get }
View on GitHub