Skip to content

Instantly share code, notes, and snippets.

View inekipelov's full-sized avatar
🔄
In progress

Roman Nekipelov inekipelov

🔄
In progress
View GitHub Profile
@sebjvidal
sebjvidal / UIImage+BarButtonImage.swift
Created February 19, 2026 10:42
UIBarButtonItem Image and Title
import UIKit
extension UIImage {
static func barButtonImage(title titleText: String, showsBadge: Bool) -> UIImage {
let badgeView = UIImageView()
badgeView.image = .badge
badgeView.isHidden = showsBadge == false
badgeView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(textStyle: .footnote)
let titleTextLabel = UILabel()
@1998code
1998code / ContentView.swift
Last active March 8, 2026 12:25
Liquid Glass Magnifier Loupe
//
// ContentView.swift
// Liquid Magnifying Glass
//
// A draggable magnifier loupe with liquid glass effect, zoom controls, and
// full-screen gesture handling for reliable repeated drags.
//
// Created by Ming on 29/1/2026.
//
//
// ContentView.swift
// MapModeButton-Demo
//
// Created by Seb Vidal on 30/07/2025.
//
import SwiftUI
struct ContentView: View {
@T1T4N
T1T4N / .swiftlint.yml
Last active February 1, 2026 14:08
Default SwiftLint configuration as only_rules
# strict: true
# File organization
# included:
# - Sources
# - Tests
excluded:
- .build
- .swiftpm
- DerivedData
@zats
zats / ContentView.swift
Last active January 24, 2026 23:59
Internal SF Symbols
struct ContentView: View {
var body: some View {
let names = [
["appstore.app.dashed", "buildings.3d", "emoji.chicken.face"],
["person.text.rectangle.and.nfc", "secure.element", "laugh.bubble.tapback.2.he"],
["apple.news", "apple.podcasts.square.stack", "apple.slice"],
]
VStack(spacing: 20) {
Grid(horizontalSpacing: 20, verticalSpacing: 20) {
ForEach(names, id: \.self) { nameRow in
@zats
zats / readme.md
Created October 12, 2023 03:08
Private SF Symbols

List of all the images in /Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/SFSymbols.framework/CoreGlyphsPrivate.bundle/Assets.car

NSBundle *const sfSymbolsBundle = [SFSCoreGlyphsBundle private];
_UIAssetManager *const assetManager = [_UIAssetManager assetManagerForBundle:sfSymbolsBundle];
UIImage *const image = [assetManager imageNamed:@"apple.breathe"];
@chriseidhof
chriseidhof / .swiftlint.yml
Created February 7, 2023 09:59
SwiftLint rules for state, state object, environment and scaled metric
disabled_rules:
- trailing_comma
opt_in_rules:
- file_header
file_header:
forbidden_pattern: /./
custom_rules:
state_private:
name: "Private SwiftUI State"
regex: "\\@State\\s*var"
@sebj
sebj / Guide.md
Last active March 13, 2026 14:41
Add a scene delegate back to a SwiftUI Project

Define an application delegate

See also: UIApplicationDelegate documentation

// AppDelegate.swift
@main
final class AppDelegate: NSObject, UIApplicationDelegate {

    func application(
        _ application: UIApplication,
@hannesoid
hannesoid / InputAccessoryHostingController.swift
Last active July 11, 2025 14:51
Use a SwiftUI View as inputAccessoryView, dynamically adjusting to height changes
// (c) Hannes Oud @hannesoid
/// Hosts a SwiftUI view for use as an`inputAccessoryView`
///
/// - Implements a subclass of `UIInputViewController`, this allows setting it as `UITextView.inputAccessoryViewController`
/// - Has as a `.view` a `UIView` subclass that provides a `.intrinsicContentSize` which returns the height of a SwiftUI view
/// - Has a `UIHostingViewController` subclass as a child view controller. Invalidates the `.view`'s `intrinsicContentSize` when the SwiftUI view layouts, in order to inform the system to update the size of the `inputAccessoryView`
///
/// **Usage**
///
@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 {