findNextMeetingsSearch(centerLongLat:minimumNumberOfResults:maxRadiusInMeters:refinements:refCon:completion:)

public func findNextMeetingsSearch(centerLongLat inCenterLongLat: CLLocationCoordinate2D,
                                   minimumNumberOfResults inMinimumNumberOfResults: UInt = 10,
                                   maxRadiusInMeters inMaxRadiusInMeters: CLLocationDistance = 10000000,
                                   refinements inSearchRefinements: Set<LGV_MeetingSDK_Meeting_Data_Set.Search_Refinements>? = nil,
                                   refCon inRefCon: Any? = nil,
                                   completion inCompletion: @escaping LGV_MeetingSDK_SearchInitiator_Protocol.MeetingSearchCallbackClosure)

WHAT’S ALL THIS, THEN?

This method will be a bit complex, because, what we are doing, is successive auto radius calls, until a minimum number of aggregated results are found.

Sounds like a standard auto radius call, eh? But there’s a difference. This is a “Next Available Meetings” call. The result will be a series of meetings, sorted by weekday and time, then by distance, after now.

The caller can specify refinements, like “Only look at meetings on weekdays, between 6PM and 9PM.”

The search will continue until the minimum number of search results has been found, or until all seven days have been exhausted. The caller can also specify a maximum radius.

  • default minimumNumberOfResults is 10
  • default maxRadiusInMeters is 10,000 Km
  • default refinements is nil
  • default refCon is nil
  • This is our own internal completion callback. We use this to aggregate the search results.

    Note

    I don’t want to recurse, because I don’t want long stack chains. We’re calling a remote service, and it could be dicey. Instead, I will use a rather primitive loop.

    Declaration

    Swift

    func searchCallback(_ inData: LGV_MeetingSDK_Meeting_Data_Set_Protocol?, _ inError: Error?)

    Parameters

    inData

    The data returned from the search.

    inError

    Any errors encountered (may be nil).