Skip to content

Commit

Permalink
Fixed visibility for variables
Browse files Browse the repository at this point in the history
  • Loading branch information
MaherKSantina committed Aug 2, 2018
1 parent 1acb3c1 commit ba1c2ba
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions MSAutoView/Classes/MSAutoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import UIKit

public protocol MSXibEmbedding: AnyObject {
static var xibBundle: Bundle? { set get }
static var xibName: String? { set get }
var xibBundle: Bundle? { set get }
var xibName: String? { set get }
var xibItems: [Any]? { set get }

func loadXibMainView(topConstant: CGFloat, leftConstant: CGFloat, bottomConstant: CGFloat, rightConstant: CGFloat) -> [NSLayoutConstraint]
func loadXibItems() -> [Any]
func loadXibItems() -> [Any]?
}

extension MSXibEmbedding where Self: UIView {
Expand All @@ -42,15 +42,17 @@ extension MSXibEmbedding where Self: UIView {
return addSubviewWithConstraints(view, topConstant: topConstant, leftConstant: leftConstant, bottomConstant: bottomConstant, rightConstant: rightConstant)
}

public func loadXibItems() -> [Any] {
return (Self.xibBundle ?? Bundle(for: type(of: self))).loadNibNamed(Self.xibName ?? String(describing: type(of: self)), owner: self, options: nil) ?? []
public func loadXibItems() -> [Any]? {
let items = (self.xibBundle ?? Bundle(for: type(of: self))).loadNibNamed(self.xibName ?? String(describing: type(of: self)), owner: self, options: nil)
self.xibItems = items
return self.xibItems
}
}

open class MSAutoView: UIView, MSXibEmbedding {

public static var xibBundle: Bundle?
public static var xibName: String?
public var xibBundle: Bundle?
public var xibName: String?
public var xibItems: [Any]?


Expand Down

0 comments on commit ba1c2ba

Please sign in to comment.