3

From iOS 10 onwards apple have introduced the addAndSetupAccessoriesWithCompletionHandler method to add the HMAccessories to the home. In this method ^(NSError *error block is executing when we successfully add/cancel the accessory setup.

But my question is I would like to know when this viewController is presented? For reference I have attached the image. Thank you so much for your valuable time. Any ideas/suggestions will be appreciate.

enter image description here

Nirav Kotecha
  • 2,493
  • 1
  • 12
  • 26
SRI
  • 1,514
  • 21
  • 39
  • Unfortunately it doesn't look like there is an easy way to do this using public API. This view controller is created out-of-process and communicated to through a proxy. You *may* be able to figure out when presentation happens by swizzling `_presentAsTopmostViewController`, but I wouldn't recommend it. What are you trying to do that you need this information for? – saagarjha Jan 18 '18 at 12:33
  • @SaagarJha based on this I want to change the status bar color – SRI Jan 18 '18 at 12:56
  • Yeah, I don't think you can do that, since it's not in your process. It *might* pickup something you put into `UIAppearance`, but that's not a guarantee. – saagarjha Jan 24 '18 at 05:51

1 Answers1

0

You may take a look first on HomeKitDeveloperGuide, do you may use a trigger ?

A. STEFANI
  • 6,707
  • 1
  • 23
  • 48
  • @A STEFANI triggers are different than add accessory. I am asking about the accessorysetup viewController. According to me there is no interconnectivity between trigger and accessory. – SRI Jan 22 '18 at 05:06