mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
added validat() to MSSticker via an extension
added a button to validate them wrote sticker validation test wrote sticker validation performance test
This commit is contained in:
4 files changed
+77
-2
No files matched your search
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// MSSticker.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 30/10/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Messages
|
||||
|
||||
extension MSSticker {
|
||||
func validate() -> Bool {
|
||||
let sizeGood = try? Data(contentsOf: imageFileURL).count < 500_000
|
||||
let nameGood = self.description.count < 150
|
||||
return sizeGood ?? false && nameGood
|
||||
}
|
||||
}
|
||||