Files
Folo/apps/mobile/native/ios/ImageViewer_swift/UINavigationBar_Extensions.swift
T
Innei 6e6b7e3936 feat(ios): Use the native image preview component (#3017)
* init

* done

* feat(mobile): integrate Galeria component for image preview and carousel

Signed-off-by: Innei <tukon479@gmail.com>

* revert

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

---------

Signed-off-by: Innei <tukon479@gmail.com>
2025-03-10 22:41:20 +08:00

20 lines
599 B
Swift

import UIKit
extension UINavigationBar {
func insert(to view: UIView) {
view.addSubview(self)
translatesAutoresizingMaskIntoConstraints = false
leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
if #available(iOS 11.0, *) {
topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor)
.isActive = true
} else {
topAnchor.constraint(equalTo: view.topAnchor)
.isActive = true
}
}
}