Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Sources/WKJavaScriptController/WKJavaScriptController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ open class WKJavaScriptController: NSObject {

fileprivate weak var webView: WKWebView?

fileprivate var bridges = [MethodBridge]()
open var bridges = [MethodBridge]()

fileprivate var isInjectRequired = true

fileprivate class MethodBridge {
var nativeSelector: Selector
var isExtendJsSelector: Bool // If true, use ObjC style naming.
var isReturnRequired: Bool
open class MethodBridge {
open private(set) var nativeSelector: Selector
open fileprivate(set) var isExtendJsSelector: Bool // If true, use ObjC style naming.
open fileprivate(set) var isReturnRequired: Bool
Comment on lines +111 to +113
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 3가지 프로퍼티는 내부 private이라면 open이 꼭 있어야하나요???

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open은 getter에 대한 접근자인데 jsSelector 말고도 다른 프로퍼티를 외부에서 활용할 수 있도록 고려했어요.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아! set만 private인거군요 🙀


var jsSelector: String {
open var jsSelector: String {
let selector = NSStringFromSelector(nativeSelector)
let components = selector.components(separatedBy: ":")
if components.isEmpty {
Expand All @@ -136,7 +136,7 @@ open class WKJavaScriptController: NSObject {
}
}

var argumentCount: Int {
open var argumentCount: Int {
max(NSStringFromSelector(nativeSelector).components(separatedBy: ":").count - 1, 0)
}

Expand Down