I need advice how to proceed.
How to slightly dim the main view and display some busy indicator, for the duration of of some action, and then remove the dimming?
In Swift language.
Thanks!
UPD: In Objective-C I use earlier something like this:
UIView *dimView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
dimView.backgroundColor = [UIColor blackColor];
dimView.alpha = 0.5f;
dimView.tag = 1111;
dimView.userInteractionEnabled = NO;
[self.view addSubview:dimView];
How this code we can do it in Swift?
Do as follows, I have checked, Working Fine In Swift - iOS 8
We have have to initialize the view with the frame and then we have to set the
.alpha
property for dim the view.And
.addSubview
will add the view inside the main view.Happy Coding :)