This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
activityIndicator.startAnimating() | |
activityIndicator.hidesWhenStopped = true | |
let urlString = "http://www.apple.com" | |
let request = URLRequest(url: URL(string: urlString)!) | |
self.webView.load(request) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// WKWEbView-Demo | |
// | |
// Created by iosTutorialJunction.com on 10/08/18. | |
// Copyright © 2018 iosTutorialJunction.com. All rights reserved. | |
// | |
import UIKit | |
import WebKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// PulseAnimation | |
// | |
// Created by iostutorialjunction.com on 15/07/18. | |
// Copyright © 2018 iostutorialjunction.com. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { | |
self.animatePulsatingLayerAt(index: 0) | |
DispatchQueue.main.asyncAfter(deadline: .now() + 0.4, execute: { | |
self.animatePulsatingLayerAt(index: 1) | |
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: { | |
self.animatePulsatingLayerAt(index: 2) | |
}) | |
}) | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func animatePulsatingLayerAt(index:Int) { | |
//Giving color to the layer | |
pulseArray[index].strokeColor = UIColor.darkGray.cgColor | |
//Creating scale animation for the layer, from and to value should be in range of 0.0 to 1.0 | |
// 0.0 = minimum | |
//1.0 = maximum | |
let scaleAnimation = CABasicAnimation(keyPath: "transform.scale") | |
scaleAnimation.fromValue = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createPulse() { | |
for _ in 0...2 { | |
let circularPath = UIBezierPath(arcCenter: .zero, radius: UIScreen.main.bounds.size.width/2.0, startAngle: 0, endAngle: 2 * .pi, clockwise: true) | |
let pulseLayer = CAShapeLayer() | |
pulseLayer.path = circularPath.cgPath | |
pulseLayer.lineWidth = 2.0 | |
pulseLayer.fillColor = UIColor.clear.cgColor | |
pulseLayer.lineCap = kCALineCapRound | |
pulseLayer.position = CGPoint(x: imgvAvatar.frame.size.width/2.0, y: imgvAvatar.frame.size.width/2.0) | |
imgvAvatar.layer.addSublayer(pulseLayer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// PulseAnimation | |
// | |
// Created by iostutorialjunction.com on 15/07/18. | |
// Copyright © 2018 iostutorialjunction.com. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBOutlet weak var imgvAvatar: UIImageView! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CircularProgress.swift | |
// CircularProgress-Tutorial | |
// | |
// Created by Aman Aggarwal on 5/18/18. | |
// Copyright © 2018 iostutorialjunction.com . All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// CircularProgress-Tutorial | |
// | |
// Created by Aman Aggarwal on 5/18/18. | |
// Copyright © 2018 iostutorialjunction.com. All rights reserved. | |
// | |
import UIKit |