Skip to content

Commit 19b516f

Browse files
committed
Added Documentations
1 parent 854a1e6 commit 19b516f

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

HHFloatingView/Source/HHFloatingView.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ import UIKit
2323
public final class HHFloatingView: UIView {
2424

2525
//MARK: Datasource/Delegate
26+
/// Datasource for HHFloatingView.
2627
public weak var datasource: HHFloatingViewDatasource?
28+
/// Delegate for HHFloatingView.
2729
public weak var delegate: HHFloatingViewDelegate?
28-
30+
/// Check whether HHFloatingView is open or closed.
2931
public private(set) var isOpen: Bool = false
3032

3133
fileprivate var options: Array<HHFloatingViewButton> = Array()
@@ -331,6 +333,7 @@ public final class HHFloatingView: UIView {
331333
}
332334
}
333335

336+
/// Reload HHFloatingView.
334337
internal func reload() {
335338
if self.isDatasourceSet() {
336339
if self.isDelegateSet() {
@@ -346,6 +349,7 @@ public final class HHFloatingView: UIView {
346349
}
347350
}
348351

352+
/// Close HHFloatingView.
349353
internal func close() {
350354
if self.isOpen {
351355
self.actionOpenOrCloseOptionsView(sender: self.handlerButton!)
@@ -357,15 +361,15 @@ public final class HHFloatingView: UIView {
357361
if self.datasource != nil {
358362
return true
359363
} else {
360-
fatalError("HHFloatingView: Datasource can't be empty.")
364+
fatalError("HHFloatingView: Datasource should be set.")
361365
}
362366
}
363367

364368
fileprivate func isDelegateSet() -> Bool {
365369
if self.delegate != nil {
366370
return true
367371
} else {
368-
fatalError("HHFloatingView: Delegate can't be empty.")
372+
fatalError("HHFloatingView: Delegate should be set.")
369373
}
370374
}
371375

HHFloatingView/Source/HHFloatingViewConfiguration.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,36 @@ import UIKit
1313
}
1414

1515
@objc public class HHFloatingViewConfiguration: NSObject {
16+
/// Total number of options will be display in HHFloatingView. Default: 0
1617
public var numberOfOptions: Int = 0
18+
/// Images to be display for each of the options.
1719
public var optionImages: Array<UIImage> = []
20+
/// Colors to be display for each of the options.
1821
public var optionColors: Array<UIColor> = []
22+
/// Handler Image to be display for HHFloatingView.
1923
public var handlerImage: UIImage = UIImage.init()
24+
/// Handler Color to be display for HHFloatingView. Default: white
2025
public var handlerColor: UIColor = UIColor.white
26+
/// Position for HHFloatingView. Default: top
2127
public var position: HHFloatingViewPosition = .top
28+
/// Handler Button Size. Default: 80x80
2229
public var handlerSize: CGSize = .init(width: 80.0, height: 80.0)
30+
/// Options Button Size. Default: 60x60
2331
public var optionsSize: CGSize = .init(width: 60.0, height: 60.0)
32+
/// Internal Margins. Default: 10.0
2433
public var internalMargin: CGFloat = 10.0
34+
/// Initial Margin. Default: 20.0
2535
public var initialMargin: CGFloat = 20.0
36+
/// Animation Timer Duration. Default: 0.3
2637
public var animationTimerDuration: TimeInterval = 0.3
38+
/// Internal Animation Timer Duration. Default: 0.2
2739
public var internalAnimationTimerDuration: TimeInterval = 0.2
40+
/// Show Shadow for Options. Default: false
2841
public var showShadowInButtons: Bool = false
42+
/// Show Shadow for Handler Button. Default: false
2943
public var showShadowInHandlerButton: Bool = false
44+
/// Show Scale Animation for Buttons and Handler. Default: false
3045
public var showScaleAnimation: Bool = false
46+
/// Size for the Scale Animation. Default: 1.0
3147
public var scaleAnimationSize: CGFloat = 1.0
3248
}

0 commit comments

Comments
 (0)