浏览代码

add comments about shared DcContext instance

cyberta 5 年之前
父节点
当前提交
34ed96ec3e
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      deltachat-ios/DC/Wrapper.swift

+ 3 - 0
deltachat-ios/DC/Wrapper.swift

@@ -3,6 +3,8 @@ import UIKit
 import AVFoundation
 
 class DcContext {
+    /// TODO: THIS global instance should be replaced in the future, for example for a multi-account scenario,
+    /// where we want to have more than one DcContext.
     static let dcContext: DcContext = DcContext()
     let contextPointer: OpaquePointer
 
@@ -19,6 +21,7 @@ class DcContext {
         dc_context_unref(contextPointer)
     }
 
+    /// Injection of DcContext is preferred over the usage of the shared variable
     static var shared: DcContext {
         return .dcContext
     }