Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add swiftlint config, fix iOS 13 deprecation
  • Loading branch information
Kaspik committed May 10, 2022
commit 1fc00de76a13bda13cda45cf929b287799e985f1
67 changes: 67 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
disabled_rules:
- trailing_whitespace
- file_length
- line_length
- type_body_length
- identifier_name
- function_parameter_count
- switch_case_alignment
- orphaned_doc_comment
- inclusive_language
- multiple_closures_with_trailing_closure

opt_in_rules:
- force_unwrapping
- implicitly_unwrapped_optional
- conditional_returns_on_newline
- empty_count
- empty_string
- extension_access_modifier
- closure_spacing
- fatal_error_message
- first_where
- toggle_bool
- unused_declaration
- modifier_order
- contains_over_first_not_nil
- convenience_type
- fallthrough
- unused_import
- unavailable_function
- strict_fileprivate
- explicit_init
- anyobject_protocol
- switch_case_on_newline
- contains_over_range_nil_comparison
- contains_over_filter_count
- contains_over_filter_is_empty
- empty_collection_literal
- flatmap_over_map_reduce
- no_space_in_method_call

excluded:
- Tests
- Vendor
- Scripts
- fastlane
- "DerivedData/**/*"
- "**/.build"
- "**/Package.swift"

function_body_length: 120
type_name:
min_length: 3
max_length: 60
identifier_name:
min_length: 3
max_length: 60
cyclomatic_complexity: 30
large_tuple:
warning: 4
error: 5
implicitly_unwrapped_optional:
mode: all_except_iboutlets

colon:
flexible_right_spacing: false
apply_to_dictionaries: true
5 changes: 2 additions & 3 deletions Sources/Controllers/MessagesViewController+Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal extension MessagesViewController {
selectedIndexPathForMenu = nil
}

currentMenuController.setMenuVisible(false, animated: false)
currentMenuController.hideMenu()

guard let selectedCell = messagesCollectionView.cellForItem(at: selectedIndexPath) as? MessageContentCell else { return }
let selectedCellMessageBubbleFrame = selectedCell.convert(selectedCell.messageContainerView.frame, to: view)
Expand Down Expand Up @@ -85,8 +85,7 @@ internal extension MessagesViewController {
currentMenuController.arrowDirection = .up
}

currentMenuController.setTargetRect(targetRect, in: view)
currentMenuController.setMenuVisible(true, animated: true)
currentMenuController.showMenu(from: view, rect: targetRect)
}

// MARK: - Helpers
Expand Down