mergNotify |
Type | command |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | mergNotify <pNotification>, [<pDistributed>]
|
Associations | mergnotify |
Summary | This command registers for a notification to be sent to the calling
control (me) whenever it occurs
|
Introduced | 8.0 |
OS | ios, mac |
Platforms | desktop, mobile |
Parameters | Name | Type | Description |
---|
pNotification | | The name of the notification your control should
receive. The notification will be sent to the control with a single
pUserInfo parameter. This parameter is the result of using the
description method of the NSNotification userInfo dictionary. Some
notifications do not have any userInfo so this parameter may be empty.
|
pDistributed | | (optional with false default) On OS X this option allows
you to use the distributed notification center to recieve notifications
from other applications. The parameter has no effect on iOS.
|
|
Example | local sTimeResignedActive
constant kMaxTimeResignedBeforeSessionExpires = 300
on openStack
mergNotify "UIApplicationWillResignActiveNotification"
mergNotify "UIApplicationDidBecomeActiveNotification"
end openStack
on UIApplicationWillResignActiveNotification pUserInfo
put the seconds into sTimeResignedActive
end UIApplicationWillResignActiveNotification
on UIApplicationDidBecomeActiveNotification pUserInfo
if sTimeResignedActive <> "" then
if the seconds - sTimeResignedActive > kMaxTimeResignedBeforeSessionExpires then
end if
end if
end UIApplicationDidBecomeActiveNotification
|
Values | Name | Type | Description |
---|
return | | An id for the notification observer to be used by
mergNotifyCancel
|
|
Description | The same notification may be registered by multiple controls in your
app. If a single control registers for the same notification multiple
times it will receive it multiple times.
|
Tags | externals |