SCLFlicManagerDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | SCLFlicManager.h |
Overview
@protocol SCLFlicManagerDelegate
The delegate of a SCLFlicManager instance must adopt the SCLFlicManagerDelegate
protocol. There are no
required delegate methods, but flicManagerDidChangeBluetoothState is highly recommended.
– flicManager:didGrabFlicButton:withError:
required method
@method flicManager:didGrabFlicButton:withError:
- (void)flicManager:(SCLFlicManager *_Nonnull)manager didGrabFlicButton:(SCLFlicButton *_Nullable)button withError:(NSError *_Nullable)error
Parameters
manager |
The manager providing this information. |
---|---|
button |
The SCLFlicButton object that was grabbed from the Flic app |
error |
In case something went wrong while grabbing the Flic this parameter will explain the error. |
Discussion
This delegate method is called every time the a new Flic button is grabbed from the Flic App.
Declared In
SCLFlicManager.h
– flicManager:didChangeBluetoothState:
@method flicManager:didChangeBluetoothState:
- (void)flicManager:(SCLFlicManager *_Nonnull)manager didChangeBluetoothState:(SCLFlicManagerBluetoothState)state
Parameters
manager |
The flic manager providing this information. |
---|---|
state |
The state that the manager changed to that caused the callback. Notice that there is no guarantee that it has not changed since! |
Discussion
If the bluetooth state on the iOS device or the flicManager changes for any reason, then this delegate method will be called
letting you that something happened. A parameter state
will be included, but it is a good practice to always read
the most current value of the bluetoothState
property on the manager to get info about the current state, since
there is a chance that the state could have changed again while the callback was sent. If the state changes to
SCLFlicManagerBluetoothStatePoweredOn
then all the previous connections and pending connections will be set back to
pending again.
Declared In
SCLFlicManager.h
– flicManagerDidRestoreState:
@method flicManagerDidRestoreState:
- (void)flicManagerDidRestoreState:(SCLFlicManager *_Nonnull)manager
Parameters
manager |
The flic manager providing this information. |
---|
Discussion
This delegate method will be called after the manager has been properly restored after being terminated by
the system. All the flic buttons that that you had prior to being terminated have been restored as well and
this is a good time to collect all the SCLFlicButton objects by using the knownButtons:
method in
order to properly restore the rest of your application. Do not forget to re-set the delegate on all buttons.
Declared In
SCLFlicManager.h
– flicManager:didForgetButton:error:
@method flicManager:didForgetButton:error:
- (void)flicManager:(SCLFlicManager *_Nonnull)manager didForgetButton:(NSUUID *_Nonnull)buttonIdentifier error:(NSError *_Nullable)error
Parameters
manager |
The flic manager providing this information. |
---|---|
buttonIdentifier |
The buttonIdentifier of the SCLFlicButton object that was cleared |
error |
In case there was an error |
Discussion
This callback will be made when a flic has been properly forgotten/removed, unless there was an error. Remember to also remove your references in case you still have any.
Declared In
SCLFlicManager.h