Browsed by
Category: Swift

IOS best network image download library – SDWebImage , Swift 3/4

IOS best network image download library – SDWebImage , Swift 3/4

Sometimes network image doest not download and for that app may crash . To avoid this you can use SDWebImage library as like Picasso android library which will show a default placeholder image until file downloaded . To implement SDWebImage – Step 1 : paste the pod file in podfile of your project (If you don’t create pod file . create it with ‘pod init’ command in your project directory) pod ‘SDWebImage’, ‘~> 4.0’ Run command pod install Step 2…

Read More Read More

Swift 3 / 4 get current location with location manager .

Swift 3 / 4 get current location with location manager .

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)…

Read More Read More

Swift 3 /4 take photo from camera or gallery and show it .

Swift 3 /4 take photo from camera or gallery and show it .

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…

Read More Read More

Swift Tutorial Series In Bangla : Collection Type – Array

Swift Tutorial Series In Bangla : Collection Type – Array

Source Code import UIKit var integerTypeArray = [Int]() integerTypeArray.append(3) integerTypeArray.append(5) var stringTypeArray = [String]() stringTypeArray.append(“ios”) var threeWillbeTenTimesArray = Array(repeatElement(“Three”, count: 10)) var fiveWillbeTenTimesArray = Array(repeatElement(“Five”, count: 10)) var addThreeAndFiveArray = threeWillbeTenTimesArray + fiveWillbeTenTimesArray var literalTypeArray : [String] = [“swift”,”version”,”three”] literalTypeArray[0] for eachElementValue in literalTypeArray { print(eachElementValue) } var countofArray = literalTypeArray.count var retriveLastElement = literalTypeArray[literalTypeArray.count-1]     Download From Github