Skip to content

Commit 07d8d56

Browse files
authored
Merge pull request #32 from 3sidedcube/release/2.1.0
Release/2.1.0
2 parents 7bd6719 + 65fba31 commit 07d8d56

File tree

99 files changed

+1412
-1146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1412
-1146
lines changed

.swiftlint.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
excluded:
2+
- Carthage
3+
- Pods
4+
disabled_rules:
5+
- file_header
6+
- identifier_name
7+
opt_in_rules:
8+
- anyobject_protocol
9+
- array_init
10+
- attributes
11+
- closure_end_indentation
12+
- closure_spacing
13+
- collection_alignment
14+
- contains_over_filter_count
15+
- contains_over_filter_is_empty
16+
- contains_over_first_not_nil
17+
- contains_over_range_nil_comparison
18+
- discouraged_object_literal
19+
- empty_collection_literal
20+
- empty_count
21+
- empty_string
22+
- empty_xctest_method
23+
- enum_case_associated_values_count
24+
- explicit_init
25+
- extension_access_modifier
26+
- fallthrough
27+
- fatal_error_message
28+
- file_header
29+
- file_name
30+
- first_where
31+
- flatmap_over_map_reduce
32+
- identical_operands
33+
- joined_default_parameter
34+
- legacy_random
35+
- let_var_whitespace
36+
- last_where
37+
- legacy_multiple
38+
- literal_expression_end_indentation
39+
- lower_acl_than_parent
40+
- modifier_order
41+
- nimble_operator
42+
- nslocalizedstring_key
43+
- number_separator
44+
# - object_literal
45+
- operator_usage_whitespace
46+
- overridden_super_call
47+
- override_in_extension
48+
- pattern_matching_keywords
49+
- prefer_self_type_over_type_of_self
50+
- private_action
51+
- private_outlet
52+
- prohibited_interface_builder
53+
- prohibited_super_call
54+
- quick_discouraged_call
55+
- quick_discouraged_focused_test
56+
- quick_discouraged_pending_test
57+
- reduce_into
58+
- redundant_nil_coalescing
59+
- redundant_type_annotation
60+
- single_test_class
61+
- sorted_first_last
62+
# - sorted_imports
63+
- static_operator
64+
- strong_iboutlet
65+
- toggle_bool
66+
- unavailable_function
67+
- unneeded_parentheses_in_closure_argument
68+
- unowned_variable_capture
69+
- untyped_error_in_catch
70+
- vertical_parameter_alignment_on_call
71+
- vertical_whitespace_closing_braces
72+
# - vertical_whitespace_opening_braces
73+
- xct_specific_matcher
74+
- yoda_condition
75+
76+
force_cast: warning
77+
force_try:
78+
severity: error
79+
line_length:
80+
warning: 100
81+
ignores_comments: true
82+
ignores_urls: true
83+
reporter: "xcode"
84+
number_separator:
85+
minimum_length: 5
86+
file_name:
87+
excluded:
88+
- main.swift
89+
- LinuxMain.swift
90+
type_name:
91+
min_length: 3
92+
max_length: 50

Example/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4747
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
4848
}
4949
}
50-

Example/Extensions/UIButton+Extensions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
import UIKit
1111

1212
extension UIButton {
13-
13+
1414
@discardableResult
1515
static func addToCenter(
1616
of view: UIView,
@@ -22,14 +22,14 @@ extension UIButton {
2222
button.setTitle(title, for: .normal)
2323
button.addTarget(target, action: selector, for: .touchUpInside)
2424
button.setTitleColor(.systemBlue, for: .normal)
25-
25+
2626
view.addSubview(button)
2727
button.translatesAutoresizingMaskIntoConstraints = false
2828
NSLayoutConstraint.activate([
2929
button.centerXAnchor.constraint(equalTo: view.centerXAnchor),
3030
button.centerYAnchor.constraint(equalTo: view.centerYAnchor)
3131
])
32-
32+
3333
return button
3434
}
3535
}

Example/SceneDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
2222
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
2323
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
2424
guard let windowScene = (scene as? UIWindowScene) else { return }
25-
25+
2626
let window = UIWindow(windowScene: windowScene)
2727
window.rootViewController = UINavigationController(
2828
rootViewController: RootTableViewController()

Example/Theme/UIColor+Colors.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import UIKit
1212
// MARK: - UIColor + Colors
1313

1414
extension UIColor {
15-
15+
1616
/// Override `.red` color
1717
static let red = UIColor(
18-
red: 231/255, green: 19/255, blue: 36/255, alpha: 1
18+
red: 231 / 255, green: 19 / 255, blue: 36 / 255, alpha: 1
1919
)
2020

2121
/// Override `.darkGray` color
2222
static let darkGray = UIColor(
23-
red: 109/255, green: 110/255, blue: 112/255, alpha: 1
23+
red: 109 / 255, green: 110 / 255, blue: 112 / 255, alpha: 1
2424
)
2525
}

Example/Theme/UIImage+Images.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import Foundation
1010
import UIKit
1111

1212
extension UIImage {
13-
13+
1414
/// Circular information i
1515
static let information = UIImage(named: "information-32")
16-
16+
1717
/// Simple black cross
1818
static let cross = UIImage(named: "cross-32")
19-
19+
2020
/// Donations
2121
static let donations = UIImage(named: "donations")
2222
}

Example/ViewControllers/BadgeMessageViewController.swift

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ import MessageStackView
1212

1313
/// `UIViewController` to demo posting a `BadgeMessage` on a `PostView`
1414
class BadgeMessageViewController: UIViewController {
15-
15+
1616
/// `PostView` for posting messages
1717
private lazy var postView = view.createPostView()
18-
18+
1919
/// Arrray of titles for `badgeMessages` to demo
2020
private let badgeTitles: [(title: String, subtitle: String)] = [
2121
("Badge Earned!", "That's a badge unlock"),
2222
("Badge Earned Again!", "That's another badge unlock"),
2323
("Badge Earned Again And Again!", "That's yet another badge unlock")
2424
]
25-
25+
2626
/// `BadgeMessage`s from ``badgeTitles`
2727
private var badgeMessages: [BadgeMessage] {
2828
return badgeTitles.map {
@@ -34,12 +34,12 @@ class BadgeMessageViewController: UIViewController {
3434
)
3535
}
3636
}
37-
37+
3838
// MARK: - ViewController lifecycle
39-
39+
4040
override func viewDidLoad() {
4141
super.viewDidLoad()
42-
42+
4343
UIButton.addToCenter(
4444
of: view,
4545
title: "Post with updated insets",
@@ -50,26 +50,27 @@ class BadgeMessageViewController: UIViewController {
5050

5151
override func viewDidAppear(_ animated: Bool) {
5252
super.viewDidAppear(animated)
53-
53+
5454
badgeMessages.forEach {
5555
postView.post(badgeMessage: $0)
5656
}
5757
}
58-
58+
5959
override func viewDidDisappear(_ animated: Bool) {
6060
super.viewDidDisappear(animated)
61-
61+
6262
postView.postManager.invalidate()
6363
}
64-
64+
6565
// MARK: - Actions
66-
67-
@objc private func buttonTouchUpInside(_ sender: UIButton) {
66+
67+
@objc
68+
private func buttonTouchUpInside(_ sender: UIButton) {
6869
postView.edgeInsets = UIEdgeInsets(
6970
top: 3, left: 10, bottom: 3, right: 10
7071
)
71-
72-
let _ = postView.post(badgeMessage: BadgeMessage(
72+
73+
_ = postView.post(badgeMessage: BadgeMessage(
7374
title: "\(PostView.self) Insets Updated",
7475
subtitle: "The insets (margins) have been updated on the \(PostView.self)",
7576
image: .donations,

Example/ViewControllers/MessageViewController.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import UIKit
1010
import MessageStackView
1111

1212
class MessageViewController: UIViewController {
13-
13+
1414
private lazy var messageStackView: MessageStackView = {
1515
let messageStackView: MessageStackView = view.createMessageStackView()
1616
messageStackView.messageConfiguation = MessageConfiguration(
@@ -21,7 +21,7 @@ class MessageViewController: UIViewController {
2121
)
2222
return messageStackView
2323
}()
24-
24+
2525
override func viewDidAppear(_ animated: Bool) {
2626
super.viewDidAppear(animated)
2727

@@ -31,7 +31,7 @@ class MessageViewController: UIViewController {
3131
subtitle: "This is a subtitle, with a left image",
3232
leftImage: .information
3333
), dismissAfter: 6)
34-
34+
3535
// Post another message after delay
3636
DispatchQueue.main.asyncAfterNow(time: .seconds(2)) { [weak self] in
3737
guard let self = self else { return }
@@ -44,19 +44,19 @@ class MessageViewController: UIViewController {
4444
),
4545
dismissAfter: 8
4646
)
47-
47+
4848
messageView.rightImageViewSize = CGSize(width: 10, height: 10)
4949
self.addTapToRemoveGesture(to: messageView)
5050
}
51-
51+
5252
// Post a custom view after delay
5353
DispatchQueue.main.asyncAfterNow(time: .seconds(4)) { [weak self] in
5454
let view = CustomView()
5555
self?.messageStackView.post(view: view)
5656
self?.addTapToRemoveGesture(to: view)
5757
}
5858
}
59-
59+
6060
/// Add ability to remove `view` from `messageStackView` by tap
6161
///
6262
/// - Parameter view: `UIView`
@@ -68,21 +68,22 @@ class MessageViewController: UIViewController {
6868

6969
// MARK: - CustomView
7070

71-
fileprivate class CustomView: UIView {
72-
71+
private class CustomView: UIView {
72+
7373
init() {
7474
super.init(frame: .zero)
7575
backgroundColor = .blue
76-
76+
7777
translatesAutoresizingMaskIntoConstraints = false
7878
let heightConstraint = heightAnchor.constraint(equalToConstant: 50)
79-
79+
8080
// Allow the height to be defined by the stackView during animation
8181
heightConstraint.priority = .init(999)
82-
82+
8383
heightConstraint.isActive = true
8484
}
85-
85+
86+
@available(*, unavailable)
8687
required init?(coder: NSCoder) {
8788
fatalError("init(coder:) has not been implemented")
8889
}

0 commit comments

Comments
 (0)