mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
21 lines
408 B
Swift
21 lines
408 B
Swift
//
|
|
// Array+SwiftLint.swift
|
|
// SwiftLint
|
|
//
|
|
// Created by Scott Hoyt on 1/11/16.
|
|
// Copyright © 2016 Realm. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Array {
|
|
static func arrayOf(obj: AnyObject?) -> [Element]? {
|
|
if let array = obj as? [Element] {
|
|
return array
|
|
} else if let obj = obj as? Element {
|
|
return [obj]
|
|
}
|
|
return nil
|
|
}
|
|
}
|