Skip to content

Commit

Permalink
fix warning and change call methods with new signature
Browse files Browse the repository at this point in the history
  • Loading branch information
kosyloa committed Sep 8, 2023
1 parent 9016a7d commit f8623b8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 41 deletions.
18 changes: 5 additions & 13 deletions Samples/IpfTableApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,19 @@ import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {



func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}


}

1 change: 0 additions & 1 deletion Samples/IpfTableApp/IpfCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import UIKit


class IpfCell: UITableViewCell {
@IBOutlet var titleLabel: UILabel!
@IBOutlet var counterLabel: UILabel!
Expand Down
24 changes: 3 additions & 21 deletions Samples/IpfTableApp/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,24 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
}

func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}

func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}


}

6 changes: 5 additions & 1 deletion Samples/IpfTableApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ extension ViewController: DXInstrumentProfileUpdateListener {
}
}
DispatchQueue.main.async {
self.lastUpdateLabel.text = TimeUtil.toLocalDateString(millis: self.collector?.getLastUpdateTime() ?? 0)
self.ipfList = self.buffer.map { _, value in
value
}.sorted(by: { ipf1, ipf2 in
ipf1.symbol < ipf2.symbol
})
self.ipfTableView.reloadData()
self.lastUpdateLabel.text =
"""
\(self.ipfList.count) profiles: \(TimeUtil.toLocalDateString(millis: self.collector?.getLastUpdateTime() ?? 0))
"""

}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Samples/LatencyTestApp/LatencyViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ class LatencyViewController: UIViewController {
return
}
endpoint = try? DXEndpoint.builder().withRole(.feed).build()
endpoint?.add(self)
endpoint?.add(observer: self)
try? endpoint?.connect(address)

subscription = try? endpoint?.getFeed()?.createSubscription(.timeAndSale)
try? subscription?.add(self)
try? subscription?.add(observer: self)

try? subscription?.addSymbols(symbols)
diagnostic.cleanTime()
Expand Down
6 changes: 3 additions & 3 deletions Samples/PertTestApp/PerfTestViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ class PerfTestViewController: UIViewController {
return
}
endpoint = try? DXEndpoint.builder().withRole(.feed).build()
endpoint?.add(self)
endpoint?.add(observer: self)
try? endpoint?.connect(address)

subscription = try? endpoint?.getFeed()?.createSubscription(.timeAndSale)
profileSubscription = try? endpoint?.getFeed()?.createSubscription(.profile)
try? subscription?.add(self)
try? profileSubscription?.add(self)
try? subscription?.add(observer: self)
try? profileSubscription?.add(observer: self)

try? subscription?.addSymbols(symbols)
try? profileSubscription?.addSymbols(symbols)
Expand Down

0 comments on commit f8623b8

Please sign in to comment.