SCLFlicButtonDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | SCLFlicButton.h |
Overview
@protocol SCLFlicButtonDelegate
The delegate of a SCLFlicButton object must adopt the SCLFlicButtonDelegate
protocol. There are not
any required delegate methods, but all are recommended for proper use of the Flic.
– flicButton:didReceiveButtonDown:age:
@method flicButton:didReceiveButtonDown:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonDown:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the flic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on flic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The flic registered a button down event.
Declared In
SCLFlicButton.h
– flicButton:didReceiveButtonUp:age:
@method flicButton:didReceiveButtonUp:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonUp:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the flic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on flic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The flic registered a button up event.
Declared In
SCLFlicButton.h
– flicButton:didReceiveButtonClick:age:
@method flicButton:didReceiveButtonClick:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonClick:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the flic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on flic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The flic registered a button click event. The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
Declared In
SCLFlicButton.h
– flicButton:didReceiveButtonDoubleClick:age:
@method flicButton:didReceiveButtonDoubleClick:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonDoubleClick:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the flic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on flic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The flic registered a button double click event. The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
Declared In
SCLFlicButton.h
– flicButton:didReceiveButtonHold:age:
@method flicButton:didReceiveButtonHold:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonHold:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the flic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on flic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The flic registered a button hold event. The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
Declared In
SCLFlicButton.h
– flicButtonDidConnect:
@method flicButtonDidConnect:
- (void)flicButtonDidConnect:(SCLFlicButton *_Nonnull)button
Parameters
button |
The SCLFlicButton object that the event came from. |
---|
Discussion
This delegate method is called every time the flic physically connected to the iOS device, regardless of the reason for it.
Keep in mind that you also have to wait for the flicButtonIsReady:
before the flic is ready for use.
The connectionState
is not guaranteed to switch to SCLFlicButtonConnectionStateConnected
until
after the flicButtonIsReady:
callback has arrived.
Declared In
SCLFlicButton.h
– flicButtonIsReady:
@method flicButtonIsReady:
- (void)flicButtonIsReady:(SCLFlicButton *_Nonnull)button
Parameters
button |
The SCLFlicButton object that the event came from. |
---|
Discussion
This delegate method is called every time the flic has sucessfully connected and the autheticity has been verified.
You will not receive any press events from the flic before this callback has been sent. Typically this event will be sent
immediately after the flicButtonDidConnect:
event.
Declared In
SCLFlicButton.h
– flicButton:didDisconnectWithError:
@method flicButton:didDisconnectWithError:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didDisconnectWithError:(NSError *_Nullable)error
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
error |
The error that caused the disconnect. If the disconnect was intentional, then the parameter will be nil. |
Discussion
This delegate method is called every time the flic has disconnected, regardless of the reason for it. This can sometimes be called during a connection event that failed before the user was notified of the connection.
Declared In
SCLFlicButton.h
– flicButton:didFailToConnectWithError:
@method flicButton:didFailToConnectWithError:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didFailToConnectWithError:(NSError *_Nullable)error
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
error |
The error that caused the flic to fail to connect. |
Discussion
The requested connection failed. Please note that depending on at what point in the connection process the connection
failed you might also receive a regular flicButtonDidDisconnect: as well. If the connection fails and this callback is
made then the flic will always cancel the pending connection, regardless of what state the flic happens to be in.
This means that if you get a flicButton:didFailToConnectWithError:
then you
need to call the connect:
yourself to activate the pending connection once again.
Declared In
SCLFlicButton.h
– flicButton:didUpdateRSSI:error:
@method flicButton:didUpdateRSSI:error:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didUpdateRSSI:(NSNumber *_Nonnull)RSSI error:(NSError *_Nullable)error
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
RSSI |
The RSSI value represented in decibels. |
error |
In case there was a problem with updating the RSSI value then this parameter will describe the error. This will in all other cases be nil. |
Discussion
This callback verifies (unless an error occurred) that the RSSI value was updated.
Declared In
SCLFlicButton.h