Skip to content

Instantly share code, notes, and snippets.

View IhorYachmenov's full-sized avatar

Ihor Yachmenov IhorYachmenov

View GitHub Profile
//
// LiquidGlassEffectContainer.swift
//
import SwiftUI
struct LiquidGlassEffectContainer: View {
var body: some View {
ZStack {
Image("bgImg")
@Ali72
Ali72 / CoreMediaError.swift
Last active December 10, 2025 18:02
AVPlayer CoreMedia Errors
/**
-NOTE:
After AVPlayerItem faces an error you can create CoreMedia Error from the underlying Error inside AVPlayerItem error.
With the `CoreMediaError` enum, you can convert errors to more readable ones,handle AVPlayerItem Common errors,
and show the proper messages to your users.
**/
public enum CoreMediaError:Error {
@sgraaf
sgraaf / ISO 4217-1 with currency symbols.ipynb
Created August 9, 2021 19:36
ISO 4217 w/ currency symbols
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[
{ code: 'AD', label: 'Andorra', phone: '376', phoneLength: 6},
{ code: 'AE', label: 'United Arab Emirates', phone: '971', phoneLength: 9},
{ code: 'AF', label: 'Afghanistan', phone: '93', phoneLength: 9},
{ code: 'AG', label: 'Antigua and Barbuda', phone: '1-268', phoneLength: 10},
{ code: 'AI', label: 'Anguilla', phone: '1-264', phoneLength: 10},
{ code: 'AL', label: 'Albania', phone: '355', phoneLength: 9},
{ code: 'AM', label: 'Armenia', phone: '374', phoneLength: 6},
{ code: 'AO', label: 'Angola', phone: '244', phoneLength: 9},
{ code: 'AQ', label: 'Antarctica', phone: '672', phoneLength: 6},
@xtabbas
xtabbas / SnapCarousel.swift
Created May 10, 2020 18:13
A carousel that snap items in place build on top of SwiftUI
//
// SnapCarousel.swift
// prototype5
//
// Created by xtabbas on 5/7/20.
// Copyright © 2020 xtadevs. All rights reserved.
//
import SwiftUI
@IsaacXen
IsaacXen / README.md
Last active December 11, 2025 12:34
(Almost) Every WWDC videos download links for aria2c.
@adamkaplan
adamkaplan / UserAgent.swift
Created April 30, 2019 17:58
User Agent Strings in Swift
public class UserAgent {
public static let userAgent: String? = {
guard let info = Bundle.main.infoDictionary,
let appNameRaw = info["CFBundleDisplayName"] ?? info[kCFBundleIdentifierKey as String],
let appVersionRaw = info[kCFBundleVersionKey as String],
let appName = appNameRaw as? String,
let appVersion = appVersionRaw as? String
else { return nil }
#if canImport(UIKit)
@FWEugene
FWEugene / SwiftConcurrency.md
Created January 10, 2019 17:37
All about concurrency

Threads

Foundation offers a Thread class, internally based on pthread, that can be used to create new threads and execute closures.

// Detaches a new thread and uses the specified selector as the thread entry point.
Thread.detachNewThreadSelector(selector: Selector>, toTarget: Any, with: Any)

// Subclass
class MyThread: Thread {
@benpackard
benpackard / LargeTitleAdjustingNavigationController.swift
Last active August 22, 2024 15:31
A `UINavigationController` that adjusts the font size of its large title labels to fit its content
import UIKit
/// A `UINavigationController` that adjusts the font size of its large title labels to fit its content
class TitleSizeAdjustingNavigationController: UINavigationController {
var minimumScaleFactor: CGFloat = 0.5
override func viewDidLayoutSubviews() {
guard navigationBar.prefersLargeTitles else { return }
updateLargeTitleLabels()
@harishgonnabattula
harishgonnabattula / WWDC.json
Created August 25, 2018 20:34
WWDC 2015-2018 Video urls and summary
[
{"url": "https://devstreaming-cdn.apple.com/videos/wwdc/2018/236mwbxbxjfsvns4jan/236/236_hd_avspeechsynthesizer_making_ios_talk.mp4?dl=1", "title": "AVSpeechSynthesizer: Making iOS Talk", "summary": "Speech can enhance the audio experience of your app, whether you are generating spoken feedback for accessibility, or providing critical information beyond simple alerts or notifications. AVSpeechSynthesizer produces synthesized speech from text and allows you to control and monitor the progress of ongoing speech. Learn the ins and outs of AVSpeechSynthesizer and how to add computer-generated speech output to your app."},
{"url": "https://devstreaming-cdn.apple.com/videos/wwdc/2018/405bjty1j94taqv8ii/405/405_hd_measuring_performance_using_logging.mp4?dl=1", "title": "Measuring Performance Using Logging", "summary": "Learn how to use signposts and logging to measure performance. Understand how the Points of Interest instrument can be used to examine logged data. Get an introduction into creating and using custo