Merge pull request #448 from 5sw/fix-warnings

Fix warnings
This commit is contained in:
Marcus Kida 2023-01-04 15:27:04 +01:00 committed by GitHub
commit 29cfbea1ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 30 deletions

7
.gitignore vendored
View File

@ -125,4 +125,9 @@ Localization/StringsConvertor/output
.DS_Store
env/**/**
!env/.env
!env/.env
## Ruby ###
vendor/
.bundle/

View File

@ -253,23 +253,6 @@ extension MediaHostToMediaPreviewViewControllerAnimatedTransitioning {
return rect
}()
let maskLayerToPath = maskLayerToRect.flatMap { UIBezierPath(rect: $0) }?.cgPath
let maskLayerToFinalRect: CGRect? = {
guard case .attachments = transitionItem.source else { return nil }
var rect = maskLayerToRect ?? transitionMaskView.frame
// clip tabBar when bar visible
guard let tabBarController = toVC.tabBarController,
!tabBarController.tabBar.isHidden,
let tabBarSuperView = tabBarController.tabBar.superview
else { return rect }
let tabBarFrameInWindow = tabBarSuperView.convert(tabBarController.tabBar.frame, to: nil)
let offset = rect.maxY - tabBarFrameInWindow.minY
guard offset > 0 else { return rect }
rect.size.height -= offset
return rect
}()
// FIXME:
_ = maskLayerToFinalRect.flatMap { UIBezierPath(rect: $0) }?.cgPath
if let maskLayerToPath = maskLayerToPath {
maskLayer.path = maskLayerToPath

View File

@ -48,7 +48,7 @@ extension UIImage {
guard let outputImage = filter.outputImage else { return nil }
var bitmap = [UInt8](repeating: 0, count: 4)
let context = CIContext(options: [.workingColorSpace: kCFNull])
let context = CIContext(options: [.workingColorSpace: kCFNull as Any])
context.render(outputImage, toBitmap: &bitmap, rowBytes: 4, bounds: CGRect(x: 0, y: 0, width: 1, height: 1), format: .RGBA8, colorSpace: nil)
return UIColor(red: CGFloat(bitmap[0]) / 255, green: CGFloat(bitmap[1]) / 255, blue: CGFloat(bitmap[2]) / 255, alpha: CGFloat(bitmap[3]) / 255)

View File

@ -108,11 +108,6 @@ extension MastodonStatusPublisher: StatusPublisher {
// Task: attachment
let uploadContext = AttachmentViewModel.UploadContext(
apiService: api,
authContext: authContext
)
var attachmentIDs: [Mastodon.Entity.Attachment.ID] = []
for attachmentViewModel in attachmentViewModels {
// set progress
@ -161,11 +156,6 @@ extension MastodonStatusPublisher: StatusPublisher {
guard pollOptions != nil else { return nil }
return self.pollExpireConfigurationOption.seconds
}()
let pollMultiple: Bool? = {
guard self.isPollComposing else { return nil }
guard pollOptions != nil else { return nil }
return self.pollMultipleConfigurationOption
}()
let inReplyToID: Mastodon.Entity.Status.ID? = try await api.backgroundManagedObjectContext.perform {
guard let replyTo = self.replyTo?.object(in: api.backgroundManagedObjectContext) else { return nil }
return replyTo.id

View File

@ -43,7 +43,9 @@ extension MastodonTests {
} receiveValue: { domain in
expectation.fulfill()
}
wait(for: [expectation], timeout: 10)
withExtendedLifetime(cancellable) {
wait(for: [expectation], timeout: 10)
}
}
func testConnectOnion() async throws {

View File

@ -1,6 +1,8 @@
source 'https://cdn.cocoapods.org/'
platform :ios, '15.0'
inhibit_all_warnings!
target 'Mastodon' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!