IOS take Screenshot of full page and share in swift 4
1. Crate a swift file and paste these two as extension 2 . How to use : We can use as UIApplication.shared.screenShot . If we want to set screenshot at a imageview then – 3 .Share screenshot
1. Crate a swift file and paste these two as extension 2 . How to use : We can use as UIApplication.shared.screenShot . If we want to set screenshot at a imageview then – 3 .Share screenshot
1 .Fist Create a ViewController and extends UISearchbarDelegate 2 . Register search bar as like in ViewDidLoad 3. Now call keyboard search action func 4 . Cancel button function Complete Code
Step : 1 Create a swift class that can be used as reusable Step 2 : Now call the class and method from Controller Class . – show the progress dialog – hide the progress dialog
1 . From millisecond to date time format and show on a label 2 . From unix to date time format and show on a label
1. Go to info.plist in xcode root folder . 2. Add App Transport Security Settings 3. Allow Arbitrary Load is true .
We can manage it by changing one method of GMUDefaultClusterIconGenerator class. In GMUDefaultClusterIconGenerator.m replace below method, with What i have done is, I have just change else portion and set text as exact number instead of string with +!
Download Full Project
The following resolutions are acceptable to iTunes connect: iPhone 3+4 (3.5 Inch) 640 x 960 iPhone 5 (4 Inch) 640 x 1136 iPhone 6 (4.7 Inch) 750 x 1334 iPhone 6 Plus (5.5 Inch) 1242 x 2208 You need the screenshot in this resolution, the phone scales them down to 1080 x 1920 iPhone X 1125 x 2436 iPad (Air and Mini Retina) 1536 x 2048 iPad Pro (12.9 Inch) 2048 x 2732 Apple Watch 312 x 390 pixels (only…
It may be causes for 2 reasons – If image is transparent or if alpha channel . Solution for transparent : Simply remove transparent or convert .png image to .jpg/.jpeg format . Solution for alpha channel : Copy and Paste the App Store icon to the desktop. Open the image. Click File Menu->Duplicate. Save it by unticking the Alpha channel. Replace the current App Store icon with this one. Validate and upload. Source : https://stackoverflow.com/questions/46585809/error-itms-90717-invalid-app-store-icon
let url : NSString = “url string here” let urlStr : NSString = url.addingPercentEscapes(using: String.Encoding.utf8.rawValue)! as NSString let actualURL : NSURL = NSURL(string: urlStr as String)! print(actualURL)
Git keeps all of its files in the .git directory. Just remove that one and init again. If you can’t find it, it’s because it is hidden. In Windows 7, you need to go to your folder, click on Organize on the top left, then click on Folder and search options, then click on the View tab and click on the Show hidden files, folders and drives radio button. On a Mac OS: Open a Terminal (via Spotlight: press CMD + SPACE, type terminal and press Enter) and do this command: defaults write com.apple.finder…
let alert = UIAlertController(title: “”, message: “alert disappears after 30 seconds”, preferredStyle: .alert) self.present(alert, animated: true, completion: nil) // change to desired number of seconds (in this case3 0 seconds) let when = DispatchTime.now() + 30 DispatchQueue.main.asyncAfter(deadline: when){ // your code with delay …
exit(0);
Problem : unable to boot device due to insufficient system resources. xcode Please see Simulator Help for information on adjusting system settings to allow more simulated devices to boot at once. maxUserProcs: 709, runningUserProcs: 614, enforcedProcBuffer: 144 Solution : Open Terminal and run the command sudo launchctl limit maxproc 2000 2500 Explanation : xCode restricts to run more device but it has 2000 max device run capability. sudo launchctl limit maxproc [limit for one user] [total limit]
Solution : use DispatchQueue.main.async { // Correct } Updating UI from a Completion Handler Long-running tasks such as networking are often executed in the background, and provide a completion handler to signal completion. Attempting to read or update the UI from a completion handler may cause problems. let task = URLSession.shared.dataTask(with: url) { (data, response, error) in if let data = data { self.label.text = “\(data.count) bytes downloaded” // Error: label updated on background thread } } task.resume()…
Open Terminal and go to project folder like cd: Desktop/newProject run the command on terminal cordova platform add ios and run the command cordova build It will create a platform folder in the project directory and inside project directory you will find iOS . import iOS on xCode and build as same as other xCode project .
Open Terminal and run this command that will add the source on master branch on cocoapod repos . $ cd ~/.cocoapods/repos $ git clone https://github.com/CocoaPods/Specs.git master if again issuing already has master branch and it’s not empty and completely remove cocoapod and install from new . How to uninstall cocoapod completely and install new
1. Uninstall CocoaPods (choose to uninstall all versions): 1 sudo gem uninstall cocoapods 2. Remove old master repo: 1 sudo rm -fr ~/.cocoapods/repos/master 3. Install CocoaPods with sudo: 1 sudo gem install cocoapods 4. Setup CocoaPods and Master repo: 1 pod setup Source i collected
Step – 1 : First define LocationManager . And Current location of CLLocaion . var manager = CLLocationManager() var currentLocation: CLLocation! Step 2 : In ViewDidController get Current location with location manager . That’s it . manager.requestWhenInUseAuthorization() if (CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedWhenInUse || CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedAlways){ currentLocation = manager.location print(“location is “, currentLocation.coordinate.latitude)…
Step One : First create a project and take imageView and a button to capture image . Connect it to ViewController . Step Two : Copy this code and run . hope it will be done . 😀 class ImageCapture: UIViewController , UIImagePickerControllerDelegate,UIPopoverControllerDelegate,UINavigationControllerDelegate{ @IBOutlet var imageViewWeight: UIImageView! var imagePicker:UIImagePickerController?=UIImagePickerController() override func viewDidLoad() { super.viewDidLoad() imagePicker?.delegate=self } @IBAction func takeImage(_ sender: Any) { var alert…
import UIKit class ViewController: UIViewController , UITableViewDelegate , UITableViewDataSource{ var names = [“arif”,”hasnat”,”ios”,”developer”] @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return names.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = UITableViewCell() cell.textLabel?.text = names[indexPath.row] return cell } }
Collection view is very good component of IOS . Its similar with table but have some basic difference . Here I will discuss with ios Collection view with easy way 🙂 So let start , Part 1 : Create a project Named Like CollectionViewDemo . Go to Main.Storyboard and add a Navigation controller – for that go to Editor menu of toolbar and select EmbededIn and click Navigation Controller . It will add a Navigation bar of the top of…