GradientView would not work if its colors were passed during initialization
and never changed after. This was caused by the fact that `CAGradientLayer`'s
colors were updated in `GradientView.colors.didSet`, which isn't
called during `init()`.
Also allow access to `GradientView.gradientLayer` so that users of
that class can build more advanced gradients.
This fixes 10 of our Xcode warnings:
- `MessageReactionPicker.swift` was declaring a variable and not using
it, leading to "Immutable value 'emoji' was never used". I simply
removed it.
- `Stripe.swift` had a bunch of unnecessary `public`s, which caused
"'public' modifier is redundant for static property declared in a
public extension".
- `SubscriptionManager.swift` had an unnecessary `try`, causing "No
calls to throwing functions occur within 'try' expression".
- `CallService.swift:696` was calling a function and not using its
result, so I annotated that function with `@discardableResult`.
- `MobileCoinAPI+Configuration.swift` declared a variable with `var`
that should've used `let`.
Nothing major here, but wanted to find ones that were easy to fix.
notImplemented() ends up forwarding to fatalError() anyway, but before
it does so it flushes our logs. That's probably good to have. I think
most of these come from the default implementations Xcode provides for
you with a fix-it.
• use NSKeyedArchiver.archivedData(withRootObject:requiringSecureCoding:)
instead of NSKeyedArchiver.archivedData(withRootObject).
• use NSKeyedArchived.unarchivedObject(ofClass:from:) instead of
NSKeyedArchiver.unarchiveTopLevelObjectWithData().
We extend `UIView` with a new method, `renderAsImage`. It always returns a `UIImage`, but we marked its return type as `UIImage?`.
This removes that optionality and updates all callers.
This is a quick workaround for a behavior change in iOS 15.4 that's
causing CVBodyTextLabel to draw stretched or truncated text due to
cell reuse---the text is drawn in the cell's old size (which may be
insufficient, truncating the text), then the size changes and the
content that *is* drawn is potentially stretched.
Credit to Martin for finding this; I just profiled it to make sure it
wasn't going to be prohibitive.
ConversationPicker shared checkmark asset with media editor toolbar. The
checkmark was a little bit too small, also checked and unchecked indicators
had different size.
This commit updates ConversationPicker to use the same checkmark styling
that group UI has.
Promise chain in the HttpRequester did not handle connection errors
correctly. It was mapping all errors in the catch block to "No response"
or the equivalent of "request failed and it does not have a status code"
whereas in reality the errors in that catch block did have a status code
and should be passed into the completion handler for re-attestation or
similar. Fix checks for a valid status code from the error object in the
catch block and if present passes it to the completion handler as a
.success, otherwise, return a connection error sans the statusCode.