Skip to content

Commit

Permalink
add waitUntilCompleted(according java sample)
Browse files Browse the repository at this point in the history
  • Loading branch information
kosyloa committed Oct 9, 2023
1 parent cc58211 commit 89516a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Samples/IpfTableApp/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelection="NO" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="ZCr-Nz-ChJ">
<rect key="frame" x="10" y="159" width="373" height="589"/>
<rect key="frame" x="10" y="159" width="373" height="569"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="IpfCellId" id="3O0-l5-3RR" customClass="IpfCell" customModule="DXIpfTableApp" customModuleProvider="target">
Expand Down Expand Up @@ -92,7 +92,7 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KtK-Uq-c7X">
<rect key="frame" x="15" y="758" width="363" height="30"/>
<rect key="frame" x="15" y="738" width="363" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="G0X-0Q-cB1"/>
</constraints>
Expand All @@ -101,7 +101,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gMX-jC-dLE">
<rect key="frame" x="15" y="798" width="363" height="30"/>
<rect key="frame" x="15" y="778" width="363" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="vOX-iT-Yhy"/>
</constraints>
Expand All @@ -124,7 +124,7 @@
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="DvD-IW-DUO" secondAttribute="trailing" constant="10" id="LzD-eG-epw"/>
<constraint firstItem="y2L-8f-MGd" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="10" id="Rk3-h6-j4f"/>
<constraint firstItem="DvD-IW-DUO" firstAttribute="leading" secondItem="y2L-8f-MGd" secondAttribute="trailing" constant="15" id="Xug-oV-hv4"/>
<constraint firstItem="gMX-jC-dLE" firstAttribute="bottom" secondItem="6Tk-OE-BBY" secondAttribute="bottom" constant="10" id="eMb-Jh-aFT"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="gMX-jC-dLE" secondAttribute="bottom" constant="10" id="Yt9-Ic-ZTy"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="KtK-Uq-c7X" secondAttribute="trailing" constant="15" id="esu-8p-kPl"/>
<constraint firstItem="gMX-jC-dLE" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="15" id="rDA-Aj-1gU"/>
<constraint firstItem="ZCr-Nz-ChJ" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="10" id="sT1-Rd-2fW"/>
Expand Down
6 changes: 3 additions & 3 deletions Samples/IpfTableApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class ViewController: UIViewController {
// Update period can be used to re-read IPF files, not needed for services supporting IPF "live-update"
try connection?.setUpdatePeriod(60000)
connection?.add(observer: self)
try collector?.add(observer: self)
try connection?.start()
// We can wait until we get first full snapshot of instrument profiles
// connection?.waitUntilCompleted(3000)
connection?.waitUntilCompleted(5000)
try collector?.add(observer: self)
} catch {
print("Error during creation IPF data source: \(error)")
}
Expand All @@ -83,7 +83,7 @@ extension ViewController: DXInstrumentProfileConnectionObserver {
extension ViewController: DXInstrumentProfileUpdateListener {
func instrumentProfilesUpdated(_ instruments: [DXFeedFramework.InstrumentProfile]) {
instruments.forEach { ipf in
if ipf.ipfType == .removed {
if ipf.getIpfType() == .removed {
self.buffer.removeValue(forKey: ipf.symbol)
} else {
self.buffer[ipf.symbol] = ipf
Expand Down

0 comments on commit 89516a5

Please sign in to comment.