Issue “This certificate has an invalid issuer” because of Apple Worldwide Developer Relations Intermediate Certificate Expiration

I am posting this article because many users are facing this issue like “This certificate has an invalid issuer”

This certificate has an invalid issuer
This certificate has an invalid issuer

As apple have written :

The Apple Worldwide Developer Relations Certification Intermediate Certificate expires soon and we’ve issued a renewed certificate that must be included when signing all new Apple Wallet Passes, push packages for Safari Push Notifications, and Safari Extensions starting February 14, 2016.

As I found an answer in post on the Stack Overflow : This certificate has an invalid issuer regrading Intermediate Certificate Expiration

Follow this steps :

  1. Open KeyChain access, Delete “Apple world wide Developer relations certification authority” (Which expires on 14th Feb 2016) from both “Login” and “System” sections. If you can’t find it, use “Show Expired Certificates” in the View menu
  2. Download AppleWWDRCA.cer and add it to Keychain access > certificates (which expires on 8th Feb 2023)
  3. Everything should be back to normal and working now (Check the certificate is valid and it should be display in green)

Related Articles:

How to use Alamofire and SwiftyJSON with Swift? – Swift 3 – iOS 10 – Xcode 8

Swift JSON
Swift JSON

Alamofire is an HTTP networking library written in Swift.
SwiftyJSON makes it easy to deal with JSON data in Swift.
Continue reading

Realm – mobile database with Swift

What is Realm?

Realm is a mobile database

Realm is a replacement for SQLite & Core Data.
It can save you thousands of lines of code & weeks of work,
and lets you craft amazing new user experiences.

Download the Realm framework for swift from https://realm.io/

import UIKit
import RealmSwift

class Person: Object {
    dynamic var name = ""
    dynamic var age = 0
}

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Initializing the object
        
        let personObj1 = Person()
        personObj1.name = "Ashish"
        personObj1.age = 25
        println("name of person : \(personObj1.name)")
        
        // Writing it to realm
        
        let realm = Realm()
        
        realm.write {
            realm.add(personObj1)
        }
        
        let personObj2 = Person()
        personObj2.name = "Darshak"
        personObj2.age = 27
        
        realm.write {
            realm.add(personObj2)
        }
        
        // Quering
        
        let r = Realm().objects(Person).filter("age > 24")
        
        println(r)
        
        // Queries are chainable
        
        let r2 = r.filter("name contains 'Ashish'")

        println(r2)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}

Output :

name of person : Ashish
Results<Person> (
	[0] Person {
		name = Ashish;
		age = 25;
	},
	[1] Person {
		name = Darshak;
		age = 27;
	}
)
Results<Person> (
	[0] Person {
		name = Ashish;
		age = 25;
	}
)

Happy Coding 🙂

Passing data with Unwind Segue in Swift Language – iOS 8

Unwind Segue Data
Unwind Segue Data

We have learn about Work with Unwind Segue in Swift Language – iOS 8 in first tutorial. Now we will learn how to pass the data with unwind segue.

It just simple.

Continue with the same example project.

Take data variables which you want to get in the parent view.

For example,

class ViewController2: UIViewController {
    var data:String = "view 2 data"
    ....
}

To get data from first view controller we have to get data from source view controller like follows :

    @IBAction func unwindToVC(segue:UIStoryboardSegue) {
        if(segue.sourceViewController .isKindOfClass(ViewController2))
        {
            var view2:ViewController2 = segue.sourceViewController as ViewController2
            let alert = UIAlertView()
            alert.title = "UnwindSegue Data"
            alert.message = view2.data
            alert.addButtonWithTitle("Ok")
            alert.show()
        }
        if(segue.sourceViewController .isKindOfClass(ViewController3))
        {
            var view3:ViewController3 = segue.sourceViewController as ViewController3
            let alert = UIAlertView()
            alert.title = "UnwindSegue Data"
            alert.message = view3.data
            alert.addButtonWithTitle("Ok")
            alert.show()
        }
    }

Download project with this stuff UnwindSegueData.zip

Thanks!

Happy Coding 😀

Work with Unwind Segue in Swift Language – iOS 8

Unwind - Exit
Unwind – Exit

An unwind segue (sometimes called exit segue) can be used to navigate back through push, modal or popover segues (as if you popped the navigation item from the navigation bar, closed the popover or dismissed the modally presented view controller). On top of that you can actually unwind through not only one but a series of push/modal/popover segues, e.g. “go back” multiple steps in your navigation hierarchy with a single unwind action.

To enable the Unwind Segue you need to add some code first.

@IBAction func unwindToVC(segue: UIStoryboardSegue) {
}

You have to add this code in the view controller where you want to unwind (came back).

Unwind To View
Unwind To View

Suppose you want to came back from second or third view to first view then you have to add the code in first view.

Then just connect any control(Which contains action) with the unwind segue.

Unwind Segue
Unwind Segue

For check the particular view controller by unwind segue, use following code :

    @IBAction func unwindToVC(segue:UIStoryboardSegue) {
        if(segue.sourceViewController .isKindOfClass(ViewController2))
        {
            let alert = UIAlertView()
            alert.title = "UnwindSegue"
            alert.message = "Unwind from view 2"
            alert.addButtonWithTitle("Ok")
            alert.show()
        }
        if(segue.sourceViewController .isKindOfClass(ViewController3))
        {
            let alert = UIAlertView()
            alert.title = "UnwindSegue"
            alert.message = "Unwind from view 3"
            alert.addButtonWithTitle("Ok")
            alert.show()
        }
    }

Download project with this stuff UnwindSegue.zip

In next tutorial you will find the topic Passing data with Unwind Segue in Swift Language – iOS 8

Thanks!

Happy Coding 😀