swift2 - Ideal way to notify ios application about an event from an SDK -
we building sdk providing particular service, , integrated ios applications. question generic , wanted suggestions how go forward it. sdk listens different os notifications , events, , events require user react it. e.g., sdk performing operation in background, in between requires user launch client , enter missing information. how pass information sdk ios application, app developers react , show information in customised way end-user, ( when in background local notification , when in foreground customised alert ) ui notif's should not triggered sdk , requirement. creating delegates suffice or other cleaner way go forward it.
i suggest use delegate instead of nsnotification :
you want 1 response call, if need nsnotification, nothing prevent client app answer several times.
if user need notification, can implement himself inside delegates methods.
delegates provide instant response, nsnotification asynchronous. if need information client, should ask sync response.
cheers