mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Channel statistics improvements
This commit is contained in:
23
submodules/GraphCore/Sources/Helpers/Array+Utils.swift
Normal file
23
submodules/GraphCore/Sources/Helpers/Array+Utils.swift
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Array+Utils.swift
|
||||
// GraphTest
|
||||
//
|
||||
// Created by Andrei Salavei on 4/7/19.
|
||||
// Copyright © 2019 Andrei Salavei. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if os(macOS)
|
||||
import Cocoa
|
||||
#else
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
extension Array {
|
||||
func safeElement(at index: Int) -> Element? {
|
||||
if index >= 0 && index < count {
|
||||
return self[index]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user