Skip to content

Instantly share code, notes, and snippets.

View leoiphonedev's full-sized avatar

Aman Aggarwal leoiphonedev

View GitHub Profile
//
// ViewController.swift
// SendMailAttachment
//
// Created by Aman Aggarwal on 03/12/18.
// Copyright © 2018 Aman Aggarwal. All rights reserved.
//
import UIKit
import MessageUI
@leoiphonedev
leoiphonedev / SendMailAttachment-ViewController-3.swift
Created December 12, 2018 06:01
COnformimng to MFMailComposeViewControllerDelegate so that we get notified on user certain action with mail composer view
import UIKit
import MessageUI
class ViewController: UIViewController, MFMailComposeViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
@leoiphonedev
leoiphonedev / SendMailAttachment-ViewController-2.swift
Created December 12, 2018 05:07
Code for presenting mail composer (desfualt) when user tap on send mail button
@IBAction func sendEmail(_ sender: Any) {
if MFMailComposeViewController.canSendMail() {
let mailComposer = MFMailComposeViewController()
mailComposer.setSubject("Update about ios tutorials")
mailComposer.setMessageBody("What is the update about ios tutorials on youtube", isHTML: false)
mailComposer.setToRecipients(["abc@test.com"])
self.present(mailComposer, animated: true
, completion: nil)
} else {
@leoiphonedev
leoiphonedev / SendMailAttachment-ViewController-1.swift
Created December 12, 2018 05:04
Importing MessageUI framework
import MessageUI
@leoiphonedev
leoiphonedev / SendMailAttachment-ViewController.swift
Created December 12, 2018 05:01
Creating IBAction for the UIButton in order to send mail when user touch UIButton
@IBAction func sendEmail(_ sender: Any) {
}
@leoiphonedev
leoiphonedev / Adding checkbox on UITableViewCell in swift 4.swift
Created February 6, 2018 05:58
Showing how to add UIButton as custom checkbox in UITableViewCell in swift 4
//
// ViewController.swift
// addCheckBoxonTable-Tutorial
//
// Created by Aman Aggarwal on 2/1/18.
// Copyright © 2018 iostutorialjunction.com. All rights reserved.
//
import UIKit
@leoiphonedev
leoiphonedev / ViewController-CATransition.swift
Created September 15, 2018 15:29
Compete code for demonstarting how to use fade animation on UILabel using CATransition Animation in swift4
//
// ViewController.swift
// CATransition-Example
//
// Created by Aman Aggarwal on 29/08/18.
// Copyright © 2018 iostutorialjunction.com. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@leoiphonedev
leoiphonedev / ViewController-CATransition.swift
Created September 15, 2018 15:11
Adding animation code as an extension
//
// ViewController.swift
// CATransition-Example
//
// Created by Aman Aggarwal on 29/08/18.
// Copyright © 2018 iostutorialjunction.com. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@leoiphonedev
leoiphonedev / ViewController-CATransition.swift
Created September 15, 2018 15:05
Creating IBOutlet and IBaction's for the controls we dragged on UIStoryboard
//
// ViewController.swift
// CATransition-Example
//
// Created by Aman Aggarwal on 29/08/18.
// Copyright © 2018 iostutorialjunction.com. All rights reserved.
//
import UIKit
@leoiphonedev
leoiphonedev / Animation using UIView Animation.swift
Created September 15, 2018 13:50
Animate any UIView class using UIView animate method provided in iOS SDk
UIView.animate(withDuration: 0.5) {
//animate your UILable
}