Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Fix NSInvalidArgumentException: Required value was nil in CodePlaygroundManager.swift #1227

Conversation

ivan-magda
Copy link
Member

Resolves #1226

This pull request includes several changes to the CodePlaygroundManager class in the iosHyperskillApp project, focusing on improving the method for converting a position to a text range in a UITextView and updating the method calls accordingly.

Method Renaming and Refactoring:

  • Renamed and refactored the textRangeFrom method to textRange to improve readability and return an optional UITextRange instead of a required one. (iosHyperskillApp/iosHyperskillApp/Sources/Frameworks/CodeEditor/Model/Analyze/CodePlaygroundManager.swift)

Method Call Updates:

  • Updated method calls to use the new textRange method name and handle the optional return type appropriately. (iosHyperskillApp/iosHyperskillApp/Sources/Frameworks/CodeEditor/Model/Analyze/CodePlaygroundManager.swift)
    • Updated the call in insertAtCurrentPosition to set the selectedTextRange.
    • Updated the call in the conditional check and assignment for selectedTextRange.

@ivan-magda ivan-magda added the bug Something isn't working label Nov 1, 2024
@ivan-magda ivan-magda added this to the 1.78 milestone Nov 1, 2024
@ivan-magda ivan-magda self-assigned this Nov 1, 2024
@github-actions github-actions bot added the ios iOS module task label Nov 1, 2024
@ivan-magda ivan-magda merged commit c90fd70 into develop Nov 1, 2024
12 checks passed
@ivan-magda ivan-magda deleted the fix/1226-ios-crash-nsinvalidargumentexception-required-value-was-nil-in-codeplaygroundmanagerswift branch November 1, 2024 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ios iOS module task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS: Crash NSInvalidArgumentException: Required value was nil in CodePlaygroundManager.swift
1 participant