Skip to content

Instantly share code, notes, and snippets.

@romanfurman6
Last active December 6, 2019 13:42
Show Gist options
  • Save romanfurman6/fe3f5c393e091b73f683a9003d8e53d9 to your computer and use it in GitHub Desktop.
Save romanfurman6/fe3f5c393e091b73f683a9003d8e53d9 to your computer and use it in GitHub Desktop.
import UIKit
import os.signpost
class ViewController: UIViewController {
let label = UILabel()
let viewDidLoadOSLog = OSLog(subsystem: "com.uptech.TestProject", category: .pointsOfInterest)
override func viewDidLoad() {
super.viewDidLoad()
// some code here
os_signpost(.begin, log: viewDidLoadOSLog, name: "viewDidLoad")
// some code here
setupUI()
someWeirdFunc()
os_signpost(.end, log: viewDidLoadOSLog, name: "viewDidLoad")
// some code here
}
func setupUI() {
view.addSubview(label)
label.text = ""
}
func someWeirdFunc() {
for value in 0...9999 { label.text! += "\(value)" }
label.sizeToFit()
label.center = CGPoint(
x: view.frame.size.width / 2,
y: view.frame.size.height / 2
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment