open app mail

let mailURL = NSURL(string: "message://")!
if UIApplication.sharedApplication().canOpenURL(mailURL) {
UIApplication.sharedApplication().openURL(mailURL)
}

Certificate has either expired or has been revoked

down vote
Solution

First of all clean the project by holding Shift(⇧)+Command(⌘)+K or Select Product > Clean

Then

NSNotificationCenter.defaultCenter()

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.setup1), name: "setup", object: nil)
func setup1() {
print("this is setup 1")
}

NSNotificationCenter.defaultCenter().postNotificationName("setup", object: nil)

layout code need

self.view.layoutIfNeeded()

keyboard with tableView

self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissMode.OnDrag
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(SearchVC.keyboardWillShow(_:)), name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(SearchVC.keyboardWillHide(_:)), name: UIKeyboardWillHideNotification, object: nil)
automaticallyAdjustsScrollViewInsets = false
func keyboardWillShow(notification: NSNotification) {
if !keyboardUp {

BoldFount

var boldHelveticaFont = UIFont(name: "Helvetica Neue", size: 40)?.fontDescriptor().fontDescriptorWithSymbolicTraits(UIFontDescriptorSymbolicTraits.TraitBold)
self.InstructionsTextView.font = UIFont(descriptor: boldHelveticaFont!, size: 40)

app circle

To Store array to NSUserDefault.

Here are the way that you can store and retrieved array of object with help of NSKeyArchive.

To Store array to NSUserDefault.
let placesData = NSKeyedArchiver.archivedDataWithRootObject(placesArray)
NSUserDefaults.standardUserDefaults().setObject(placesData, forKey: "places")

To Retrieved array from NSUserDefault.

let placesData = NSUserDefaults.standardUserDefaults().objectForKey("places") as? NSData

with Class to NSKeyedArchiver.archivedDataWithRootObject

import Foundation
import UIKit

class ListaddOrder : NSObject, NSCoding {
var _id: String = ""
var id: String {
return _id
}

var _count: Int = 0
var count:Int {
return _count
}

var _image: String = ""
var image: String{

return _image
}

var _price: Int = 0
var price: Int {
return _price
}

var _name: String = ""
var name:String {
return _name
}

show keyboard and push view about.

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PetEditViewController.keyboardWillShow(_:)), name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PetEditViewController.keyboardWillHide(_:)), name: UIKeyboardWillHideNotification, object: nil)

automaticallyAdjustsScrollViewInsets = false

Pages

Subscribe to Trần Mạnh Hoàng RSS