37 lines
1.3 KiB
Swift
37 lines
1.3 KiB
Swift
//
|
|
// SPImagePickerManager.swift
|
|
// Thimra
|
|
//
|
|
// Created by 佳尔 on 2025/4/25.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class SPImagePickerManager: NSObject {
|
|
static func createImagePicker(maxImagesCount: Int = 1,
|
|
allowCrop: Bool = false,
|
|
delegate: TZImagePickerControllerDelegate) -> TZImagePickerController {
|
|
|
|
let imagePickerVc = TZImagePickerController(maxImagesCount: 1, columnNumber: 4, delegate: delegate, pushPhotoPickerVc: true)
|
|
imagePickerVc?.photoWidth = 375
|
|
imagePickerVc?.photoPreviewMaxWidth = 500
|
|
imagePickerVc?.allowTakeVideo = false
|
|
imagePickerVc?.allowPickingVideo = false
|
|
imagePickerVc?.allowPickingImage = true
|
|
///相机按钮
|
|
imagePickerVc?.allowTakePicture = true
|
|
|
|
///原图按钮
|
|
imagePickerVc?.allowPickingOriginalPhoto = false
|
|
imagePickerVc?.maxImagesCount = maxImagesCount
|
|
imagePickerVc?.allowCrop = allowCrop
|
|
// allowsEditing
|
|
imagePickerVc?.scaleAspectFillCrop = true
|
|
imagePickerVc?.cropRect = CGRect(x: 0, y: (kSPScreenHeight - kSPScreenWidth) / 2 , width: kSPScreenWidth, height: kSPScreenWidth)
|
|
|
|
imagePickerVc?.modalPresentationStyle = .fullScreen
|
|
|
|
return imagePickerVc!
|
|
}
|
|
}
|