another.im-ios/old/Helpers/Const.swift

54 lines
1.5 KiB
Swift
Raw Normal View History

2024-08-11 00:28:01 +00:00
import Foundation
import UIKit
enum Const {
// // Network
// #if DEBUG
// static let baseUrl = "staging.some.com/api"
// #else
// static let baseUrl = "prod.some.com/api"
// #endif
// static let requestTimeout = 15.0
// static let networkLogging = true
// App
static var appVersion: String {
let info = Bundle.main.infoDictionary
let appVersion = info?["CFBundleShortVersionString"] as? String ?? "Unknown"
let appBuild = info?[kCFBundleVersionKey as String] as? String ?? "Unknown"
return "v \(appVersion)(\(appBuild))"
}
static var appName: String {
Bundle.main.bundleIdentifier ?? "Conversations Classic iOS"
}
// Trusted servers
enum TrustedServers: String {
case narayana = "narayana.im"
case conversations = "conversations.im"
}
// Limit for video for sharing
static let videoDurationLimit = 60.0
// Upload/download file folder
static let fileFolder = "Downloads"
// Grid size for gallery preview (3 in a row)
static let galleryGridSize = UIScreen.main.bounds.width / 3
// Size for map preview for location messages
static let mapPreviewSize = UIScreen.main.bounds.width * 0.5
// Size for attachment preview
static let attachmentPreviewSize = UIScreen.main.bounds.width * 0.5
// Lenght in days for MAM request
static let mamRequestDaysLength = 30
// Limits for messages pagination
static let messagesPageMin = 20
static let messagesPageMax = 100
}