Showing posts with label iOS. Show all posts
Showing posts with label iOS. Show all posts

Thursday, 18 May 2017

Visual Studio Mobile Center - Android, iOS, Windows & React Native

Visual Studio Mobile Center, a set of cloud services for building and managing your mobile apps. Mobile Center is designed for all apps targeting iOS, Android, Windows including apps written in Swift, Objective-C, Java, Xamarin, and React Native.


Delivering excellent mobile experiences requires going beyond frameworks and IDEs—developers also need services to continuously build, test, distribute, and monitor their apps so that they can quickly iterate and improve. Many teams cobble together a workflow using some of these services from different tools and products. But this is time-consuming and distracts you from your actual mission of delivering a great app.

This is why we built Mobile Center: a mission control for mobile apps that brings together all the cloud and life cycle services that help developers deliver high quality apps faster. You can build, test, distribute, and monitor your apps and easily add backend cloud services to scale your app to millions of users on demand.

There are many great features included in the Preview, with even more to come. Here’s what you can do today:

  1. Build your apps automatically with every pull request via connecting it to the Repositories like Github, Bitbucket etc.
  2. Test apps on thousands of real-world devices
  3. Distribute passing builds to beta testers or user groups or organisation
  4. Monitor apps for crashes and bugs 
  5. Learn about real world usage with mobile analytics
  6. Connect to a mobile backend for automatic scaling and to add important cloud services like offline data sync, tabular data storage, and end-user authentication services

Mobile Center is the next generation of our existing mobile developers services, including HockeyApp and Xamarin Test Cloud. Later next year, Mobile Center will show all of your new and existing HockeyApp and Test Cloud apps to ensure a seamless transition for those customers.

It’s easy to get started. Request an invitation and once approved, sign in with your existing HockeyApp credentials, GitHub account, or Microsoft Account. Then, connect your apps and kick off some builds. The preview is free, with some metering to ensure everyone has a chance to use the services and provide feedback.

Courtesy: #MobileCenter #Reference

Sunday, 4 December 2016

Navigation Controller using Storyboard - iOS Swift

This code will be really useful to you to change the view controller using Storyboard ID.

For example -
There were 2 view Controllers named FirstViewController and SecondViewController respectively.
If you want to move from FirstViewController to SecondViewController there is a simple Code using Storyboard  ID.

Step 1 :-

Enter the StoryBoard ID for both the ViewControllers
 

Step 2 :-

Write a code in FirstViewController.
//to navigate to the next view controller with the help of storyboard
let secondVC =  self.storyboard?.instantiateViewControllerWithIdentifier("SecondViewController") as! SecondViewController
self.navigationController?.pushViewController(secondVC, animated: true)

Thursday, 18 August 2016

Auto-Zooming the Image and Fit to the screen in UICollectionView - iOS Swift

Click the Image once to Zoom the Image and Fit it to the Screen in UICollectionView . Its the Simple procedure that we have to alter the size of the UIImage when it is Tapped.

You Just need to copy the code and paste it in your program.

//1
var largePhotoIndexPath : NSIndexPath? {
didSet {
  //2
  var indexPaths = [NSIndexPath]()
  if largePhotoIndexPath != nil {
    indexPaths.append(largePhotoIndexPath!)
  }
  if oldValue != nil {
    indexPaths.append(oldValue!)
  }
  //3
      collectionView?.performBatchUpdates({
        self.collectionView?.reloadItemsAtIndexPaths(indexPaths)
        return
        }){
          completed in
          //4
          if self.largePhotoIndexPath != nil {
            self.collectionView?.scrollToItemAtIndexPath(
              self.largePhotoIndexPath!,
              atScrollPosition: .CenteredVertically,
              animated: true)
          }
      }
  }
}

func collectionView(collectionView: UICollectionView,
  layout collectionViewLayout: UICollectionViewLayout,
  sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
 
  let Photo = photoForIndexPath(indexPath)
 
  // New code
  if indexPath == largePhotoIndexPath {
    var size = collectionView.bounds.size
    size.height -= topLayoutGuide.length
    size.height -= (sectionInsets.top + sectionInsets.right)
    size.width -= (sectionInsets.left + sectionInsets.right)
    return Photo.sizeToFillWidthOfSize(size)
  }
  // Previous code
  if var size = Photo.thumbnail?.size {
    size.width += 10
    size.height += 10
    return size
  }
  return CGSize(width: 100, height: 100)
}

extension ViewController : UICollectionViewDelegate {
 
  override func collectionView(collectionView: UICollectionView,
    shouldSelectItemAtIndexPath indexPath: NSIndexPath) -> Bool {
      if largePhotoIndexPath == indexPath {
        largePhotoIndexPath = nil
      }
      else {
        largePhotoIndexPath = indexPath
      }
      return false
  }
}

override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
 
  let cell = collectionView.dequeueReusableCellWithReuseIdentifier(
    reuseIdentifier, forIndexPath: indexPath) as! yourCellName
  let Photo = photoForIndexPath(indexPath)
 
  //1
  cell.activityIndicator.stopAnimating()
 
  //2
  if indexPath != largePhotoIndexPath {
    cell.imageView.image = Photo.thumbnail
    return cell
  }
 
  //3
  if Photo.largeImage != nil {
    cell.imageView.image = Photo.largeImage
    return cell
  }
 
  //4
  cell.imageView.image = Photo.thumbnail
  cell.activityIndicator.startAnimating()
 
  //5
  Photo.loadLargeImage {
    loadedPhoto, error in
 
    //6
    cell.activityIndicator.stopAnimating()
 
    //7
    if error != nil {
      return
    }
 
    if loadedPhoto.largeImage == nil {
      return
    }
 
    //8
    if indexPath == self.largePhotoIndexPath {
      if let cell = collectionView.cellForItemAtIndexPath(indexPath) as? yourCellName {
        cell.imageView.image = loadedPhoto.largeImage
      }
    }
  }
 
  return cell
}

Here the Name "Photo" stands for the name of the UIImage and "yourCellName" stands for the name of the UICollectionViewCell.

Outputs:

                 Before Click                                                       After Click

     

Wednesday, 3 August 2016

MKMapView for required location using Latitude and Longitude - iOS Swift

This Code will be really useful to find the location of the required place. We need to give latitude and longitude as Input .

For example :
     
      Here I want to Find the location of S2 Theatre, Thiruvanmiyur, Chennai . So, First I want to collect the latitude and longitude of the location.
                                   Latitude    =  12.9895  Longitude = 80.2565
Step 1 :
               Insert a Mapview in Main storyboard and also Create an IBOutlet for MKMapView in View Controller.
Step 2 :
               Copy this code into the viewDidLoad. Inside the variable location you have to include the latitude and longitude. Inside the variable span you have to include the zooming size that which required. Annotation is nothing but the marker present in the location.

        let location = CLLocationCoordinate2DMake(12.9895, 80.2565) 
        let span = MKCoordinateSpanMake(0.0002, 0.0002)
    
        let region = MKCoordinateRegion(center: location,span: span)
    
        mapView.setRegion(region, animated: true)
        
        let annotation = MKPointAnnotation()
        annotation.coordinate = location
        annotation.title = "S2 Theatre"
        
        mapView.addAnnotation(annotation)


Output :
                                        

Tuesday, 2 August 2016

Add button to the UIToolbar - iOS Swift

This code will really helpful to add button to the UIToolbar present in keyboard or pickerview.

For example:
If you want "Done" button to be inserted in the toolbar of the pickerview. you just have to follow simple steps as follows.

Step 1:
Have to include this code inside "viewDidLoad" to create "Done" button in UIToolbar. "textBoxText" is the name of the Text field.

      
        // create done button in toolbar.
        doneToolbar = UIToolbar(frame: CGRectMake(0, 0, self.view.frame.size.width, 50))
        doneToolbar.barStyle = UIBarStyle.Default
        doneToolbar.items =   [UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Plain, target: self, action: #selector(FirstViewController.PickerDoneButtonTapped))]
        doneToolbar.sizeToFit()
        textBoxText.inputAccessoryView = doneToolbar



Step 2:
Code the function of "Done" button that has included in the UIToolbar. I have given that if  "Done" button is tapped the PickerView have to disable.

    func PickerDoneButtonTapped()
    {
        textBoxText.resignFirstResponder()
    }

Step 3:
Have to call the function in "viewDidload"

self.PickerDoneButtonTapped()

Output:

                                                                                 
      

Tuesday, 24 May 2016

Best Programming Languages You Should Learn To Boost Your Salary


Source: http://fossbytes.com/python-go-scala-learn-best-programming-languages-salary-boost/

The 2016 Workforce-Skill Preparedness Report of Pay-scale, a salary tracking site, is out with many interesting trends related to the current tech job scenario. The report outlines that Go, Scala, and Python, along with big data tech provide the highest boost in your paycheck. if you are willing to grab a big bite of salary boost by learning some new technology or programming language, we are here to help you.It’s a no hidden fact that the knowledge of big data skills is the most in-demand in the tech world.

Today, the job market is witnessing a paradigm shift and big data skills like Hadoop and Apache Spark, along with Python, Go, and Scala, are gaining high in highest paid lists.  Using its pay-tracking database, the same trend in IT and other industries has been observed by Pay-scale.

These results have been published recently in its 2016 Workforce-Skills Preparedness Report. Among the highest valued skills that provide the biggest pay boost, all are tech related. Out of such top nine skills, seven are directly related to the deep knowledge of programming languages, frameworks, and operating systems.

The biggest jump is provided by the functional programming language Scala with an average pay jump of 22.2 percent.  Google’s Go programming language followed Scala at the second place with a 20 percent pay boost.  While Python didn’t crack the top positions in this list, it had a prominent presence in Pay Scale's survey. Depending on the job titles, Python was found to provide a pay boost of up to 8-14 percent.

Here’s the list of top 9 technologies that provide the highest salary jump: