Skip to content

Commit c82a7c0

Browse files
committed
update access control
1 parent aaae67e commit c82a7c0

12 files changed

+27
-23
lines changed

.swiftlint.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ custom_rules:
1111
regex: "override (open|public|private|internal|fileprivate)" # matching pattern
1212
message: "Use like open override or public override instead" # violation message. optional.
1313
severity: warning # violation severity. optional.
14+
opt_in_rules:
15+
- explicit_acl
16+
- explicit_top_level_acl
17+
explicit_acl: error
18+
explicit_top_level_acl: error
1419
included:
15-
- Sources
16-
- Tests
20+
- Sources

Sources/Controllers/MessagesViewController+Keyboard.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ extension MessagesViewController {
7272
}
7373

7474
@objc
75-
func adjustScrollViewInset() {
75+
internal func adjustScrollViewInset() {
7676
if #available(iOS 11.0, *) {
7777
// No need to add to the top contentInset
7878
} else {

Sources/Extensions/Bundle+Extensions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Foundation
2626

2727
extension Bundle {
2828

29-
public static func messageKitAssetBundle() -> Bundle {
29+
internal static func messageKitAssetBundle() -> Bundle {
3030
let podBundle = Bundle(for: MessagesViewController.self)
3131

3232
guard let resourceBundleUrl = podBundle.url(forResource: "MessageKitAssets", withExtension: "bundle") else {

Sources/Extensions/CGRect+Extensions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Foundation
2626

2727
extension CGRect {
2828

29-
init(_ x: CGFloat, _ y: CGFloat, _ w: CGFloat, _ h: CGFloat) {
29+
internal init(_ x: CGFloat, _ y: CGFloat, _ w: CGFloat, _ h: CGFloat) {
3030
self.init(x: x, y: y, width: w, height: h)
3131
}
3232

Sources/Extensions/NSAttributedString+Extensions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ import Foundation
2626

2727
extension NSAttributedString {
2828

29-
public func height(considering width: CGFloat) -> CGFloat {
29+
internal func height(considering width: CGFloat) -> CGFloat {
3030

3131
let constraintBox = CGSize(width: width, height: .greatestFiniteMagnitude)
3232
let rect = self.boundingRect(with: constraintBox, options: .usesLineFragmentOrigin, context: nil)
3333
return rect.height
3434

3535
}
3636

37-
public func width(considering height: CGFloat) -> CGFloat {
37+
internal func width(considering height: CGFloat) -> CGFloat {
3838

3939
let constraintBox = CGSize(width: .greatestFiniteMagnitude, height: height)
4040
let rect = self.boundingRect(with: constraintBox, options: .usesLineFragmentOrigin, context: nil)

Sources/Extensions/UIColor+Extensions.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ import Foundation
2626

2727
extension UIColor {
2828

29-
public static let incomingGray = UIColor(red: 230/255, green: 230/255, blue: 235/255, alpha: 1.0)
29+
internal static let incomingGray = UIColor(red: 230/255, green: 230/255, blue: 235/255, alpha: 1.0)
3030

31-
public static let outgoingGreen = UIColor(red: 69/255, green: 214/255, blue: 93/255, alpha: 1.0)
31+
internal static let outgoingGreen = UIColor(red: 69/255, green: 214/255, blue: 93/255, alpha: 1.0)
3232

33-
public static let inputBarGray = UIColor(red: 247/255, green: 247/255, blue: 247/255, alpha: 1.0)
33+
internal static let inputBarGray = UIColor(red: 247/255, green: 247/255, blue: 247/255, alpha: 1.0)
3434

35-
public static let playButtonLightGray = UIColor(red: 230/255, green: 230/255, blue: 230/255, alpha: 1.0)
35+
internal static let playButtonLightGray = UIColor(red: 230/255, green: 230/255, blue: 230/255, alpha: 1.0)
3636

37-
public static let sendButtonBlue = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
37+
internal static let sendButtonBlue = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
3838

3939
}

Sources/Extensions/UIEdgeInsets+Extensions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import Foundation
2626

2727
extension UIEdgeInsets {
2828

29-
public var vertical: CGFloat {
29+
internal var vertical: CGFloat {
3030
return top + bottom
3131
}
3232

33-
public var horizontal: CGFloat {
33+
internal var horizontal: CGFloat {
3434
return left + right
3535
}
3636

Sources/Extensions/UIView+Extensions.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import UIKit
2626

2727
extension UIView {
2828

29-
public func fillSuperview() {
29+
internal func fillSuperview() {
3030
guard let superview = self.superview else {
3131
return
3232
}
@@ -41,7 +41,7 @@ extension UIView {
4141
NSLayoutConstraint.activate(constraints)
4242
}
4343

44-
public func centerInSuperview() {
44+
internal func centerInSuperview() {
4545
guard let superview = self.superview else {
4646
return
4747
}
@@ -53,7 +53,7 @@ extension UIView {
5353
NSLayoutConstraint.activate(constraints)
5454
}
5555

56-
public func constraint(equalTo size: CGSize) {
56+
internal func constraint(equalTo size: CGSize) {
5757
guard superview != nil else { return }
5858
translatesAutoresizingMaskIntoConstraints = false
5959
let constraints: [NSLayoutConstraint] = [
@@ -65,7 +65,7 @@ extension UIView {
6565
}
6666

6767
@discardableResult
68-
public func addConstraints(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil, topConstant: CGFloat = 0, leftConstant: CGFloat = 0, bottomConstant: CGFloat = 0, rightConstant: CGFloat = 0, widthConstant: CGFloat = 0, heightConstant: CGFloat = 0) -> [NSLayoutConstraint] {
68+
internal func addConstraints(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil, topConstant: CGFloat = 0, leftConstant: CGFloat = 0, bottomConstant: CGFloat = 0, rightConstant: CGFloat = 0, widthConstant: CGFloat = 0, heightConstant: CGFloat = 0) -> [NSLayoutConstraint] {
6969

7070
if self.superview == nil {
7171
return []

Sources/Models/DetectorType.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public enum DetectorType {
3838
//case hashtag
3939
//case custom
4040

41-
public var textCheckingType: NSTextCheckingResult.CheckingType {
41+
internal var textCheckingType: NSTextCheckingResult.CheckingType {
4242
switch self {
4343
case .address: return .address
4444
case .date: return .date

Sources/Models/MessageStyle.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public enum MessageStyle {
3535
case topRight
3636
case bottomRight
3737

38-
var imageOrientation: UIImageOrientation {
38+
internal var imageOrientation: UIImageOrientation {
3939
switch self {
4040
case .bottomRight: return .up
4141
case .bottomLeft: return .upMirrored
@@ -52,7 +52,7 @@ public enum MessageStyle {
5252
case curved
5353
case pointedEdge
5454

55-
var imageNameSuffix: String {
55+
internal var imageNameSuffix: String {
5656
switch self {
5757
case .curved:
5858
return "_tail_v2"

Sources/Views/InputStackView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ open class InputStackView: UIStackView {
4646

4747
// MARK: Initialization
4848

49-
convenience init(axis: UILayoutConstraintAxis, spacing: CGFloat) {
49+
public convenience init(axis: UILayoutConstraintAxis, spacing: CGFloat) {
5050
self.init(frame: .zero)
5151
self.axis = axis
5252
self.spacing = spacing

Sources/Views/MessageLabel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ open class MessageLabel: UILabel {
371371

372372
}
373373

374-
func handleGesture(_ touchLocation: CGPoint) -> Bool {
374+
internal func handleGesture(_ touchLocation: CGPoint) -> Bool {
375375

376376
guard let index = stringIndex(at: touchLocation) else { return false }
377377

0 commit comments

Comments
 (0)