I'm manage to pass parameters to userInfo with one of following methods:
// one of following methods can prevent crash issue on iPhone8 with iOS 14.6
// 1.
let userInfo: [String : Any] = [ConstValue.connectState:connectState,ConstValue.serialNumber:serialNumber]
NotificationCenter.default.post(name: Notification.Name(Global.HomeDeviceStateChange), object: nil, userInfo: userInfo)
// 2.
NotificationCenter.default.post(name: Notification.Name(Global.HomeDeviceStateChange), object: nil, userInfo: [ConstValue.connectState:connectState, ConstValue.serialNumber:serialNumber])
However it's still unclear why the original method would cause crash on iPhone8 with iOS14.6?
//This method would cause crash on iPhone8 with iOS 14.6
var userInfo: [String: Any] = [:]
userInfo[ConstValue.connectState] = connectState
userInfo[ConstValue.serialNumber] = serialNumber
NotificationCenter.default.post(name: Notification.Name(Global.HomeDeviceStateChange), object: nil, userInfo: userInfo)