Skip to content

Instantly share code, notes, and snippets.

@WrathChaos
WrathChaos / statusbar-color-change.md
Last active June 15, 2022 08:52
iOS 13 and Below How to change Status Bar Color?
if #available(iOS 13.0, *) {
    let app = UIApplication.shared
    let statusBarHeight: CGFloat = app.statusBarFrame.size.height
    
    let statusbarView = UIView()
    statusbarView.backgroundColor = UIColor.red
    view.addSubview(statusbarView)
  
 statusbarView.translatesAutoresizingMaskIntoConstraints = false
@Fazzani
Fazzani / free_m3u8.m3u
Created July 28, 2018 09:13
Free m3u8 streams
http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8
http://playertest.longtailvideo.com/adaptive/wowzaid3/playlist.m3u8
http://cdn-fms.rbs.com.br/vod/hls_sample1_manifest.m3u8
http://nasatv-lh.akamaihd.net/i/NASA_101@319270/index_1000_av-p.m3u8?sd=10&rebase=on
http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8
@norsez
norsez / JSONSaveLoad.swift
Created May 7, 2018 04:47
Load and Save JSON objects into a local file (written in Swift)
import Foundation
/**
Extension to save/load a JSON object by filename. (".json" extension is assumed and automatically added.)
*/
extension JSONSerialization {
static func loadJSON(withFilename filename: String) throws -> Any? {
let fm = FileManager.default
@wilmarvh
wilmarvh / TextSize.swift
Created April 8, 2017 20:08 — forked from gnou/TextSize.swift
Calculate height of some text when width is fixed
public struct TextSize {
fileprivate struct CacheEntry: Hashable {
let text: String
let font: UIFont
let width: CGFloat
let insets: UIEdgeInsets
fileprivate var hashValue: Int {
return text.hashValue ^ Int(width) ^ Int(insets.top) ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right)