mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-02-02 10:27:08 +01:00
Warning fixes
This commit is contained in:
parent
b9b4b5a853
commit
1b97feba62
@ -69,7 +69,7 @@ extension HashtagTimelineViewModel.State {
|
|||||||
|
|
||||||
override func didEnter(from previousState: GKState?) {
|
override func didEnter(from previousState: GKState?) {
|
||||||
super.didEnter(from: previousState)
|
super.didEnter(from: previousState)
|
||||||
guard let viewModel = viewModel, let stateMachine = stateMachine else { return }
|
guard viewModel != nil, let stateMachine = stateMachine else { return }
|
||||||
|
|
||||||
stateMachine.enter(Loading.self)
|
stateMachine.enter(Loading.self)
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ final class SearchDetailViewController: PageboyViewController, NeedsDependency {
|
|||||||
let searchController: CustomSearchController = {
|
let searchController: CustomSearchController = {
|
||||||
let searchController = CustomSearchController()
|
let searchController = CustomSearchController()
|
||||||
searchController.automaticallyShowsScopeBar = false
|
searchController.automaticallyShowsScopeBar = false
|
||||||
searchController.dimsBackgroundDuringPresentation = false
|
searchController.obscuresBackgroundDuringPresentation = false
|
||||||
return searchController
|
return searchController
|
||||||
}()
|
}()
|
||||||
private(set) lazy var searchBar: UISearchBar = {
|
private(set) lazy var searchBar: UISearchBar = {
|
||||||
|
@ -241,23 +241,24 @@ extension MediaHostToMediaPreviewViewControllerAnimatedTransitioning {
|
|||||||
return rect
|
return rect
|
||||||
}()
|
}()
|
||||||
let maskLayerToPath = maskLayerToRect.flatMap { UIBezierPath(rect: $0) }?.cgPath
|
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:
|
// FIXME:
|
||||||
let maskLayerToFinalPath = maskLayerToFinalRect.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
|
||||||
|
// }()
|
||||||
|
// let maskLayerToFinalPath = maskLayerToFinalRect.flatMap { UIBezierPath(rect: $0) }?.cgPath
|
||||||
|
|
||||||
if let maskLayerToPath = maskLayerToPath {
|
if let maskLayerToPath = maskLayerToPath {
|
||||||
maskLayer.path = maskLayerToPath
|
maskLayer.path = maskLayerToPath
|
||||||
|
@ -48,7 +48,7 @@ extension UIImage {
|
|||||||
guard let outputImage = filter.outputImage else { return nil }
|
guard let outputImage = filter.outputImage else { return nil }
|
||||||
|
|
||||||
var bitmap = [UInt8](repeating: 0, count: 4)
|
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)
|
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)
|
return UIColor(red: CGFloat(bitmap[0]) / 255, green: CGFloat(bitmap[1]) / 255, blue: CGFloat(bitmap[2]) / 255, alpha: CGFloat(bitmap[3]) / 255)
|
||||||
|
@ -97,15 +97,11 @@ extension NotificationView.ViewModel {
|
|||||||
$timestamp,
|
$timestamp,
|
||||||
timestampUpdatePublisher.prepend(Date()).eraseToAnyPublisher()
|
timestampUpdatePublisher.prepend(Date()).eraseToAnyPublisher()
|
||||||
)
|
)
|
||||||
.sink { [weak self] timestamp, _ in
|
.map { timestamp, _ in
|
||||||
guard let self = self else { return }
|
PlaintextMetaContent(string: timestamp?.localizedTimeAgoSinceNow ?? "")
|
||||||
guard let timestamp = timestamp else {
|
}
|
||||||
notificationView.dateLabel.configure(content: PlaintextMetaContent(string: ""))
|
.sink { text in
|
||||||
return
|
notificationView.dateLabel.configure(content: text)
|
||||||
}
|
|
||||||
|
|
||||||
let text = timestamp.localizedTimeAgoSinceNow
|
|
||||||
notificationView.dateLabel.configure(content: PlaintextMetaContent(string: text))
|
|
||||||
}
|
}
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
// notification type indicator
|
// notification type indicator
|
||||||
|
@ -451,7 +451,7 @@ extension StatusView.ViewModel {
|
|||||||
pollCountdownDescription
|
pollCountdownDescription
|
||||||
)
|
)
|
||||||
.sink { pollVoteDescription, pollCountdownDescription in
|
.sink { pollVoteDescription, pollCountdownDescription in
|
||||||
statusView.pollVoteCountLabel.text = pollVoteDescription ?? "-"
|
statusView.pollVoteCountLabel.text = pollVoteDescription
|
||||||
statusView.pollCountdownLabel.text = pollCountdownDescription ?? "-"
|
statusView.pollCountdownLabel.text = pollCountdownDescription ?? "-"
|
||||||
}
|
}
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
|
@ -42,7 +42,9 @@ extension MastodonTests {
|
|||||||
} receiveValue: { domain in
|
} receiveValue: { domain in
|
||||||
expectation.fulfill()
|
expectation.fulfill()
|
||||||
}
|
}
|
||||||
wait(for: [expectation], timeout: 10)
|
withExtendedLifetime(cancellable) {
|
||||||
|
wait(for: [expectation], timeout: 10)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(iOS 15.0, *)
|
@available(iOS 15.0, *)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user