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 | |
// For Test Part 4 | |
// | |
// Created by Jeri P.M on 10/09/18. | |
// Copyright © 2018 Jeri P.M . 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
// | |
// PopUpViewController.swift | |
// | |
// Created by Jerry on 28/03/18. | |
// Copyright © 2018 Jerry. 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
// Replace String " " <- empty space Into "+OR+" <- Character | |
class TestBytesViewConroller: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let text = "This is a string" | |
let slashString = text.replacingOccurrences(of: " ", with: "+OR+") | |
print(slashString) | |
} |
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
import UIKit | |
import Kingfisher | |
class ViewPictureViewController: UIViewController { | |
@IBOutlet weak var imgView: UIImageView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let url = URL(string: "hhtp://googleImage.com/find") | |
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
// for set unsafe area background color "1" | |
extension UIApplication { | |
var statusBarView: UIView? { | |
return value(forKey: "statusBar") as? UIView | |
} | |
} |
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
import UIKit | |
//color RGB | |
extension UIColor { | |
convenience init(r: CGFloat, g: CGFloat, b: CGFloat) { | |
self.init(red: r / 255, green: g / 255, blue: b / 255, alpha: 1) | |
} | |
} | |
// trimmingCharacters removes only leading and trailing white spaces. |
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
<h1>vertices</h1> | |
<input id="SLID" type="range" min="1" max="21" value="10"><input id="TEXT"> | |
<canvas id="CNVS" width="1024" height="1024"></canvas><hr/> | |
<script> | |
const vs=`attribute vec4 a;uniform float vt; | |
void main(){ | |
gl_PointSize=1.0; | |
float th=vt*a.z/2.0; | |
gl_Position=a; | |
gl_Position.xy*=mat2(cos(th),-sin(th),sin(th),cos(th)); |
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
//JeriPM | |
// How to select an element of array Swift | |
import UIKit | |
class ExampleViewController: UIViewController { | |
var exArray = ["one", "two", "three"] | |
override func viewDidLoad() { |
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
// Test Change Date Format | |
let format = DateFormatter() | |
format.dateFormat = "yyyy-MM-dd" // from this format | |
let formatPrint = DateFormatter() | |
formatPrint.dateFormat = "dd MMMM yyyy" // to this format "IND Date" | |
// Process change format | |
if let date = format.date(from: ("2018-10-01"){ |
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
// | |
// CustomTableView.swift | |
// FoodLibrary | |
// | |
// Created by Jerry PM on 03/10/18. | |
// Copyright © 2018 jeriPm. All rights reserved. | |
// custom uitableview datasource | |
import Foundation | |
import UIKit |
OlderNewer