Skip to content

Instantly share code, notes, and snippets.

@takasek
takasek / CodePiece.swift
Created October 4, 2016 09:40
やっぱり、他の数値型と違って、Boolをas NSNumberしたときだけは、同値は同一のclassインスタンスになるようだ #CodePiece
let num = 1 as NSNumber
num === num
//true
(num as Int as NSNumber) === (num as Int as NSNumber)
//false
(num as UInt as NSNumber) === (num as UInt as NSNumber)
//false