Swift 泛型返回

多说无用,直接上码

    func Pop()->T?{
        var result:Any?                     
        Locker.Lock()
        if  Data.count>0 {
            result = Data.removeAtIndex(0)
        }
        Locker.UnLock()
        return result as? T
    }

猜你喜欢

转载自blog.csdn.net/fghydx/article/details/45217353