Skip to content

Instantly share code, notes, and snippets.

View Ksen17's full-sized avatar
🚀
Working on project

Ilia Stukalov Ksen17

🚀
Working on project
View GitHub Profile
@kravik
kravik / detect-text.swift
Last active February 1, 2019 12:46
iOS 11 Vision. Text detection
let image = UIImage(named: "text.png")!
let vnImage = VNImageRequestHandler(cgImage: image.cgImage!, options: [:])
let textRectsRequest = VNDetectTextRectanglesRequest { (request, error) in
if let results = request.results as? [VNTextObservation] {
for result in results {
print("boundingBox \(result.boundingBox)")
print("characterBoxes \(result.characterBoxes)")
}
}
}
@DejanEnspyra
DejanEnspyra / Obfuscator.swift
Created May 31, 2017 17:51
Obfuscation of hard-coded security-sensitive strings.
//
// Obfuscator.swift
//
// Created by Dejan Atanasov on 2017-05-31.
//
import Foundation
class Obfuscator: AnyObject {
@kishikawakatsumi
kishikawakatsumi / ReorderingRealmResultsInTableView.swift
Created July 27, 2016 04:51
Reorder Realm Results in UITableView
import UIKit
import RealmSwift
class Data: Object {
dynamic var name = ""
...
dynamic var order = 0 // 並べ替えのためのカラムが必要
}
@skounis
skounis / image.swift
Last active June 5, 2021 03:47
Image manipulation example in Swift demonstrating UIImage, RGBAImage,
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
let image = UIImage(named: "demo.jpg")!
let myRGBA = RGBAImage(image: image)!
//
@zacwest
zacwest / ios-font-sizes.swift
Last active March 27, 2024 07:16
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]