Skip to content

Instantly share code, notes, and snippets.

View leoiphonedev's full-sized avatar

Aman Aggarwal leoiphonedev

View GitHub Profile
@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 / 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
}
@leoiphonedev
leoiphonedev / Localization-Tutorial-ViewController-Final.swift
Created September 3, 2018 05:45
Using LocalizationSystem and changing app language from inside of the app
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var lblHeader: UILabel!
@IBOutlet weak var btnChangeLangauge: UIButton!
@IBOutlet weak var lblCurrentLanguage: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
@leoiphonedev
leoiphonedev / Localization-Tutorial-Aceesing_values_from_Localizable_file.swift
Last active September 3, 2018 05:07
Accessing values from localizable.strings file
let textFromLocalizable = NSLocalizedString("change_language", comment: "")
print("Localized text == \(textFromLocalizable)")
@leoiphonedev
leoiphonedev / Localization-Tutorial-ViewController.swift
Last active August 27, 2018 10:11
Creating IBOutlet's for UILabel's and UIButton for the app user interface
class ViewController: UIViewController {
@IBOutlet weak var lblHeader: UILabel!
@IBOutlet weak var btnChangeLangauge: UIButton!
@IBOutlet weak var lblCurrentLanguage: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
}
@leoiphonedev
leoiphonedev / WKWebViewDemo-VC-impementingKVOFunction.swift
Created August 11, 2018 14:34
Implementing NSKeyValueObserving function
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "loading" {
if webView.isLoading {
activityIndicator.startAnimating()
activityIndicator.isHidden = false
} else {
activityIndicator.stopAnimating()
}
}
}
@leoiphonedev
leoiphonedev / WKWebViewDemo-VC-addingKVO.swift
Created August 11, 2018 14:28
Making ViewController.swift class as observer
self.webView.addObserver(self, forKeyPath: #keyPath(WKWebView.isLoading), options: .new, context: nil)