We have to write a single line to compress the image at a time when we are uploading our image to a server. NSData *dataForPNGFile = UIImageJPEGRepresentation(imgPicked, 0.0f); 0.0f is the maximum & 1.0f is the minimum compress ratio we can change based on our …
iPhone
Use UIView as UIButton…..
Give UIControl class to UIView then we can access that as UIButton.Add event like Touch Up Inside, touchDown… etc.
CLLocationManager not getting City name
Issue Description : I have not getting city name when select some of location. To overcome this issue use below snippet code. – (void) getReverseGeocode { CLGeocoder *geocoder = [[CLGeocoder alloc] init]; if(currentLatLong.count > 0) { CLLocationCoordinate2D myCoOrdinate; myCoOrdinate.latitude = LatValue; myCoOrdinate.longitude = LangValue; CLLocation …
Continue run application in background mode without suspended by OS.
We can solve this by using background task and runloop mechanism. Below piece of code can save your day for problem like run app in background continue. Initialise var UIBackgroundTaskIdentifier var bgTask:UIBackgroundTaskIdentifier! bgTask = application.beginBackgroundTaskWithName(“MyTask”, expirationHandler: {() -> Void …
Download & Store files in documents directory iOS phone-gap application
Hello, Here is the code for download and store files in document directory ios phone-gap app. var fileTransfer = new FileTransfer(); fileTransfer.download( uri, filePath, function(entry) { alert(“download complete: ” + entry.toURL()); } }, function(error) { alert(“download error source ” + error.source); alert(“download error target ” …
DFP Banner & Interstitial Ads in iOS
//DFPBannerView //ViewController.h 1. @import GoogleMobileAds 2. @property (nonatomic, weak) IBOutlet DFPBannerView *bannerView; 3. Design UIView which custom class is DFPBannerView //ViewController.m – (void)viewDidLoad { [super viewDidLoad]; NSLog(@”Google Mobile Ads SDK version: %@”, [DFPRequest sdkVersion]); self.bannerView.adUnitID = @”/6499/example/banner”; //To get your own adUnitID refer reference links …
Auto verification OTP
It is not possible to access your mobile SMS in iOS for some security reasons but if you want that feature you can implement below things: -You can get your verification code according to mobile number from server side. -generate URL scheme of your app …
RealtimeChat with Firebase
KEY FEATURES Firebase backend (full realtime actions) Realm local database (full offline availability) AES-256 encryption FEATURES Live chat between multiple devices Group chat functionality Private chat functionality Single or Multiple recipients Push notification support No backend programming is needed Native and easy to customize user …
Play All Video without freeze and gap between two videos
1. Implement SHBQueuePlayer third party class you can download from github: https://github.com/jiutianhuanpei/SHBQueuePlayer 2. Implement AVPlayerViewController class 3. The below function is used for set urls for play video. – (void)setUrls:(NSMutableArray *)urls index:(NSInteger)index { [_playedUrls removeAllObjects]; [_nextUrls removeAllObjects]; if (urls.count == 0 || urls == nil) …
How to check internet is access or not when device connected with WIFI?
You can check internet is accessible or not when your device connected with WIFI with following code. You need to import Reachability.h & Reachability .m in Appdelegate class and do following code in didFinishLaunchingWithOptions: function. self.reachability = [Reachability reachabilityWithHostName:@”www.google.com”]; //self.reachability = [Reachability reachabilityForInternetConnection]; // Start Monitoring …