Skip to content

Commit

Permalink
V1.0.1
Browse files Browse the repository at this point in the history
支持oc调用
  • Loading branch information
crypto committed Dec 26, 2019
1 parent 8c83acd commit cf0ca75
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 12 deletions.
Binary file modified .DS_Store
Binary file not shown.
24 changes: 19 additions & 5 deletions Code/MCircleBoard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public enum MCircleItemType: String {
}

public class MCircleBoard: UIView {
public private(set) var allcount:Int = 0
public private(set) var isclockwise:Bool = true
public private(set) var itemwidth:Double = 24
public var basicAngle:Double {
@objc public private(set) var allcount:Int = 0
@objc public var isclockwise:Bool = true
@objc public var itemwidth:Double = 24
@objc public var basicAngle:Double {
get {
return 360.0 / Double(allcount)
}
Expand Down Expand Up @@ -64,7 +64,7 @@ public class MCircleBoard: UIView {
}

///[Array]Init.
public init(array:[String], itemWidth:Double = 24, isClockWise:Bool = true) {
@objc public init(array:[String], itemWidth:Double = 24, isClockWise:Bool = true) {
super.init(frame: CGRect.zero)

itemwidth = itemWidth
Expand All @@ -73,6 +73,14 @@ public class MCircleBoard: UIView {
setImage(array: array)
}

///[Array]Init.Item width: 24,direction: clockwise.
@objc public init(array:[String]) {
super.init(frame: CGRect.zero)

allcount = 0
setImage(array: array)
}

///[Array]Init with default image.
public init(array:[MCircleItemType], itemWidth:Double = 24, isClockWise:Bool = true) {
super.init(frame: CGRect.zero)
Expand Down Expand Up @@ -134,6 +142,12 @@ public class MCircleBoard: UIView {
layoutSubviews()
}

///[Array]Reset the item array.
@objc public func setInterface(array: [String]) {
setImage(array: array)
layoutSubviews()
}

//[Array]Reset the item array with default image.
public func setInterface(array: [MCircleItemType], isClockWise:Bool? = nil) {
if let isClockWise = isClockWise {
Expand Down
2 changes: 1 addition & 1 deletion MCircleBoard.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@version = "1.0.0"
@version = "1.0.1"
Pod::Spec.new do |s|
s.name = "MCircleBoard"
s.version = @version
Expand Down
Binary file not shown.
24 changes: 19 additions & 5 deletions MCircleBoard/MCircleBoard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public enum MCircleItemType: String {
}

public class MCircleBoard: UIView {
public private(set) var allcount:Int = 0
public private(set) var isclockwise:Bool = true
public private(set) var itemwidth:Double = 24
public var basicAngle:Double {
@objc public private(set) var allcount:Int = 0
@objc public var isclockwise:Bool = true
@objc public var itemwidth:Double = 24
@objc public var basicAngle:Double {
get {
return 360.0 / Double(allcount)
}
Expand Down Expand Up @@ -64,7 +64,7 @@ public class MCircleBoard: UIView {
}

///[Array]Init.
public init(array:[String], itemWidth:Double = 24, isClockWise:Bool = true) {
@objc public init(array:[String], itemWidth:Double = 24, isClockWise:Bool = true) {
super.init(frame: CGRect.zero)

itemwidth = itemWidth
Expand All @@ -73,6 +73,14 @@ public class MCircleBoard: UIView {
setImage(array: array)
}

///[Array]Init.Item width: 24,direction: clockwise.
@objc public init(array:[String]) {
super.init(frame: CGRect.zero)

allcount = 0
setImage(array: array)
}

///[Array]Init with default image.
public init(array:[MCircleItemType], itemWidth:Double = 24, isClockWise:Bool = true) {
super.init(frame: CGRect.zero)
Expand Down Expand Up @@ -134,6 +142,12 @@ public class MCircleBoard: UIView {
layoutSubviews()
}

///[Array]Reset the item array.
@objc public func setInterface(array: [String]) {
setImage(array: array)
layoutSubviews()
}

//[Array]Reset the item array with default image.
public func setInterface(array: [MCircleItemType], isClockWise:Bool? = nil) {
if let isClockWise = isClockWise {
Expand Down
2 changes: 1 addition & 1 deletion MCircleBoard/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ViewController: UIViewController {

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) {
circleBoard.setInterface(array: array2)
//circleBoard.setInterface(array: array3)
circleBoard.setInterface(array: array3)
//circleBoard.setInterface(array: array4)
}

Expand Down

0 comments on commit cf0ca75

Please sign in to comment.