Skip to content

Commit c1d73b5

Browse files
committed
Converted from open to public.
I don’t see any reasons subclassing this is necessary. If there is a reason I’ll change it back.
1 parent fa34386 commit c1d73b5

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

Sources/M13Checkbox.swift

+20-20
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import UIKit
1515

1616
/// A customizable checkbox control for iOS.
1717
@IBDesignable
18-
open class M13Checkbox: UIControl {
18+
public class M13Checkbox: UIControl {
1919

2020
//----------------------------
2121
// MARK: - Constants
@@ -258,20 +258,20 @@ open class M13Checkbox: UIControl {
258258
//----------------------------
259259

260260
/// The object to return from `value` when the checkbox is checked.
261-
open var checkedValue: Any?
261+
public var checkedValue: Any?
262262

263263
/// The object to return from `value` when the checkbox is unchecked.
264-
open var uncheckedValue: Any?
264+
public var uncheckedValue: Any?
265265

266266
/// The object to return from `value` when the checkbox is mixed.
267-
open var mixedValue: Any?
267+
public var mixedValue: Any?
268268

269269
/**
270270
Returns one of the three "value" properties depending on the checkbox state.
271271
- returns: The value coresponding to the checkbox state.
272272
- note: This is a convenience method so that if one has a large group of checkboxes, it is not necessary to write: if (someCheckbox == thatCheckbox) { if (someCheckbox.checkState == ...
273273
*/
274-
open var value: Any? {
274+
public var value: Any? {
275275
switch checkState {
276276
case .unchecked:
277277
return uncheckedValue
@@ -287,7 +287,7 @@ open class M13Checkbox: UIControl {
287287
//----------------------------
288288

289289
/// The current state of the checkbox.
290-
open var checkState: CheckState {
290+
public var checkState: CheckState {
291291
get {
292292
return manager.state
293293
}
@@ -301,7 +301,7 @@ open class M13Checkbox: UIControl {
301301
- parameter checkState: The new state of the checkbox.
302302
- parameter animated: Whether or not to animate the change.
303303
*/
304-
open func setCheckState(_ newState: CheckState, animated: Bool) {
304+
public func setCheckState(_ newState: CheckState, animated: Bool) {
305305
if checkState == newState {
306306
return
307307
}
@@ -318,7 +318,7 @@ open class M13Checkbox: UIControl {
318318
- parameter animated: Whether or not to animate the change. Defaults to false.
319319
- note: If the checkbox is mixed, it will return to the unchecked state.
320320
*/
321-
open func toggleCheckState(_ animated: Bool = false) {
321+
public func toggleCheckState(_ animated: Bool = false) {
322322
switch checkState {
323323
case .checked:
324324
setCheckState(.unchecked, animated: animated)
@@ -337,7 +337,7 @@ open class M13Checkbox: UIControl {
337337
//----------------------------
338338

339339
/// The duration of the animation that occurs when the checkbox switches states. The default is 0.3 seconds.
340-
@IBInspectable open var animationDuration: TimeInterval {
340+
@IBInspectable public var animationDuration: TimeInterval {
341341
get {
342342
return manager.animations.animationDuration
343343
}
@@ -347,7 +347,7 @@ open class M13Checkbox: UIControl {
347347
}
348348

349349
/// The type of animation to preform when changing from the unchecked state to any other state.
350-
open var stateChangeAnimation: Animation = .stroke {
350+
public var stateChangeAnimation: Animation = .stroke {
351351
didSet {
352352

353353
// Remove the sublayers
@@ -412,7 +412,7 @@ open class M13Checkbox: UIControl {
412412
//----------------------------
413413

414414
/// The color of the checkbox's tint color when not in the unselected state. The tint color is is the main color used when not in the unselected state.
415-
@IBInspectable open var secondaryTintColor: UIColor? {
415+
@IBInspectable public var secondaryTintColor: UIColor? {
416416
get {
417417
return manager.secondaryTintColor
418418
}
@@ -422,7 +422,7 @@ open class M13Checkbox: UIControl {
422422
}
423423

424424
/// The color of the checkmark when it is displayed against a filled background.
425-
@IBInspectable open var secondaryCheckmarkTintColor: UIColor? {
425+
@IBInspectable public var secondaryCheckmarkTintColor: UIColor? {
426426
get {
427427
return manager.secondaryCheckmarkTintColor
428428
}
@@ -432,7 +432,7 @@ open class M13Checkbox: UIControl {
432432
}
433433

434434
/// The stroke width of the checkmark.
435-
@IBInspectable open var checkmarkLineWidth: CGFloat {
435+
@IBInspectable public var checkmarkLineWidth: CGFloat {
436436
get {
437437
return manager.paths.checkmarkLineWidth
438438
}
@@ -443,7 +443,7 @@ open class M13Checkbox: UIControl {
443443
}
444444

445445
// The type of mark to display.
446-
@IBInspectable open var markType: MarkType {
446+
@IBInspectable public var markType: MarkType {
447447
get {
448448
return manager.paths.markType
449449
}
@@ -462,7 +462,7 @@ open class M13Checkbox: UIControl {
462462
}
463463

464464
/// The stroke width of the box.
465-
@IBInspectable open var boxLineWidth: CGFloat {
465+
@IBInspectable public var boxLineWidth: CGFloat {
466466
get {
467467
return manager.paths.boxLineWidth
468468
}
@@ -473,7 +473,7 @@ open class M13Checkbox: UIControl {
473473
}
474474

475475
/// The corner radius of the box if the box type is square.
476-
@IBInspectable open var cornerRadius: CGFloat {
476+
@IBInspectable public var cornerRadius: CGFloat {
477477
get {
478478
return manager.paths.cornerRadius
479479
}
@@ -484,7 +484,7 @@ open class M13Checkbox: UIControl {
484484
}
485485

486486
/// The shape of the checkbox.
487-
open var boxType: BoxType {
487+
public var boxType: BoxType {
488488
get {
489489
return manager.paths.boxType
490490
}
@@ -495,7 +495,7 @@ open class M13Checkbox: UIControl {
495495
}
496496

497497
/// Wether or not to hide the checkbox.
498-
@IBInspectable open var hideBox: Bool {
498+
@IBInspectable public var hideBox: Bool {
499499
get {
500500
return manager.hideBox
501501
}
@@ -504,7 +504,7 @@ open class M13Checkbox: UIControl {
504504
}
505505
}
506506

507-
open override func tintColorDidChange() {
507+
public override func tintColorDidChange() {
508508
super.tintColorDidChange()
509509
manager.tintColor = tintColor
510510
}
@@ -513,7 +513,7 @@ open class M13Checkbox: UIControl {
513513
// MARK: - Layout
514514
//----------------------------
515515

516-
open override func layoutSubviews() {
516+
public override func layoutSubviews() {
517517
super.layoutSubviews()
518518
// Update size
519519
manager.paths.size = min(frame.size.width, frame.size.height)

0 commit comments

Comments
 (0)