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

[MOB-14384] - API to modify Floating button image #633

Merged
merged 3 commits into from
May 26, 2021

Conversation

PravinPK
Copy link
Contributor

No description provided.

/// - imageData : The `Data` representation of a UIImage
public func setButtonImage(imageData: Data) {
DispatchQueue.main.async {
let image = UIImage(data: imageData)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we can't just take in a UIImage instead of Data? If not, I wonder if creating the UIImage off the main thread may be slightly more responsible.

Copy link
Contributor Author

@PravinPK PravinPK May 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taking in Data is more generic than UIImage. Given that UIImage is available in TVOS and iOS and not in watchOS (WKInterfaceImage)... Let me know otherwise (if there is any benefits passing UIImage)

+1 for moving UIImage creation outside the main thread

@@ -63,6 +63,17 @@ public class FloatingButton: NSObject, FloatingButtonPresentable {
}
}

/// Set the Image for the floating button.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My personal opinion here: But I don't think it is necessary to include doc comments on functions where the doc comment is defined in the protocol for the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed it was repetitive

@codecov
Copy link

codecov bot commented May 20, 2021

Codecov Report

Merging #633 (78a1a26) into dev-v3.1.4 (1599c5e) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@              Coverage Diff               @@
##           dev-v3.1.4     #633      +/-   ##
==============================================
- Coverage       85.32%   85.29%   -0.03%     
==============================================
  Files             104      104              
  Lines            4620     4624       +4     
==============================================
+ Hits             3942     3944       +2     
- Misses            678      680       +2     

@PravinPK PravinPK merged commit fbf5259 into adobe:dev-v3.1.4 May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants