You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to custom background touch event for SBULoading
Guide & Snippet
By default, background touch events for SBULoading are blocked.
This section describes how to customize touch events
1. Implement SBULoadingDataSource
First, implement the shouldPassTouchHit(_:with) of SBULoadingDataSource like the example below
The boolean in the return value indicates whether it passed.
If false, the touch is ignored; if true, the touch event is passed to the next view's event chaining.
extensionGroupChannelViewController:SBULoadingDataSource{func shouldPassTouchHit(_ point:CGPoint, with event:UIEvent?)->Bool{
if self.navigationController?.navigationBar.frame.contains(point)== true {return true
}return false
}}
2. Set & Remove SBULoadingDataSource
Touch event customization is designed to set the dataSource for each ViewController.
So when the ViewController is appeared or disappeared, call the dataSource setting method.
See the code below.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
SBULoading
Guide & Snippet
By default, background touch events for
SBULoading
are blocked.This section describes how to customize touch events
1. Implement
SBULoadingDataSource
First, implement the
shouldPassTouchHit(_:with)
ofSBULoadingDataSource
like the example belowThe boolean in the return value indicates whether it passed.
If false, the touch is ignored; if true, the touch event is passed to the next view's event chaining.
2. Set & Remove
SBULoadingDataSource
Touch event customization is designed to set the
dataSource
for each ViewController.So when the
ViewController
is appeared or disappeared, call thedataSource
setting method.See the code below.
3. Setup
SBUViewControllerSet
Finally, set the customized
ViewController
forSBULoading
in the SBUControllerSetReference
Beta Was this translation helpful? Give feedback.
All reactions