how to change MBProgressHUD activity indicator style? - ios

I have integrated MBProgressHUD. It was previously showing small indicator but in swift 4 update or pod update, it is now changed large indicator. They might have changed UIActivityIndicatorViewStyleWhiteLarge in new pods. So my question is that how can I initialise using UIActivityIndicatorViewStyleWhite. I can't see any method to change indicator style. You can check both screenshot after and before.
Any idea how to change?

Write an extension for MBProgessHUD. Then customise the properties that are needed.

The MBProgressHUD is in cocoapods. so you have to fork their code from github and make the changes that you want.
You can then use the forked code in your project. MBProgressHUD’s MIT license allows you to do so.

In order to get the smaller indicator use:
UIActivityIndicatorViewStyleWhite
That's it!

Related

Nativescript Mediafilepicker customizing DKImagePickerController UI

I'm currently using Nativescript-Mediafilepicker plugin to handle image selection and also capturing image from camera in iOS. In ns mediafilepicker docs , i can see that it is using DKImagePickerController native libraries to handle the image selection and In the DKImagePickerController docs, i can see there is an option to customize the UI (CustomUIDelegate).
Is there any possible way to do the same with Nativescript? I wish to customize the camera icon in the image picker gallery. In the DKImagePickerController CustomUIDelegate doc, i can see it is using DKAssetGroupDetailBaseCell to achieve the customization. How can i do this in Nativescript Angular?
Short answer: you cannot do it easily.
Long Answer
You need to override methods since the plugin you are referring to does not expose APIs to modify the icon.
I have tried modifying it myself and I found out modifying the original plugin source code. I can give you hints on what you would have to do based on the understanding I have put in during the last few hours.
Create your custom MediaPicker
class MyMediaPicker extends Mediafilepicker {
...
}
Extend and copy the original openImagePicker method.
As you can see in the original source code, you have access to the picker, but you need to create a custom iOS delegate that handles the task of getting the UIImage for the camera.... This last task is painful, since the DK plugin guy created a custom class to refer to the Camera Cell that you now have to modify as well.
Once you modify (1) the picker plugin method, (2) the internal DK picker delegate, and (3) created a custom CameraCell. You should be able to modify that camera icon.
Here are some useful links:
https://github.com/jibon57/nativescript-mediafilepicker
https://github.com/zhangao0086/DKImagePickerController/blob/e61f49bda664e41dafd3c06174ae0cd1eccda236/Sources/DKImagePickerController/DKImagePickerController.swift
https://github.com/zhangao0086/DKImagePickerController/blob/e61f49bda664e41dafd3c06174ae0cd1eccda236/Sources/DKImagePickerController/Resource/DKImagePickerControllerResource.swift

Change MDCActivityIndicator track color in iOS

I'm using MDCActivityIndicator for iOS.
I can see the track behind the indicator with trackEnabled = true
But I don't know how to change the track color.
Do you know how to do?
I solved my problem.
I used MDCActivityIndicator as a cocoapods.
I pull out from cocoapods and add a source and fix it directly.
MCDActivityIndocator

What type of UI component is this?

I see this type of action sheet on iOS devices using the Google Drive application.
I want to know if it is already supported on iOS SDK or if it is a custom UI?
If it is already a standard component, what's name of it?
It was called UIActionSheet before iOS8 and after you can find this UI component under the UIAlerController. You can use this component to make some UI like this but development target should be more that iOS8.
You can check here for documentation.
I'm not aware of any custom components, but it looks to me like a standard UIAlertController with a ActionSheet style. As the alert controller extends UIViewController, you may add subviews to it.
The screenshots indicate that they added a UITableView as a subview to the alert controller:
Ok, got it. It's only for iOS 8 and later. It's named UIDocumentPickerExtensionViewController.

iOS error message tooltip

I need to show error message as a tooltip in iOS 8 but i don't know how to do it. What I want is something similar to the one shown in below image (I'm referring to the tooltip with messages Select and Select All):
There is a great collection of libraries which already target your problem.
For example have a look at: AMPopTip.
Then you could show the popover like:
self.popTip = [AMPopTip popTip];
[self.popTip showText:errorMessage direction:AMPopTipDirectionUp maxWidth:200 inView:self.view fromFrame:textField.frame];
and hide it:
[self.popTip hide];
Have a look at the github repo there are more examples for customizing this control.
You can find more which might suit your needs better here: cocoacontrols.com
I had a similar problem and wrote my own custom tooltip.
You can init with your custom view (i assume you write some delegations to detect actions within.) and present from anywhere.
Maybe not the best replacement of UIPopoverController but still works great. And a lifesaver for iPhone. Also highly customisable.
https://github.com/akeara/AKETooltip
Hope this helps.

Black temporary alert box in iOS

I need a black temporary transparent box that must show something like "Loading...." with a spinner it. We can see such a view in twitter when "Tweeting" an update - it says "Sending tweet..." kinda thing.
Is this an inbuilt behavior in UIKit. How do I get this box to show up on screen for a few seconds and disappear.
please help.
You need to use DSActivityView. All this is handled there. Instead of doing your own thing I suggest you use this.
For what you need this is how you need to go -
#import "DSActivityView.h"
[DSActivityView activityViewForView:self.view withLabel:#"Tweeting"]; //to show spinner with label
[DSActivityView removeView]; //once its done
You can also try using MBProgressHud

Resources