Skip to content

Instantly share code, notes, and snippets.

View karambirov's full-sized avatar
📱
iOS developer

Eugene Karambirov karambirov

📱
iOS developer
View GitHub Profile
@ryanlintott
ryanlintott / LayoutThatFits.swift
Last active December 8, 2023 15:14
An alternative to ViewThatFits. Updated version can be found here: https://github.com/ryanlintott/LayoutThatFits
//
// LayoutThatFits.swift
// WWDC22Experiments
//
// Created by Ryan Lintott on 2022-06-08.
//
import SwiftUI
struct LayoutThatFits: Layout {
@rusik
rusik / PizzaUI.swift
Last active August 3, 2024 14:19
Implementation of half-pizza UI from Dodo Pizza on SwiftUI. Original UIKit implementation is here → https://habr.com/ru/company/dododev/blog/452876/
import SwiftUI
import Foundation
struct ContentView: View {
var body: some View {
HStack(spacing: 4) {
PizzaView(color: .blue, orientation: .left)
PizzaView(color: .red, orientation: .right)
}
}
@hoishing
hoishing / HowTo.md
Last active July 16, 2025 04:54
VSCode keybindings for Xcode

VSCode keybindings for Xcode

  • copy VSCode.idekeybindings to ~/Library/Developer/Xcode/UserData/KeyBindings
  • in Xcode preferences -> key bindings, select VSCode
@jasdev
jasdev / ScrimLoader.swift
Last active April 19, 2024 03:47
Rough sketch of Arc’s scrim loading view.
import SwiftUI
/**
### Exercises for the viewer
- Phase interrupt handling.
- Use Swift concurrency.
- Color scheme awareness.
- Rework animations to be more spring-like à la what shipped in `0.90.0`.
import notify
import Combine
enum Notify {}
extension Notify {
struct Status: Error {
let rawValue: UInt32
init(_ rawValue: UInt32) {
self.rawValue = rawValue
@katleta3000
katleta3000 / gist:6478752b49860553cdb23846992a234f
Created July 30, 2023 19:34
iOS application push launch processing
import UIKit
import UserNotifications
final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
private let pushAppLaunchRule = PushAppLaunchRule()
var window: UIWindow?
func sceneDidBecomeActive(_ scene: UIScene) {
extension StringProtocol {
subscript(_ offset: Int) -> String.Element {
if offset >= 0 {
self[index(startIndex, offsetBy: offset)]
} else {
self[index(endIndex, offsetBy: offset)]
}
}