Skip to content

Instantly share code, notes, and snippets.

View jerrypm's full-sized avatar
🎯
Focusing

Jerry <N.P> jerrypm

🎯
Focusing
View GitHub Profile
/
// 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
//
// PopUpViewController.swift
//
// Created by Jerry on 28/03/18.
// Copyright © 2018 Jerry. All rights reserved.
//
import UIKit
import WebKit
// 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)
}
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")
// for set unsafe area background color "1"
extension UIApplication {
var statusBarView: UIView? {
return value(forKey: "statusBar") as? UIView
}
}
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.
@jerrypm
jerrypm / short04.4.html
Created September 15, 2018 07:01 — forked from diska/short04.4.html
「vertexたくさん描くと重い」というテストコード。
<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));
//JeriPM
// How to select an element of array Swift
import UIKit
class ExampleViewController: UIViewController {
var exArray = ["one", "two", "three"]
override func viewDidLoad() {
// 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"){
//
// CustomTableView.swift
// FoodLibrary
//
// Created by Jerry PM on 03/10/18.
// Copyright © 2018 jeriPm. All rights reserved.
// custom uitableview datasource
import Foundation
import UIKit