mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-06 08:55:34 +00:00
13 lines
294 B
Swift
13 lines
294 B
Swift
//
|
|
// Collection+SafeAccess.swift
|
|
// KeymanEngine
|
|
//
|
|
// Created by Gabriel Wong on 2017-10-13.
|
|
// Copyright © 2017 SIL International. All rights reserved.
|
|
//
|
|
|
|
extension Collection {
|
|
subscript (safe index: Index) -> Element? {
|
|
return indices.contains(index) ? self[index] : nil
|
|
}
|
|
}
|