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.

Comparable Conformance

  • Declaration

    Swift

    public static func < (lhs: SwiftBMLSDK_Parser.Meeting, rhs: SwiftBMLSDK_Parser.Meeting) -> Bool

    Parameters

    lhs

    The left-hand side of the comparison.

    rhs

    The right-hand side of the comparison.

    Return Value

    True, if lhs < rhs

Format Information Container

  • This struct holds a parsed format information instance.

    See more

    Declaration

    Swift

    public struct Format : CustomStringConvertible, CustomDebugStringConvertible, Hashable, Comparable

Public Interface

  • This is how many seconds there are, in a week.

    Declaration

    Swift

    public static let oneWeekInSeconds: TimeInterval

Meeting Type Enum

  • This provides values for the type of meeting.

    See more

    Declaration

    Swift

    public enum MeetingType : String
  • This has the type of meeting, but in a sortable manner.

    See more

    Declaration

    Swift

    public enum SortableMeetingType : Int, Comparable

Organization Type Enum

  • This specifies the organization for the meeting.

    See more

    Declaration

    Swift

    public enum Organization : String, Codable

Public Instance Properties

  • 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]

Public Optional Instance Properties

  • 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?

Public Computed Properties

  • id

    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 -1 if 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) -> String

    Parameters

    inStyle

    The 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 Date using the receiver’s local meeting weekday, start time, and timeZone. 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
    ) -> String

    Parameters

    inStyle

    The style of string the user wants. Optional. Default is the user’s preferred time format. You can also force 24-hour format.

    inLocale

    The locale used for formatting. Optional. Default is .autoupdatingCurrent.

    inCalendar

    The calendar used for formatting. Optional. Default is .autoupdatingCurrent.

    inTimeZone

    The timezone to use when inIsAdjusted is true. Optional. Default is .autoupdatingCurrent.

    inIsAdjusted

    If true, format the result in inTimeZone. If false (the default), format in the meeting’s local timezone.

    inIncludeDuration

    Optional (default is false). If true, 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) -> CLLocationDistance

    Parameters

    inCoords

    The coordinates we are measuring from.

    Return Value

    The distance, in meters (always positive). -1, if no distance possible.

Meeting Equatable Conformance

  • Public Equatable Conformance

    Declaration

    Swift

    public static func == (lhs: SwiftBMLSDK_Parser.Meeting, rhs: SwiftBMLSDK_Parser.Meeting) -> Bool

    Parameters

    lhs

    The left-hand side of the comparison.

    rhs

    The right-hand side of the comparison.

Meeting Hashable Conformance

  • Public Hashable Conformance

    Declaration

    Swift

    public func hash(into inOutHasher: inout Hasher)

    Parameters

    inOutHasher

    (INOUT) -The hasher to be loaded.

Meeting CustomStringConvertible Conformance

  • Public CustomStringConvertible Conformance

    Declaration

    Swift

    public var description: String { get }

Meeting CustomDebugStringConvertible Conformance

  • Public CustomDebugStringConvertible Conformance

    Declaration

    Swift

    public var debugDescription: String { get }

Codable Coding Keys

  • 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) throws

    Parameters

    inEncoder

    The encoder to load with our values.

Meeting Extensions

  • 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 more

    Declaration

    Swift

    public enum DistanceStringWidth
  • Internal Enum for the time localization.

    See more

    Declaration

    Swift

    public enum LocalWeekdayTimeStyle

Public Computed Properties

  • 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 }

Public Non-Mutating Instance Methods

  • 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

    inFrom

    The 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

    inLocation

    The 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 as 1.2 mi or 850 m
    • .wide: More explicit output, such as 1.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 digit
    • 0...2: Show zero, one, or two fractional digits
    • 1...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
    ) -> String

    Parameters

    inLocation

    The location from which the distance is measured.

    inWidth

    The localized unit-width style used for formatting. Optional. Default is .abbreviated.

    inPrecision

    The 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
    ) -> String

    Parameters

    inLocation

    The location from which the distance is measured.

    inWidth

    The localized unit-width style used for formatting. Optional. Default is .abbreviated.

    inPrecision

    The 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() -> TimeInterval

    Return Value

    The number of seconds, before the next start.

  • Declaration

    Swift

    public func isMeetingInProgress() -> Bool

    Return Value

    true, if the meeting is currently in progress.

Meeting Extension: Fast Ocurrence Calculation Support

  • 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’s timeZone.

    Declaration

    Swift

    func nextOccurrenceDateFast(
        from inReferenceDate: Date = Date(),
        calendar inCalendarIdentifier: Calendar.Identifier = Calendar.autoupdatingCurrent.identifier
    ) -> Date

    Parameters

    inReferenceDate

    The point in time from which the next occurrence should be calculated. Optional. Default is Date().

    inCalendarIdentifier

    The 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’s timeZone.

    Declaration

    Swift

    func previousOccurrenceDateFast(
        from inReferenceDate: Date = Date(),
        calendar inCalendarIdentifier: Calendar.Identifier = Calendar.autoupdatingCurrent.identifier
    ) -> Date

    Parameters

    inReferenceDate

    The point in time from which the next occurrence should be calculated. Optional. Default is Date().

    inCalendarIdentifier

    The 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
    ) -> TimeInterval

    Parameters

    inReferenceDate

    The point in time from which the next occurrence should be calculated. Optional. Default is Date().

    inCalendarIdentifier

    The calendar used for date math. Optional. Default is the current autoupdating.

    Return Value

    A sortable numeric key.

Public Enum For Virtual Direct URLs

  • This enum helps us to create direct (as in opening the app directly) URLs, for various services.

    See more

    Declaration

    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 }