Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support other bundle than main MarkerView.viewFromXib() #3215

Merged
merged 4 commits into from
Jan 30, 2018
Merged
Changes from 3 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
6 changes: 3 additions & 3 deletions Source/Charts/Components/MarkerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ open class MarkerView: NSUIView, IMarker
}

@objc
open class func viewFromXib() -> MarkerView?
open class func viewFromXib(in bundle: Bundle = .main) -> MarkerView?
Copy link
Member

Choose a reason for hiding this comment

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

I don't realize @objc can be used for functions with default parameters.. :)

{
#if !os(OSX)
return Bundle.main.loadNibNamed(
return bundle.loadNibNamed(
String(describing: self),
owner: nil,
options: nil)?[0] as? MarkerView
Expand All @@ -84,7 +84,7 @@ open class MarkerView: NSUIView, IMarker
var loadedObjects = NSArray()
let loadedObjectsPointer = AutoreleasingUnsafeMutablePointer<NSArray?>(&loadedObjects)

if Bundle.main.loadNibNamed(
if bundle.loadNibNamed(
NSNib.Name(String(describing: self)),
owner: nil,
topLevelObjects: loadedObjectsPointer)
Expand Down