[CM-82] Add linter in all the repos | iOS SDK#351
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe pull request applies numerous non-functional changes across the codebase. Most updates involve formatting improvements such as adjusting spacing around colons, braces, and commas; consolidating conditional statements; and standardizing method signatures. In addition, several unnecessary or redundant methods—mostly related to lifecycle or memory warning handling—were removed. A change to the GitHub Actions workflow now limits the pull request trigger to the master branch. These changes enhance code readability and consistency without altering the underlying functionality. Changes
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
✅ iOS Lint Test Result |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (3)
Sources/ViewModels/SearchResultViewModel.swift (1)
102-109: 🛠️ Refactor suggestionAvoid Using
.mapfor Side Effects.
In the sorting/filtering block withinsearchMessage(with:_:), the use of.mapto append elements toself.allMessagesis misleading since.mapis meant for transforming arrays. Consider refactoring to use.forEachto clearly indicate the intent for side effects. For example:- _ = messages - .sorted(by: { - Int(truncating: $0.createdAtTime) > Int(truncating: $1.createdAtTime) - }).filter { - $0.groupId != nil || $0.contactId != nil - }.map { - self.allMessages.append($0) - } + let sortedMessages = messages + .sorted(by: { Int(truncating: $0.createdAtTime) > Int(truncating: $1.createdAtTime) }) + .filter { $0.groupId != nil || $0.contactId != nil } + sortedMessages.forEach { self.allMessages.append($0) }This refactor clarifies the intent and improves code readability.
Sources/ViewModels/ALKConversationViewModel.swift (2)
963-971: 🛠️ Refactor suggestionValidation Logic in isValidReply
The code in
isValidReply(message:)now uses a clean do‑catch block to verify the message text against the provided regex. This improves error handling while ensuring the fallback logic for “email” and “phone_number” fields remains in place.Please double‑check that the default validations correctly cover your use cases.
1595-1600: 🛠️ Refactor suggestionSuggestion: Simplify getLastSentMessage
Instead of looping through
alMessages.reversed()with an explicit if‑check, you could use the Swift built‑in method:return alMessages.reversed().first(where: { $0.isMyMessage })This would make the code more concise and idiomatic.
🧰 Tools
🪛 SwiftLint (0.57.0)
[Warning] 1596-1596:
whereclauses are preferred over a singleifinside afor(for_where)
🧹 Nitpick comments (19)
Sources/Views/ALKReplyMessageView.swift (2)
289-295: Optimize Thumbnail Generation for Video PreviewWithin the
placeholderForPreviewImage(message:)method (for the.videocase), a new instance ofALKFileUtilsis created on each call to obtain a thumbnail. If this method is invoked frequently, consider reusing an instance ofALKFileUtilsor refactoring its usage to minimize potential overhead.
276-280: Avoid Using Print for Runtime Warnings in ProductionIn
getMapImageURL(for:), aSources/Controllers/ALKMultipleLanguageSelectionViewController.swift (1)
12-12: Formatting & SwiftLint Warning in Class Declaration.
The formatting changes look good; however, note that SwiftLint warns that the type name "ALKMultipleLanguageSelectionViewController" may be too long (it should be between 3 and 40 characters). Consider whether shortening the name is feasible for consistency with project naming conventions.🧰 Tools
🪛 SwiftLint (0.57.0)
[Warning] 12-12: Type name 'ALKMultipleLanguageSelectionViewController' should be between 3 and 40 characters long
(type_name)
Sources/CustomEvent/ALKCustomEventCallback.swift (1)
19-20: Improve Protocol Method Signature Formatting
The updated method signatures forratingSubmittedandrichMessageClickednow include proper spacing after commas and colons. This improves readability and better adheres to Swift style guidelines.Sources/Controllers/KMAutoCompleteManager.swift (1)
218-224: Refine Dictionary Formatting in Style Extension
In the computed propertytoAttributes, removing the trailing comma after the.font: fontentry leads to cleaner, more standardized dictionary syntax.Sources/Utilities/ALKAppSettingsUserDefaults.swift (1)
236-237: Standardize Variable Declaration Spacing
The declaration ofdefaultUploadOverrideHeadersnow correctly uses a space after the colon ([String: String]?) which enhances consistency with other variable declarations throughout the codebase.Sources/Utilities/LayoutProxy.swift (1)
81-106: Standardize Operator Overload Signatures
Adjusting the operator overloads for==,>=, and<=so that their opening braces are inline with the function signature improves code uniformity and readability across the DSL.Sources/Views/ALKMessageBaseCell.swift (2)
362-369: Iframe Height Calculation ValidationThe check that returns a default height (150) if the extracted height string contains a "%" symbol is clear. Please verify that a fixed 150 points is appropriate for all percentage‑based values or whether a dynamic calculation might ever be more desirable.
385-392: Iframe Width Calculation ImprovementSimilarly, the condition checking for a percentage in the width string now returns a default value of 250. This is straightforward; however, you might later consider a calculation that adapts to context if required.
Sources/Utilities/KMZendeskChatHandler.swift (1)
348-355: Efficient Bot Name RetrievalIn
getBotNameById(botId:userdetails:), the simple for‑loop is easy to understand. If performance ever becomes a concern (for groups with many members), you might consider using a dictionary for O(1) lookups.🧰 Tools
🪛 SwiftLint (0.57.0)
[Warning] 350-350:
whereclauses are preferred over a singleifinside afor(for_where)
Sources/Controllers/ALKCreateGroupViewController.swift (1)
633-636: Uniform Method Signature & Typo Suggestion in showParticpentsTapActionViewThe method signature for
showParticpentsTapActionView(options:row:groupViewModel:)has been reformatted for consistency.Typographical Note: Consider renaming the method to “showParticipantsTapActionView” (correcting “Particpents” to “Participants”) for clarity.
Sources/ViewModels/ALKConversationViewModel.swift (2)
973-980: Error Handling in isValidReply’s Regex ValidationThe catch block now handles regex errors and even falls back on field‑specific validation (for email and phone number). Consider logging these errors to aid in future debugging.
1553-1556: Caching the Last Sent MessageThe logic that checks if
lastSentMessageis nil before assigning a value helps to avoid redundant updates. To further improve clarity, consider adding a comment explaining the rationale behind caching the last sent message for future maintainers.Sources/Controllers/ALKConversationViewController.swift (6)
251-251: Initializer Parameter Formatting
The initializer’s signature now breaks before theindividualLaunchparameter (line 251). The improved formatting increases readability. Please confirm that this aligns with the project’s style guidelines and does not affect parameter ordering or behavior.
1549-1553: Submit Button Event Handling in Message Button Selection
In themessageButtonSelected(…)method, after validating that the selected button’s title matches (lines 1549–1551), the code now publishes a submit-action click event (line 1552):ALKCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.richMessageClick, data: ["action": selectedButton, "type": "submit"])Ensure that the selected button’s metadata is robustly handled and consider adding error handling if the required keys are missing.
1564-1567: Link Button Event Handling in Message Button Selection
For link-type buttons, the event publication now occurs as follows (lines 1564–1567):ALKCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.richMessageClick, data: ["action": selectedButton, "type": "link"])Consider if similar event handling logic in other parts of the code could be refactored into a shared helper method to improve maintainability.
1577-1578: List Template Action Handling
InlistTemplateSelected(element:defaultText:action:)(lines 1577–1578), the rich message click event is published with fallback default values:ALKCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.richMessageClick, data: ["conversationId": viewModel.channelKey?.stringValue ?? "Conversation ID not Present", "action": element ?? "Element not Present", "type": ""])Please check that these fallback strings are acceptable for downstream processing and analytics.
2378-2394: Delete Processed Messages Logic
ThedeleteProcessedMessages(index:)method (lines 2378–2394) now iterates backward over the messages usingstride(from:to:by:). Note that if a message belongs to the current user (isMyMessage), the loop returns immediately. Verify that this early return is correct and does not inadvertently skip deletions for messages that follow.
3085-3091: Image Size Validation Before Upload
Within the samefilesSelected(…)method (lines 3085–3091), the image size is validated using:guard image.getSizeInMb() < Double(ALApplozicSettings.getMaxImageSizeForUploadInMB()) else { DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { self.showUploadRestrictionAlert() } continue }This check is important to prevent oversized uploads. Consider verifying the unit conversion in
getSizeInMb()and whether additional rounding or error handling is needed for borderline sizes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (107)
.github/workflows/ios_linter_build_check.yaml(1 hunks).github/workflows/ios_linter_build_check.yaml(0 hunks).github/workflows/ios_linter_build_check.yaml(0 hunks)Sources/CustomEvent/ALKCustomEventHandler.swift(1 hunks)Sources/Utilities/UIAlertController+Extension.swift(1 hunks)Sources/Views/ALKFormMultiSelectItemCell.swift(1 hunks)Sources/Views/ALKFormSingleSelectItemCell.swift(1 hunks)Sources/Views/ALKInformationCell.swift(2 hunks)Sources/Views/KMFormMultiSelectButtonItemCell.swift(1 hunks)Sources/Controllers/ALKAlertViewController.swift(0 hunks)Sources/Controllers/ALKBaseViewController.swift(1 hunks)Sources/Controllers/ALKConversationListTableViewController.swift(5 hunks)Sources/Controllers/ALKConversationListViewController.swift(4 hunks)Sources/Controllers/ALKConversationViewController+AutoComplete.swift(3 hunks)Sources/Controllers/ALKConversationViewController+TableView.swift(7 hunks)Sources/Controllers/ALKConversationViewController+UIImagePicker.swift(2 hunks)Sources/Controllers/ALKConversationViewController.swift(31 hunks)Sources/Controllers/ALKCreateGroupViewController.swift(4 hunks)Sources/Controllers/ALKCustomCameraPreviewViewController.swift(0 hunks)Sources/Controllers/ALKCustomCameraViewController.swift(3 hunks)Sources/Controllers/ALKCustomCropImageViewController.swift(0 hunks)Sources/Controllers/ALKCustomPickerViewController.swift(3 hunks)Sources/Controllers/ALKCustomVideoCaptureController.swift(0 hunks)Sources/Controllers/ALKCustomVideoPreviewViewController.swift(0 hunks)Sources/Controllers/ALKFormDatePickerViewController.swift(1 hunks)Sources/Controllers/ALKGroupDescriptionController.swift(1 hunks)Sources/Controllers/ALKMapViewController.swift(0 hunks)Sources/Controllers/ALKMultipleLanguageSelectionViewController.swift(3 hunks)Sources/Controllers/ALKNewChatViewController.swift(1 hunks)Sources/Controllers/ALKParticipantSelectionViewContoller.swift(2 hunks)Sources/Controllers/ALKPhotoPicker.swift(1 hunks)Sources/Controllers/KMAutoCompleteManager.swift(3 hunks)Sources/Controllers/KMMuteConversationViewController.swift(1 hunks)Sources/CustomEvent/ALKCustomEventCallback.swift(1 hunks)Sources/CustomEvent/ALKCustomEventHandler.swift(0 hunks)Sources/CustomEvent/KMCustomEvent.swift(0 hunks)Sources/LinkPreview/ALKLinkPreviewManager.swift(5 hunks)Sources/Models/ALKChatBarConfiguration.swift(1 hunks)Sources/Models/ALKConfiguration.swift(2 hunks)Sources/Models/ALKGenericCard.swift(0 hunks)Sources/Models/ALKMessageModel.swift(4 hunks)Sources/Models/ALKNavigationItem.swift(1 hunks)Sources/Models/KMAutoCompleteItem.swift(1 hunks)Sources/Models/KMDocumentConfiguration.swift(1 hunks)Sources/Models/KMFormTemplate.swift(2 hunks)Sources/Models/KMListTemplateModel.swift(1 hunks)Sources/Models/KMVideoTemplate.swift(1 hunks)Sources/Utilities/ALKActivityIndicator.swift(1 hunks)Sources/Utilities/ALKAppSettingsUserDefaults.swift(5 hunks)Sources/Utilities/ALKHTTPManager.swift(2 hunks)Sources/Utilities/ALKImageView+Extension.swift(1 hunks)Sources/Utilities/ALKMessageViewModel+Extension.swift(1 hunks)Sources/Utilities/ALKRichMessageAutoSuggestion.swift(1 hunks)Sources/Utilities/ALKRichMessageStyle.swift(1 hunks)Sources/Utilities/ALKVideoUploadManager.swift(3 hunks)Sources/Utilities/ALMessage+Extension.swift(3 hunks)Sources/Utilities/Data+Extension.swift(1 hunks)Sources/Utilities/Date+Extension.swift(1 hunks)Sources/Utilities/KMConversationScreenConfiguration.swift(1 hunks)Sources/Utilities/KMMultipleSelectionConfiguration.swift(2 hunks)Sources/Utilities/KMTextToSpeech.swift(4 hunks)Sources/Utilities/KMZendeskChatHandler.swift(20 hunks)Sources/Utilities/LayoutProxy.swift(4 hunks)Sources/Utilities/MessageMention.swift(1 hunks)Sources/Utilities/NotificationHelper.swift(4 hunks)Sources/Utilities/RatingHelper.swift(2 hunks)Sources/Utilities/ReceivedMessageCaptionViewSizeCalculator.swift(0 hunks)Sources/Utilities/String+AutoComplete.swift(1 hunks)Sources/Utilities/String+Extension.swift(1 hunks)Sources/Utilities/TextViewSizeCalcultor.swift(1 hunks)Sources/ViewModels/ALKConversationViewModel.swift(33 hunks)Sources/ViewModels/ALKFormViewModelItem.swift(3 hunks)Sources/ViewModels/ALKGroupDescriptionViewModel.swift(1 hunks)Sources/ViewModels/SearchResultViewModel.swift(1 hunks)Sources/Views/ALKAttatchmentView.swift(1 hunks)Sources/Views/ALKAudioRecordingView.swift(2 hunks)Sources/Views/ALKChatBar.swift(6 hunks)Sources/Views/ALKChatCell.swift(3 hunks)Sources/Views/ALKDocumentCell.swift(0 hunks)Sources/Views/ALKEmailView.swift(4 hunks)Sources/Views/ALKFormCell.swift(13 hunks)Sources/Views/ALKFormMultiSelectItemCell.swift(3 hunks)Sources/Views/ALKFormSingleSelectItemCell.swift(2 hunks)Sources/Views/ALKFormTextItemCell.swift(0 hunks)Sources/Views/ALKFriendFormCell.swift(1 hunks)Sources/Views/ALKFriendLinkPreviewCell.swift(2 hunks)Sources/Views/ALKFriendMessageCell.swift(2 hunks)Sources/Views/ALKFriendMessageQuickReplyCell.swift(1 hunks)Sources/Views/ALKFriendNewChatCell.swift(0 hunks)Sources/Views/ALKGenericCardCell.swift(2 hunks)Sources/Views/ALKGroupDescriptionCell.swift(2 hunks)Sources/Views/ALKInformationCell.swift(6 hunks)Sources/Views/ALKLinkPreviewBaseCell.swift(1 hunks)Sources/Views/ALKLinkView.swift(1 hunks)Sources/Views/ALKListTemplateCell.swift(4 hunks)Sources/Views/ALKLocationCell.swift(1 hunks)Sources/Views/ALKMessageBaseCell.swift(7 hunks)Sources/Views/ALKMessageButtonCell.swift(2 hunks)Sources/Views/ALKMyFormCell.swift(1 hunks)Sources/Views/ALKMyLinkPreviewCell.swift(3 hunks)Sources/Views/ALKMyMessageCell.swift(3 hunks)Sources/Views/ALKMyMessageQuickReplyCell.swift(1 hunks)Sources/Views/ALKPhotoCell.swift(2 hunks)Sources/Views/ALKReplyMessageCell.swift(0 hunks)Sources/Views/ALKReplyMessageView.swift(1 hunks)Sources/Views/ALKTemplateMessageCell.swift(1 hunks)Sources/Views/ALKVideoCell.swift(4 hunks)
⛔ Files not processed due to max files limit (21)
- Sources/Views/ALKVoiceCell.swift
- Sources/Views/KMAudioRecordButton.swift
- Sources/Views/KMAutoCompleteManager+TableView.swift
- Sources/Views/KMConversationInfoView.swift
- Sources/Views/KMCustomCaptionViewController.swift
- Sources/Views/KMFormDropDownCell.swift
- Sources/Views/KMFormMultiSelectButtonItemCell.swift
- Sources/Views/KMFriendSourceURLViewCell.swift
- Sources/Views/KMFriendVideoTemplateCell.swift
- Sources/Views/KMLabelWithIconView.swift
- Sources/Views/KMLanguageView.swift
- Sources/Views/KMListTemplateView.swift
- Sources/Views/KMMentionAutoCompleteCell.swift
- Sources/Views/KMMultiSelectButton.swift
- Sources/Views/KMMyVideoTemplateCell.swift
- Sources/Views/KMStaticTopMessageCell.swift
- Sources/Views/KMTextViewPopUP.swift
- Sources/Views/KMVideoCell.swift
- Sources/Views/KMVideoTemplateCell.swift
- Sources/Views/SpeechToTextButton.swift
- Sources/Views/TranslucentView.swift
💤 Files with no reviewable changes (13)
- Sources/Utilities/ReceivedMessageCaptionViewSizeCalculator.swift
- Sources/CustomEvent/KMCustomEvent.swift
- Sources/Views/ALKFormTextItemCell.swift
- Sources/Controllers/ALKCustomVideoPreviewViewController.swift
- Sources/Controllers/ALKMapViewController.swift
- Sources/Controllers/ALKCustomCameraPreviewViewController.swift
- Sources/Views/ALKDocumentCell.swift
- Sources/Views/ALKReplyMessageCell.swift
- Sources/Models/ALKGenericCard.swift
- Sources/Controllers/ALKCustomVideoCaptureController.swift
- Sources/Controllers/ALKCustomCropImageViewController.swift
- Sources/Views/ALKFriendNewChatCell.swift
- Sources/Controllers/ALKAlertViewController.swift
👮 Files not reviewed due to content moderation or server errors (3)
- Sources/Controllers/ALKCustomCameraViewController.swift
- Sources/Controllers/ALKPhotoPicker.swift
- Sources/Views/ALKVideoCell.swift
🧰 Additional context used
🧠 Learnings (2)
Sources/ViewModels/ALKConversationViewModel.swift (1)
Learnt from: AbhijeetRanjan308
PR: Kommunicate-io/KommunicateChatUI-iOS-SDK#330
File: Sources/ViewModels/ALKConversationViewModel.swift:801-810
Timestamp: 2024-11-18T05:40:30.069Z
Learning: In `ALKConversationViewModel.swift`, within the `ALKConversationViewModel` class, when updating the user's email in the `send(message:isOpenGroup:metadata:)` method, callbacks are avoided to ensure that multiple tasks are executed immediately without delay. The code needs to execute without delay, and the UI handles any failures by prompting the email collection UI again elsewhere in the code.
Sources/Controllers/ALKConversationViewController.swift (2)
Learnt from: AbhijeetRanjan308
PR: Kommunicate-io/KommunicateChatUI-iOS-SDK#330
File: Sources/ViewModels/ALKConversationViewModel.swift:801-810
Timestamp: 2024-11-18T05:40:30.069Z
Learning: In `ALKConversationViewModel.swift`, within the `ALKConversationViewModel` class, when updating the user's email in the `send(message:isOpenGroup:metadata:)` method, callbacks are avoided to ensure that multiple tasks are executed immediately without delay. The code needs to execute without delay, and the UI handles any failures by prompting the email collection UI again elsewhere in the code.
Learnt from: AbhijeetRanjan308
PR: Kommunicate-io/KommunicateChatUI-iOS-SDK#340
File: Sources/ViewModels/ALKConversationViewModel.swift:0-0
Timestamp: 2025-01-22T05:49:07.484Z
Learning: For the KommunicateChatUI-iOS-SDK project, avoid suggesting utility classes for single use cases as it may lead to unnecessary abstraction and maintenance overhead.
🪛 SwiftLint (0.57.0)
Sources/Controllers/ALKMultipleLanguageSelectionViewController.swift
[Warning] 12-12: Type name 'ALKMultipleLanguageSelectionViewController' should be between 3 and 40 characters long
(type_name)
Sources/Views/ALKInformationCell.swift
[Warning] 148-148: Prefer static over class in a final class
(static_over_final_class)
Sources/Utilities/KMZendeskChatHandler.swift
[Warning] 34-34: Use 'next', 'this' or 'previous' instead to disable the 'type_body_length' rule once, or re-enable it as soon as possible`
(blanket_disable_command)
Sources/ViewModels/ALKConversationViewModel.swift
[Warning] 1596-1596: where clauses are preferred over a single if inside a for
(for_where)
Sources/Controllers/ALKConversationViewController.swift
[Error] 1561-1561: Force casts should be avoided
(force_cast)
🪛 actionlint (1.7.4)
.github/workflows/ios_linter_build_check.yaml
24-24: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
40-40: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
53-53: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (208)
Sources/Views/ALKPhotoCell.swift (2)
15-16: Consolidate Protocol Conformance for ReadabilityThe class declaration now presents all adopted protocols in a single line, which improves readability without affecting functionality.
354-361: Cosmetic Tweak in Method Call FormattingA space was added after the comma in the call to
downloadImageThumbnailUrlV2(before theblobKeyparameter). This minor formatting change enhances clarity and consistency with SwiftLint rules.Sources/Views/ALKReplyMessageView.swift (2)
1-7: Remove Redundant Lifecycle OverridesIt appears that the previously overridden methods—such as
awakeFromNib()andsetSelected(_:animated:)(typically used in cell subclasses)—have been removed from this UIView subclass. This cleanup is welcome since it simplifies the view’s lifecycle and avoids unnecessary customization. The removal is consistent with similar updates across the codebase.
117-124: Ensure Correct Handling of Attributed Text with MentionsThe
update(message:)method now conditionally applies attributed text when the message type is.text. The call toattributedTextWithMentions( defaultAttributes: Theme.message.toAttributes, mentionAttributes: Theme.mention.toAttributes, displayNames: displayNames )appears correct. Please verify that the
displayNamesparameter and the styling provided match the intended design and that any edge cases (like missing display names) are handled by theattributedTextWithMentions(_:)implementation.Sources/Utilities/ALKActivityIndicator.swift (1)
66-71: Formatting Adjustment in NSLayoutConstraint.activate Call
The trailing comma at the end of the height constraint has been removed. This change improves formatting consistency in compliance with the updated SwiftLint rules without affecting functionality.Sources/Models/KMVideoTemplate.swift (1)
9-10: Standardized Declaration Formatting
The removal of extra spaces around colons in the struct and property declarations ofKMVideoTemplateenhances code consistency and readability. No functional changes are introduced.Sources/Utilities/Data+Extension.swift (1)
15-18: Improved Dictionary Formatting for NSAttributedString Options
The adjustment removes an unnecessary line break before theNSAttributedString.DocumentReadingOptionKey.characterEncodingoption. This compact representation aligns with the updated SwiftLint formatting standards while keeping the functionality intact.Sources/Views/ALKTemplateMessageCell.swift (1)
12-14: Consistent Property Declaration Syntax
The removal of the extra space before the colon in the declaration ofborderColorstandardizes the code style across the project and adheres to the linting guidelines.Sources/Utilities/ALKRichMessageStyle.swift (1)
17-21: Removal of Extraneous Trailing Comma
The trailing comma afterCurvedImageButton.QuickReplyButtonStyle.selfin thestylesarray has been removed. This minor formatting adjustment improves the overall code style and ensures conformance with the linter rules.Sources/Utilities/String+Extension.swift (1)
89-98: Improve NSRange usage for phone number validation.
ReplacingNSMakeRange(0, count)withNSRange(location: 0, length: count)enhances clarity and aligns with Swift’s preferred API style without altering functionality.Sources/Models/KMDocumentConfiguration.swift (1)
25-29: Cosmetic update for documentOptions formatting.
Adding spaces after commas in the document types array improves readability and aligns with standard Swift formatting practices.Sources/Utilities/ALKVideoUploadManager.swift (2)
30-32: Refined conditional check for thumbnail URL.
Combining the optional binding with the emptiness check in one condition increases readability and conciseness.
83-88: Streamlined header assignment in URLRequest setup.
Consolidating the custom headers block into a single, well-formatted segment improves clarity without impacting functionality.Sources/Utilities/KMTextToSpeech.swift (4)
13-14: Consistent class declaration formatting.
The updated class signature and property initialization forKMTextToSpeechnow follow Swift style guidelines more closely, which aids in readability.
24-24: Clean property initialization.
The explicit initialization ofmessageQueueis now more visually distinct, promoting better understanding of the class's state.
38-42: Improved formatting in speakCurrentMessage.
Formatting thespeakCurrentMessagemethod with an inline guard statement and consistent spacing improves readability without changing its logic.
55-57: Refined guard usage in addMessagesToSpeech.
Simplifying the guard condition there minimizes nesting and clearly delineates the method’s control flow.Sources/Controllers/ALKFormDatePickerViewController.swift (1)
123-134: Streamlined initializer formatting.
Moving the closing parenthesis and brace to align with the last parameter declaration creates a more compact and readable initializer signature, without affecting functionality.Sources/Utilities/KMConversationScreenConfiguration.swift (1)
16-16: Clean up: removed redundant nil initializationThe removal of the explicit
= nilinitialization is appropriate since the default value of an optional isnilanyway. This change aligns with SwiftLint's style guidelines for avoiding redundant initializations.Sources/Views/KMFormMultiSelectButtonItemCell.swift (2)
55-60: Improved naming convention to follow Swift guidelinesRenaming
enum nameLabeltoenum NameLabelfollows Swift's recommended PascalCase naming convention for types and nested types.
44-48: Updated references to match the renamed enumGood job on consistently updating all references to the renamed enum from
Size.nameLabeltoSize.NameLabelto maintain code consistency.Sources/Views/ALKLinkView.swift (1)
167-167: Improved code formatting by removing extra whitespaceThe extra space between the colon and the type declaration has been removed, aligning with Swift style guidelines for consistent spacing in parameter declarations.
Sources/Utilities/ALKHTTPManager.swift (4)
159-159: Improved conditional formatting by removing extra whitespaceThe removal of extra space before the comma in the conditional statement improves code readability and follows SwiftLint guidelines.
164-164: Fixed spacing in type casting expressionThe adjustment of spacing around the type cast operator aligns with Swift style guidelines and improves code consistency.
198-198: Improved string formatting by standardizing spacingThe formatting adjustment in the Content-Disposition header string enhances code readability and consistency.
200-200: Standardized JSON string formattingThe formatting adjustment in the JSON string helps maintain consistent style across the codebase.
Sources/Models/ALKNavigationItem.swift (1)
64-64: Improved frame initialization syntaxThe code has been updated to use the modern Swift
CGRect(x:y:width:height:)initializer instead of the Objective-C styleCGRectMakefunction. This change improves code readability and follows Swift's recommended practices.Sources/Models/KMAutoCompleteItem.swift (1)
16-16: Consistent parameter formattingThe spacing before the colon in
supportsRichMessage: Bool?has been standardized, removing the extra space that was present previously. This improves code consistency and complies with Swift style guidelines.Sources/Utilities/MessageMention.swift (1)
197-197: Improved conditional formattingThe conditional statement has been reformatted to maintain alignment with the preceding code, moving from a multi-line format with a break after the
starts(with:)call to a consistent single-line format. This change improves code readability while preserving the same logic.Sources/Models/ALKChatBarConfiguration.swift (1)
43-43: Removed redundant nil initializationThe explicit
= nilinitialization has been removed from thesendButtonTintColorproperty declaration. This is a good change as Swift optional properties are implicitly initialized withnil, making the explicit initialization redundant.Sources/Utilities/ALKRichMessageAutoSuggestion.swift (2)
18-18: LGTM: Improved formatting with space before braceThe spacing before the opening brace in the guard statement has been standardized, which improves code consistency.
22-22: LGTM: Fixed dictionary type declaration spacingThe spacing around colon in the dictionary type annotation has been standardized from
[[String : Any]]to[[String: Any]], which aligns with Swift style guidelines.Sources/Views/ALKAttatchmentView.swift (1)
85-85: LGTM: Consolidated conditional statementThe multi-line conditional check has been consolidated to a single line, improving code readability without changing functionality.
Sources/Controllers/ALKCustomPickerViewController.swift (3)
200-200: LGTM: Removed redundant 'init' keywordThe redundant
initkeyword has been removed from theKMCustomCaptionViewControllerinitialization, which is a cleaner syntax.
249-249: LGTM: Removed unused orientation parameterThe unused orientation parameter has been removed from the closure, which is good practice for code clarity.
332-332: LGTM: Removed unused orientation parameterSimilar to the previous change, the unused orientation parameter has been removed from this closure as well, maintaining consistency.
Sources/Views/ALKLocationCell.swift (1)
17-17: LGTM: Improved class declaration formattingThe protocol conformance declarations have been consolidated onto a single line, making the class declaration more compact and consistent with Swift style guidelines.
Sources/Controllers/ALKCustomCameraViewController.swift (9)
131-131: Style improvement: Better optional binding formatting.The code now uses a cleaner single-line optional binding syntax which improves readability while maintaining the same functionality.
153-153: Style improvement: Cleaner optional binding.The formatting change to a single-line optional binding improves code readability while maintaining the same functionality.
499-499: Improved closure parameter handling.Removed unused orientation parameter from the requestImageDataAndOrientation completion handler, which streamlines the code and eliminates unused variables.
131-131: Clean optional binding syntaxThe code now uses a more concise syntax for optional binding, which improves readability.
153-153: Improved optional binding syntaxThe code now uses a more concise single-line optional binding instead of a multi-line if statement, which enhances readability.
499-499: Removed unused orientation parameterGood cleanup by removing the unused orientation parameter from the closure signature, making the code more concise.
131-131: Improved optional binding syntaxThe conditional statement has been refactored to use a more concise single-line format, which improves readability.
153-154: Improved optional binding syntaxThe conditional binding has been refactored to use a more concise single-line format, which improves readability. This change maintains the same functionality while making the code more SwiftLint-compliant.
499-499: Removed unused parameters in closureUnused orientation parameters have been removed from the closure, which is a good practice to reduce unnecessary variables.
Sources/Controllers/ALKPhotoPicker.swift (3)
42-42: Style improvement: Consistent parameter formatting.The spacing around parameters in the completion handler has been standardized, which improves code style consistency throughout the codebase.
42-42: Consistent spacing in function signatureThe spacing in the function signature has been standardized, which improves code readability and aligns with Swift style guidelines.
42-42: Improved parameter formattingThe spacing between parameters has been standardized for better readability and SwiftLint compliance.
Sources/Views/ALKVideoCell.swift (9)
16-16: Style improvement: Better protocol conformance formatting.The formatting of protocol conformance in the class declaration has been improved for better readability.
272-272: Style improvement: Added space after comma in method parameters.Added proper spacing after the comma in the method parameter list which improves readability and consistency.
301-301: Style improvement: Consistent parameter declaration formatting.The spacing around colons in the parameter declarations has been standardized to follow Swift style guidelines (no space before colon, space after colon).
272-272: Improved spacing in method callAdded a space after the comma in function parameters for better readability, which aligns with Swift style guidelines.
301-301: Consistent spacing in function declarationThe function declaration now has proper spacing after the colon in parameter type declarations, which improves readability and follows Swift style guidelines.
338-338: Lint-compliant method call formattingThe spacing in the method call has been standardized according to the SwiftLint rules, which improves code consistency.
272-272: Fixed function call spacingAdded proper spacing after the comma in function parameters, which improves readability and ensures SwiftLint compliance.
301-301: Improved parameter formattingThe function declaration has been updated with proper spacing around the parameter types, adhering to SwiftLint rules for consistent code style.
338-338: Minor formatting changesThe code structure has been maintained while ensuring proper formatting and alignment with SwiftLint guidelines.
Sources/Utilities/KMMultipleSelectionConfiguration.swift (3)
18-18: Style improvement: Consistent property declaration formatting.The spacing around the colon in the property declaration has been standardized to follow Swift style guidelines (no space before colon, space after colon).
20-20: Style improvement: Consistent property declaration formatting.The spacing around the colon in the property declaration has been standardized to follow Swift style guidelines (no space before colon, space after colon).
40-40: Style improvement: Consistent property declaration formatting.The spacing around the colon in the property declaration has been standardized to follow Swift style guidelines (no space before colon, space after colon).
Sources/Controllers/ALKMultipleLanguageSelectionViewController.swift (3)
15-15: Consistent Variable Declaration.
The update fromprivate var languages : [String] = []toprivate var languages: [String] = []improves consistency in spacing and adheres to Swift style guidelines.
91-91: Consistent Parameter Formatting in View Instantiation.
The change in the instantiation ofKMLanguageViewtolet view = KMLanguageView(title: item, languageList: configuration.languagesForSpeechToText)is a useful formatting improvement that enhances readability without affecting functionality.
101-101: Updated Call to addViewsForAutolayout.
The revised call usingview.addViewsForAutolayout(views: [titleLabel, closeButton, languageStackView])improves clarity and consistency by properly spacing the array elements.Sources/LinkPreview/ALKLinkPreviewManager.swift (2)
13-17: Initializer Formatting Improvement.
The revised initializer now places theresponseMainQueueparameter on the same indented block asworkBckQueue, which streamlines the signature for improved readability. No functional change is noted.
282-284: Refined Dictionary Literal for Attributed Options.
The formatting adjustment in the attributed options dictionary (merging the line break before.characterEncoding) enhances visual consistency. This minor change supports our overall linting goals.Sources/ViewModels/SearchResultViewModel.swift (1)
92-93: Method Signature Consolidation.
The updated signature ofsearchMessage(with:_:)now omits the unnecessary newline before the opening brace, which improves the readability and consistency of the code.Sources/Utilities/TextViewSizeCalcultor.swift (2)
13-19: Streamlined Function Signature forheight(text:maxWidth:).
Removing the newline before the opening brace in the function signature enhances consistency and code compactness. The logic remains intact.
21-27: Streamlined Function Signature forheight(attributedText:maxWidth:).
Similarly, the revised formatting for this method makes the function signature more concise while retaining its functionality.Sources/Utilities/RatingHelper.swift (2)
11-16: Consistent Parameter Formatting ingetRatingIconFor.
Changingrating : Inttorating: Intimproves consistency with Swift style guidelines. The switch cases and logic remain functionally correct.
32-50: Consistent Parameter Formatting ingetRatingIconForFiveStar.
Similarly, the updated signature ofgetRatingIconForFiveStar(rating: Int)enhances code readability. The implementation logic is clear and concise.Sources/Views/ALKChatBar.swift (6)
257-259: Clean formatting improvement.Removed unnecessary line break, improving code readability while maintaining Swift style guidelines.
504-506: Formatting improvement for clarity.Removed unnecessary line break in the view array, maintaining consistent formatting style.
526-528: Consistent constraint formatting.Removed unnecessary line break in the constraint definition, improving readability.
558-560: Improved formatting in conditional block.Removed unnecessary line break in the constraint setup within the conditional block, making the code more concise.
742-744: Cleaner conditional formatting.Removed unnecessary line break in the conditional statement, improving code readability.
894-896: Improved function signature formatting.Removed unnecessary line break in the method parameter declaration, maintaining consistent style.
Sources/Views/ALKMessageButtonCell.swift (2)
159-161: Simplified constraint declaration.Improved formatting consistency in the constraint setup without changing functionality.
360-362: Consistent constraint formatting.Improved formatting in the trailing anchor constraint without changing functionality.
Sources/Views/ALKMyLinkPreviewCell.swift (3)
219-223: Better constraint formatting.Removed unnecessary line break before the closing parenthesis, improving code consistency.
259-262: Improved method signature formatting.Removed line break in method signature, maintaining consistent style across the codebase.
280-282: More elegant type checking.Changed from using
as? String != nilto the more conciseis Stringfor type checking, which improves code readability while maintaining the same functionality.Sources/Views/ALKLinkPreviewBaseCell.swift (1)
42-43: Fixed parameter spacing.Removed extra space before the colon in the parameter type declaration, following Swift style guidelines.
.github/workflows/ios_linter_build_check.yaml (1)
39-40: Ensure Environment Variable Debug Step Is Consistent
The "Debug Environment Variables (Optional)" step is straightforward and helps in verifying the environment. No changes are required here, but please ensure that its output is useful during troubleshooting.🧰 Tools
🪛 actionlint (1.7.4)
40-40: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
Sources/Controllers/KMAutoCompleteManager.swift (1)
193-212: Streamline Conditional Formatting in Text View Delegate
ThetextViewDidChangeSelection(_:)method now uses a more concise conditional by removing unnecessary parentheses (e.g., changingif(isAutoSuggestion)toif isAutoSuggestion). This refactoring enhances clarity while preserving the original logic.Sources/Utilities/ALKAppSettingsUserDefaults.swift (2)
42-47: Consistent Brace Placement in Conditional Statements
The change in thegetCSATRatingBase()method—moving the opening brace to the same line as the conditional (i.e.if let appSettings = getAppSettings() {)—improves formatting consistency and readability without altering functionality.
127-132: Improve Conditional Formatting for Button Primary Color Retrieval
IngetButtonPrimaryColor(), reformatting the conditional check to place thelet buttonPrimaryColoron the same line as the condition improves clarity and consistency.Sources/Utilities/LayoutProxy.swift (1)
47-64: Enhance Readability with Inline Braces in Constraint Methods
Moving the opening braces for thegreaterThanOrEqual(to:offsetBy:)andlessThanOrEqual(to:offsetBy:)methods to the same line as their function signatures makes the code layout more compact and consistent. These formatting changes are strictly stylistic and do not affect functionality.Sources/Views/ALKListTemplateCell.swift (1)
133-137: Formatting Improvement: Simplify Conditional CheckThe updated removal of unnecessary parentheses in the conditional check for
templateRightPadding(i.e. changing from something like
if (templateRightPadding == 0) {
to
if templateRightPadding == 0 {) improves readability. Please ensure this style is applied uniformly across the codebase.Sources/Views/ALKMessageBaseCell.swift (3)
437-442: Improved Options Dictionary Formatting in NSAttributedString InitializationPlacing the
.characterEncoding: String.Encoding.utf8.rawValueoption on the same line as the other options makes the dictionary more compact and easier to read. No functional changes are noted.
548-557: Refined Formatting in setReplyMessageTextThe adjustments in the
setReplyMessageTextmethod—specifically aligning the closure for obtaining the attributed text—improve the code’s readability. Please verify that the message formatting logic remains correct.
567-575: Consistent Formatting in setMessageTextThe reformatting of the method
setMessageTextnow clearly separates the two paths (attributed text vs. plain text). Good to see consistency with the other similar methods.Sources/Utilities/KMZendeskChatHandler.swift (3)
46-48: Consistent Property Declaration FormattingThe newly added (or reformatted) properties such as
rootViewControllerandchatLogTokennow follow a clear and uniform style. This enhances code readability and consistency.
85-89: Refined Conditional Logic for Chat Transcript SendingThe updated compound condition using
happendNow, the check on transcript-sent status, and the progress flag makes the intent clear. Please verify that under all edge cases (for example, when the transcript might otherwise already be in progress) the behavior meets customer expectations.
265-273: Buffer Handling LogicThe implementation of
addMessageToBufferandremoveMessageFromBuffercorrectly avoids duplicate entries. It might be worthwhile to consider performance implications if the buffer grows large, though for typical use this is acceptable.Sources/Controllers/ALKCreateGroupViewController.swift (2)
270-273: Method Signature Formatting in setCurrentGroupSelectedMoving the closing parenthesis to the same line as the final parameter now yields a more compact and consistent method signature in
setCurrentGroupSelected. This style improves visual consistency throughout the code.
502-507: Streamlined Conditional in Collection View Data SourceThe updated one‑line conditional in
collectionView(_:numberOfItemsInSection:)(i.e.
if section == CollectionViewSection.groupDescription || section == CollectionViewSection.addMemeber {) is more concise and easier to read.Sources/ViewModels/ALKConversationViewModel.swift (8)
25-27: Improved Delegate Method SignatureThe updated method declaration
func showInvalidReplyAlert(kmField: KMField)
now removes extra spacing before the colon and matches the conventions used elsewhere. This small change improves overall consistency.
53-55: Consistent Declaration of Message PropertiesThe changes in the declaration for
lastMessageandlastSentMessagenow use a consistent spacing style. This minor improvement makes the code easier to read and maintain.
72-74: Uniform Property Declaration for Delayed Message ModelsUpdating
modelsToBeAddedAfterDelayto remove extraneous spaces improves readability and aligns with project conventions.
243-250: Refinement in containsMessage(_:) SignatureThe updated signature for
containsMessage(_:)is now clearer and consistent with other similar methods in the project.
1018-1022: Enhanced Message Metadata ContextThe addition of the user’s locale (retrieved from
NSLocale.preferredLanguages) into the message metadata is a useful improvement for handling localized content. This change should help ensure that any downstream processing can adjust accordingly.
1058-1060: Improved Chat Context ExtractionThe updated implementation that extracts the chat context from the metadata uses proper error handling around JSONSerialization. This makes the code more resilient if the metadata is malformatted.
1618-1623: Efficient Typing Indicator UpdateThe use of a scheduled timer to manage the welcome message’s typing indicator is effective. Just ensure that the delay (based on
botDelayTime) consistently meets the intended user experience.
1787-1790: Boundary Check Improvement in loadMessagesFromDBIntroducing a safe unwrap for the start time in
loadMessagesFromDBhelps prevent potential crashes when no messages are available. This change is both defensive and clear.Sources/Views/ALKFriendFormCell.swift (1)
145-145: Removed Trailing Comma in Constraint SetupThe removal of the trailing comma from the list of views in the
addViewsForAutolayoutcall cleans up the syntax. This minor formatting improvement ensures consistency with SwiftLint guidelines without affecting functionality.Sources/ViewModels/ALKGroupDescriptionViewModel.swift (1)
35-37: Enhanced Closure FormattingThe updated placement of the closure’s opening brace in the
channelService.updateChannelMetaDatacall—placing it on the same line as themetadataparameter—improves readability and maintains consistent formatting throughout the project.Sources/Views/ALKMyFormCell.swift (1)
100-101: Removed Unnecessary Trailing CommaThe trailing comma after
stateViewin the array passed toaddViewsForAutolayouthas been removed. This small change ensures syntactical correctness and aligns with the overall code formatting improvements across the codebase.Sources/Controllers/KMMuteConversationViewController.swift (1)
73-75: Cosmetic Whitespace Update in Time Values ArrayThe minor formatting change in the
timeValuesarray—specifically around the entry for "OneYear"—is purely cosmetic. It removes any extraneous trailing whitespace and maintains consistency, with no impact on functionality.Sources/Models/KMListTemplateModel.swift (1)
21-23: Improved Type Annotation ReadabilityThe update to the
articleIdproperty in theElementstruct—changing the declaration from
public let articleId: [String:String?]?
to
public let articleId: [String: String?]?
—adds a space after the colon. This adjustment enhances readability and aligns with the standardized formatting applied throughout the codebase.Sources/Controllers/ALKNewChatViewController.swift (1)
218-222: Improve condition readability in group description update.
The conditional that validates whether the trimmed group description isn’t empty has been consolidated into a single-line format. This formatting change improves readability without altering the behavior.Sources/Views/ALKFriendMessageQuickReplyCell.swift (1)
211-211: Consolidated trailing anchor constraint for timeLabel.
The trailing anchor constraint for the timeLabel has been reformatted by consolidating it on one line. This update enhances consistency with other constraints in the layout. There is no change in logic, so please ensure the intended layout behavior is maintained.Sources/Utilities/ALKMessageViewModel+Extension.swift (1)
151-157: Formatting improvements in conditional check for CTA restricted buttons.
The formatting adjustments in thecontainsHidePostCTARestrictedButtons()function (lines 153–155) cleanly express the logic used to check for “submit” and “link” button types. The clarity is improved while retaining the original logic.Sources/Controllers/ALKGroupDescriptionController.swift (1)
84-90: Refactor initializer parameter formatting.
The initializer now has a tidier parameter layout by consolidating the signature on fewer lines (notably theisFromGroupCreateparameter). This change improves readability while leaving functionality unchanged.Sources/Controllers/ALKBaseViewController.swift (1)
38-41: Streamline navigation controller condition.
The conditional statement checking whether the first view controller is an instance ofALKConversationViewControllerhas been refactored to fit on one line. This formatting update improves readability and maintains the same navigation logic.Sources/Models/KMFormTemplate.swift (3)
20-20: Formatting Improvement: Metadata Declaration in Element Struct
The spacing change frommetadata : [String:String]?tometadata: [String: String]?aligns with Swift conventions and improves readability without affecting functionality.
31-33: Formatting Adjustment: Option Struct Properties
The properties (label,value,selected, disabled) have been reformatted to maintain consistent spacing and adhere to Swift style guidelines.
38-38: Consistency in Action Struct Metadata Declaration
Updating themetadataproperty’s spacing in theActionstruct enhances consistency across the file.Sources/Utilities/String+AutoComplete.swift (1)
37-39: Formatting Refinement: Conditional Check Simplification
The consolidation of theifstatement—by moving the closing brace to follow the whitespace-check condition—simplifies the control flow and improves readability without changing logic.Sources/Utilities/NotificationHelper.swift (3)
125-129: Formatting Refinement in refreshConversation
Placing thegroupIdparameter inline with the call toisChatThreadIsOpenimproves clarity and aligns with linting standards while preserving functionality.
158-159: Improved Conditional Formatting in isKMVCAtTop
Eliminating the extra line break in theif let searchVCcondition makes the code more concise and easier to follow.
226-227: Parameter List Formatting in findControllerInStack
Adjusting the formatting of thecompletionparameter by removing the unnecessary newline improves the overall readability of the function signature.Sources/ViewModels/ALKFormViewModelItem.swift (3)
97-103: Formatting Adjustment in FormViewModelTextItem Initializer
The initializer forFormViewModelTextItemhas been reformatted to position its parameters consistently, thereby enhancing readability without any functional changes.
116-123: Stylistic Formatting in FormViewModelTextAreaItem Initializer
Reformatting the initializer parameters inFormViewModelTextAreaItempromotes consistency with the rest of the codebase while preserving the original logic.
180-190: Consistent Styling in FormViewModelDropdownItem
The reformatting of thetitleproperty and its initializer inFormViewModelDropdownItemaligns with Swift style guidelines, making the code more uniform and readable.Sources/Utilities/ALKImageView+Extension.swift (1)
23-26: Method Signature Formatting for imageBubble
Moving the opening brace to the same line as the method signature inimageBubble(for:isReceiverSide:showHangOverImage:)complies with the updated linting rules and enhances the clarity of the method declaration.Sources/Controllers/ALKConversationViewController+UIImagePicker.swift (2)
13-13: Improved protocol formattingThe formatting change makes the code more concise by putting both protocol declarations on the same line.
24-24: Better code formatting for conditional statementThe indentation change improves code readability by aligning the condition continuation with proper Swift style guidelines.
Sources/Views/ALKFormMultiSelectItemCell.swift (2)
66-73: Updated enum references to match PascalCase naming conventionThe constraint references have been updated to use PascalCase for enum names, which is consistent with Swift naming conventions.
80-80: Renamed enums to follow PascalCase conventionThe enum names have been updated from camelCase to PascalCase, which is the recommended Swift convention for type names. This improves code consistency.
Also applies to: 86-86
Sources/Views/ALKFriendMessageCell.swift (2)
258-258: Cleaner constraint array formattingRemoved unnecessary indentation in the NSLayoutConstraint activation array, making the code more concise.
333-333: Simplified type check in conditionChanged from using optional casting (
as?) to a direct type check (is), which is more appropriate here since you only need to verify the type rather than use the casted value.Sources/Controllers/ALKConversationViewController+TableView.swift (5)
44-44: Simplified conditional statementRemoved unnecessary parentheses around the condition check, adhering to Swift style guidelines.
57-57: Standardized print statement formattingAdjusted spacing around commas in the print statement for consistent formatting.
407-407: Improved parameter formatting in closuresAdded proper spacing after commas in the parameter lists of the
templateSelectedclosures, enhancing readability.Also applies to: 418-418
546-546: Simplified conditional checksRemoved unnecessary parentheses around condition checks, making the code cleaner and more readable.
Also applies to: 611-611, 623-623
575-575: Added helpful code commentAdded a clarifying comment to distinguish between video templates and attachments, which improves code maintainability.
Sources/Controllers/ALKParticipantSelectionViewContoller.swift (2)
62-62: Formatting improvement for conditional statement.The code formatting has been improved by keeping the entire condition on a single line with the opening brace, which aligns with SwiftLint's formatting rules.
188-188: Simpler error handling syntax.The error handling has been simplified by using
catch _instead of a more verbose pattern. This is a common Swift idiom when you need to catch errors but don't need to use the error object.Sources/Views/ALKAudioRecordingView.swift (2)
221-221: Improved formatting of conditional statement.The conditional statement has been reformatted to appear on a single line with its opening brace, which improves readability and follows SwiftLint style guidelines.
240-240: Consistent formatting of conditional statement.Similar to the previous change, this conditional statement has been reformatted to appear on a single line with its opening brace for consistency throughout the codebase.
Sources/Views/ALKEmailView.swift (2)
70-70: Removed trailing comma in constraint array.The trailing comma has been removed from the last item in the constraint array, following SwiftLint's style guidelines for cleaner code.
156-156: Removed trailing comma in constraint array.The trailing comma has been removed from the last item in the constraint array, maintaining consistency with other constraint arrays in the codebase.
Sources/Views/ALKFriendLinkPreviewCell.swift (2)
260-260: Removed trailing comma in constraint array.The trailing comma has been removed from the final constraint in the array, improving code consistency and following SwiftLint guidelines.
336-336: Simplified type checking for reply message detection.The code has been improved by replacing the verbose optional binding pattern with a more direct type check using the
isoperator. This makes the code more concise while maintaining the same functionality.Sources/Models/ALKMessageModel.swift (4)
72-72: Good spacing adjustment.The space before the colon has been properly removed to adhere to Swift's standard spacing convention in type declarations.
188-194: Consistent spacing in struct declaration.The spacing around colons in property declarations has been standardized to follow Swift conventions (no space before colon, one space after).
196-198: Proper spacing in nested struct.The spacing in the nested
Actionstruct has been standardized, with the property declarationupdateUserDetails: Bool?now correctly formatted.
221-231: Consistent dictionary type formatting.The return type and JSONDecoder usage have been updated to use consistent spacing around colons in dictionary type declarations (
[String: String]instead of[String:String]or[String : String]).Sources/Views/ALKMyMessageCell.swift (3)
209-209: Removed unnecessary trailing comma.The trailing comma after the last constraint in the NSLayoutConstraint.activate array has been removed, which is a good practice for code cleanliness.
245-247: Improved function signature formatting.The function signature has been formatted to follow a consistent style.
264-264: Enhanced type checking syntax.Changed from
metadata[AL_MESSAGE_REPLY_KEY] as? String != niltometadata[AL_MESSAGE_REPLY_KEY] is String, which is a more direct and preferred way to check if a value is of a specific type.Sources/Views/ALKMyMessageQuickReplyCell.swift (1)
174-174: Removed unnecessary trailing comma.The trailing comma after the last constraint in the NSLayoutConstraint.activate array has been removed, improving code cleanliness.
Sources/Views/ALKFormSingleSelectItemCell.swift (2)
60-68: Adopted proper enum naming convention.References to enum types have been updated to use UpperCamelCase (
Size.CheckBoxImageandSize.NameLabel), which follows Swift's naming convention for types.
74-86: Improved enum naming to follow Swift conventions.Renamed nested enums from lowerCamelCase to UpperCamelCase (
nameLabeltoNameLabelandcheckBoxImagetoCheckBoxImage), adhering to Swift's standard naming convention where type names (including enums) use UpperCamelCase.Sources/Utilities/Date+Extension.swift (1)
71-77: Consistent Method Signature FormattingThe updated placement of the opening brace on the same line as the method signature improves consistency with the current coding style. There are no functional changes in this segment.
Sources/Views/ALKGenericCardCell.swift (1)
134-134: Cosmetic Adjustment for Variable DeclarationThe removal of the extra space before the colon in the declaration
public static var coverImageContentMode: ContentMode = .scaleToFill
improves readability and consistency with the rest of the codebase.Sources/Views/ALKChatCell.swift (4)
280-283: Localized String Update for Waiting QueueThe change to set
nameLabel.textusing
localizedString(forKey: LocalizationKey.waitingQueTitle, withDefaultValue: "In queue...", fileName: localizationFileName)
appears to be a minor formatting update. Ensure that the localized string key and default value properly reflect the intended text for waiting queue conversations.
317-326: Cosmetic Adjustments in Attributed Text BlockMinor formatting changes in the attributed text block (including the use of the map function and fallback for
theLastMessage) improve code clarity without affecting functionality.
263-269:Details
✅ Verification successful
Simplify Mute Check for Contacts
Similarly, the branch for contacts can be simplified. Instead of checking using an if/else block, directly return the result of
contact.isNotificationMuted(). This small refactoring improves clarity.For example:
-if contact.isNotificationMuted() { - return true -} else { - return false -} +return contact.isNotificationMuted()
Simplify Mute Check for Contacts Refactor Approved
The suggested refactoring is valid—the if/else branch checking
contact.isNotificationMuted()is redundant since its boolean result can be returned directly. Please update the code by replacing the block:-if contact.isNotificationMuted() { - return true -} else { - return false -} +return contact.isNotificationMuted()This change improves clarity by simplifying the logic without altering behavior.
255-262:Details
✅ Verification successful
Simplify Mute Check for Channels
In the
isConversationMutedmethod, instead of using an if/else block to return a boolean value, consider directly returning the result ofchannel.isNotificationMuted(). This refactor can simplify the code and reduce redundancy.For example, modify:
-if channel.isNotificationMuted() { - return true -} else { - return false -} +return channel.isNotificationMuted()
Simplify Mute Check for Channels in ALKChatCell.swift
The refactor is valid. Instead of using an if/else block to return a boolean, directly returning the result of
channel.isNotificationMuted()removes unnecessary redundancy. Please update the code as follows:-if channel.isNotificationMuted() { - return true -} else { - return false -} +return channel.isNotificationMuted()This change makes the logic more concise without altering functionality.
Sources/Utilities/ALMessage+Extension.swift (3)
117-119: Improved Readability in Message FallbackThe slight reformatting of the case for
.information, .allButtonsusing a space after the comma enhances clarity. No behavior is impacted.
259-262: Simplified isMyMessage ConditionRemoving unnecessary parentheses in the
isMyMessagecomputed property improves readability. This change is cosmetic and does not affect functionality.
395-397: Consistent Formatting in Geocode ParsingReformatting the conditional check for latitude and longitude (i.e.
if let lat = lat as? Double, let lon = lon as? Double) consolidates the logic onto one line for better readability. No functional changes are introduced.Sources/Controllers/ALKConversationViewController+AutoComplete.swift (4)
15-15: Concise Auto-Completion ConditionThe reformatted condition
if isAutoSuggestionRichMessage, message.count >= 2 { … }
clearly expresses the requirement for triggering auto-suggestions. This is a stylistic improvement only.
33-37: Formatting in Auto-Completion Dictionary ParsingThe adjustments made in the loop parsing the
suggestionDict(ensuring proper spacing in lines like the lookup for"searchKey") enhance readability. Verify that the keys used in the dictionary match the expected values.
41-42: Mapping Suggestion Array with MapUsing the map function to convert
suggestionArrayto an array ofKMAutoCompleteItemis a concise alternative to an explicit loop. This adjustment is clear and effective.
46-48: Filtering Auto-Completion ItemsReformatting the filter closure in
autoSuggestionManager.items = arrayOfAutocomplete.filter { $0.key.lowercased().contains(searchMessage) }
improves code clarity. The change is cosmetic and maintains the original functionality.Sources/Models/ALKConfiguration.swift (2)
194-194: Space before colon removed for Swift standard styleThe code formatting has been updated to follow Swift style guidelines by removing the space before the colon in variable declarations.
221-221: Standardized type declaration formattingSpace before the colon in these variable declarations has been removed, which aligns with Swift style guidelines. This change makes the code more consistent with standard Swift formatting.
Also applies to: 226-226, 229-229
Sources/Controllers/ALKConversationListViewController.swift (4)
107-107: Improved type checking usingisoperatorChanged from using
as?to the more appropriateisoperator for type checking. This improves both code readability and efficiency since we only need to check the type, not cast the object.
324-329: Formatted conditional statement styleThe closing brace of the if statement has been moved to the same line as the condition, making the code more compact and consistent with SwiftLint style guidelines.
463-464: Improved conditional statement formattingThe formatting of this conditional statement has been standardized to match the codebase style guidelines.
476-479: Usedisoperator for type checkingChanged from using
as?to the more appropriateisoperator for type checking, which is more direct and follows Swift best practices.Sources/Views/ALKInformationCell.swift (5)
130-133: Standardized property declarationsRemoved spaces before colons in property declarations to align with Swift style guidelines.
Also applies to: 135-138
169-169: Added space after comma for consistent spacingAdded proper spacing after the comma in the conditional statement to improve readability and follow standard Swift formatting.
250-250: Improved CGRect constructor spacingRemoved space before the comma in CGRect constructor to maintain consistent spacing throughout the codebase.
264-264: Standardized function and control flow spacingAdded space before opening brace in function declaration and adjusted spacing in else condition for consistency with Swift style guidelines.
Also applies to: 268-270
441-445: Used Swift-idiomatic Dictionary syntaxChanged return type from
Dictionary<String,Any>?to[String: Any]?, which is the more modern and idiomatic Swift syntax. Also improved spacing in JSON serialization method params.Sources/Views/ALKGroupDescriptionCell.swift (2)
50-53: Improved function declaration styleRemoved line break after function parameter list before the opening brace to maintain a consistent style across the codebase, following Swift linting rules.
119-122: Consistent function declaration formattingRemoved line break after function parameter list before the opening brace, maintaining consistent style with other function declarations in the codebase.
Sources/Utilities/UIAlertController+Extension.swift (2)
67-67: Good rename of enum to follow Swift naming conventions.This change improves the codebase by renaming the enum from 'activityAlert' to 'ActivityAlert', following Swift's convention where type names (including enums) should start with an uppercase letter.
72-73: Properly updated all references to the renamed enum.All references to the renamed enum have been consistently updated throughout the codebase, ensuring that the code continues to function correctly after the name change.
Also applies to: 77-77, 84-84, 88-89
Sources/Views/ALKFormCell.swift (6)
14-14: Good spacing improvement for property declaration.Removing the space before the colon in the property type declaration (
cell: KMFormDropDownCell?instead ofcell : KMFormDropDownCell?) follows Swift style guidelines.
218-219: Improved formatting of conditional statements.The formatting changes to these conditional statements improve code readability by maintaining consistent spacing and indentation, which makes the control flow easier to follow.
Also applies to: 250-251, 276-277, 315-317, 353-354
322-326: Simplified conditional check formatting.The formatting of these conditional checks has been improved for better readability while maintaining the same logic flow.
Also applies to: 361-365
508-508: Standardized tuple formatting.Proper spacing has been added in tuple definitions
(Int, String?)instead of(Int,String?), improving readability.Also applies to: 514-514
583-597: Improved conditional nested if statements.The refactoring of these nested conditional statements improves readability while maintaining the same logical flow of the code.
628-628: Consistent formatting in property declaration.Added space after comma in the tuple type declaration, which maintains consistent formatting throughout the codebase.
Sources/CustomEvent/ALKCustomEventHandler.swift (5)
24-30: Improved optional handling in faqClick case.The code has been refactored to use
if letfor cleaner optional handling, improving readability. The new implementation also properly handles URL creation, making the code more robust.
32-36: Simplified message extraction using if let.Using
if letfor optional binding provides a cleaner approach compared to the previous implementation with guard statements.
37-41: Improved optional binding in notification handlers.The refactoring for these notification handlers using
if letrather than guard statements results in simpler code with fewer levels of nesting while maintaining the same functionality.Also applies to: 42-48, 49-53, 54-58
59-64: Enhanced readability in richMessageClick handler.Using optional chaining with nil coalescing operators provides a more concise implementation that handles potential nil values gracefully.
71-74: Improved message handling using forEach.The code now uses a more functional approach with
if letcombined withforEachto iterate through messages, which is more concise than the previous implementation.Sources/Controllers/ALKConversationListTableViewController.swift (5)
122-122: Improved spacing before curly brace.Added space before the opening curly brace in the guard statement following Swift style guidelines.
139-139: Enhanced readability with consistent spacing in alert initialization.Properly formatted the UIAlertController initialization with consistent spacing around parameters, improving code readability.
151-151: Fixed spacing in UIAlertAction initialization.Added appropriate spacing in the UIAlertAction initialization, conforming to standard Swift formatting practices.
169-169: Consistent parameter spacing in method call.Added proper spacing after the colon in the method parameter, maintaining consistent formatting throughout the codebase.
193-193: Standardized spacing in UIAlertAction declaration.Fixed spacing between parameters in the UIAlertAction initialization, making the code more readable.
Sources/Controllers/ALKConversationViewController.swift (9)
25-25: Equality Check in ViewModel Setter
In the setter for theviewModelproperty, the condition now comparesupdatedVM.conversationProxy == viewModel.conversationProxy(line 25). Please verify that including theconversationProxyin the equality check is intentional and covers all cases to prevent unnecessary resets ofisFirstTime.
693-695: Streamlined Conversation Info Tap Handling
In theconversationInfoViewTap(_:)method (lines 693–695), the event is now published directly viaALKCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.conversationInfoClick, data: nil)Ensure that this change meets the new event‐tracking requirements and that no additional context is required in the published data.
1199-1201: Conversation Proxy Retrieval Update
Within thepushNotification(notification:)method, the block retrieving the conversation proxy (lines 1199–1201) now uses:let conversationProxy = ALConversationService().getConversationByKey(convId) { convProxy = conversationProxy }Please verify that this closure syntax and retrieval appropriately handle the possibility of a nil proxy and that any failure is managed downstream.
1299-1304: Auto-Suggestion Sync Logic Revision
The updatedsyncAutoSuggestionMessage(message:)(lines 1299–1304) now checks:guard let message = message else { return } if message.isAutoSuggestion(), !ALApplozicSettings.isAgentAppConfigurationEnabled() { setupAutoSuggestion(message) }Confirm that this logic correctly differentiates auto-suggestion messages when the agent app configuration is disabled.
1309-1311: Auto-Suggestion Processing in Sync
In thesync(message:)method, right after ensuring the message is not sent (line 1308), the code now checks for auto-suggestion messages (lines 1309–1311). Please verify that adding this branch does not interfere with the handling of other incoming message types.
1521-1523: Rich Message Click Event Publishing
WithinrichButtonSelected(index:title:message:isButtonClickDisabled:)(lines 1521–1523), the event is published with the conversation ID and action details:if let conversationId = message.channelKey { ALKCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.richMessageClick, data: ["conversationId": conversationId.stringValue, "action": action, "type": type]) }Please verify that
conversationId.stringValuereturns the expected format and that the event payload fully captures the required context.
2104-2110: Hidden Field Data Concatenation in Form Template
Within the loop processing form template elements (lines 2104–2110), the code now attempts to extract a hidden field’s name and append its associated value to the post-back message string:if element.contentType == .hidden, let elementData = element.data, let hiddenName = elementData.name { postBackMessageString.append("\(hiddenName) : \(postFormData[hiddenName] ?? "")\n") break }Please confirm whether processing should stop after the first hidden field (due to the
break) or if multiple hidden fields are expected to be concatenated.
2398-2414: Reload Processed Messages Iteration
InreloadProcessedMessages(index:)(lines 2398–2414), the code similarly iterates in reverse to reload sections:for messageIndex in stride(from: index-1, to: -1, by: -1) { // Reload logic per message }Ensure that this reverse iteration safely handles boundary conditions and that reloading is correctly triggered for all appropriate messages.
3082-3164: Multiple File Selection Handling in Custom Picker Delegate
ThefilesSelected(images:gifs:videos:caption:)method (lines 3082–3164) now processes images, GIFs, and videos from the picker. The overall logic—including file count calculation and insertions into the table view—appears comprehensive. Please verify that the ordering and asynchronous upload routines work as expected for all media types.
Summary
Summary by CodeRabbit
These internal improvements do not affect the app’s functionality or end-user experience.