Files
iOS/Tests/App/Additions/UIAlertAction+Additions.swift
Zac West d6ea6c4762 Prompt in onboarding for new device name if already taken (#1895)
Fixes #415.

## Summary
When the device name is already taken by a different unique ID than the current device (in other words, when registering would produce a duplicate device name; login->logout is not affected), prompt for a replacement device name to use instead.

This will hopefully eliminate cases where the notify service is confused, and prevent sensor naming conflicts.
2021-10-25 22:36:01 -07:00

12 lines
374 B
Swift

import UIKit
extension UIAlertAction {
typealias Handler = @convention(block) (UIAlertAction) -> Void
var ha_handler: Handler {
// https://stackoverflow.com/questions/36173740/trigger-uialertaction-on-uialertcontroller-programmatically
let block = value(forKey: "handler")
return unsafeBitCast(block as AnyObject, to: Handler.self)
}
}