* iOS Share extension * Add Fastlane steps for iOS Share Extension * new multi file layout * Add recent label * Refactor code & identation * ux feedback * downsample images * remove options horizontal padding
27 lines
740 B
Swift
27 lines
740 B
Swift
//
|
|
// Publishers.swift
|
|
// MattermostShare
|
|
//
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
//
|
|
|
|
import Foundation
|
|
import Combine
|
|
import SwiftUI
|
|
|
|
extension Publishers {
|
|
static var keyboardHeight: AnyPublisher<CGFloat, Never> {
|
|
let willShow = NotificationCenter.default
|
|
.publisher(for: UIResponder.keyboardWillShowNotification)
|
|
.compactMap { $0.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect }
|
|
.map { $0.height }
|
|
|
|
let willHide = NotificationCenter.default
|
|
.publisher(for: UIResponder.keyboardWillHideNotification)
|
|
.map { _ in CGFloat(0) }
|
|
|
|
return Merge(willShow, willHide)
|
|
.eraseToAnyPublisher()
|
|
}
|
|
}
|