Skip to content

Instantly share code, notes, and snippets.

View inekipelov's full-sized avatar
🏠
Working from home

Roman Nekipelov inekipelov

🏠
Working from home
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 {
//
// Created by Volodymyr Andriienko on 18.05.2021.
// Copyright © 2021 VAndrJ. All rights reserved.
//
#if DEBUG
#if canImport(SwiftUI)
import SwiftUI
@available (iOS 13.0, *)
@Hiroki-Kawakami
Hiroki-Kawakami / AppDelegate.swift
Created February 10, 2021 19:22
SwiftUI Change Status Bar Color with Custom Hosting Controller
//
// AppDelegate.swift
// StatusBarTest
//
// Created by hiroki on 2021/02/11.
//
import UIKit
import SwiftUI
@DreamingInBinary
DreamingInBinary / Best in Class iOS Checklist
Last active November 29, 2024 06:33
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10.
> To use this, create a Github Issue in your own repo, and simply copy and paste this text.
## iOS Core Technology
_Things any iOS app can benefit from_
- [ ] iCloud Sync
- [ ] Focus Filter Support
@sunshinejr
sunshinejr / AttributedString.swift
Last active November 24, 2022 16:14
Different approach to Attributed Strings in Swift.
import Foundation
import class UIKit.UIImage
struct AttributedString: ExpressibleByStringInterpolation {
enum Attribute: Hashable {
enum ImportanceLevel: String, Equatable {
case very
case enough
}
case important(ImportanceLevel = .enough)
import Foundation
// MARK: - typed predicate types
public protocol TypedPredicateProtocol: NSPredicate { associatedtype Root }
public final class CompoundPredicate<Root>: NSCompoundPredicate, TypedPredicateProtocol {}
public final class ComparisonPredicate<Root>: NSComparisonPredicate, TypedPredicateProtocol {}
// MARK: - compound operators
name download_total
AFNetworking 61983241
Fabric 50998892
Crashlytics 49667729
SDWebImage 45471101
Alamofire 42097177
CocoaLumberjack 36071914
Bolts 35294870
FirebaseInstanceID 30277793
FirebaseAnalytics 30254593
@onevcat
onevcat / Delegate.swift
Last active December 23, 2022 07:21
An auto-weak delegate for handle modern delegate pattern.
import Foundation
/// A class that keeps a weakly reference for `self` when implementing `onXXX` behaviors.
/// Instead of remembering to keep `self` as weak in a stored closure:
///
/// ```swift
/// // MyClass.swift
/// var onDone: (() -> Void)?
/// func done() {
/// onDone?()
@candostdagdeviren
candostdagdeviren / .swiftlint.yml
Last active September 15, 2024 19:51
Sample SwiftLint file to apply best practices
disabled_rules: # rule identifiers to exclude from running
- variable_name
- nesting
- function_parameter_count
opt_in_rules: # some rules are only opt-in
- control_statement
- empty_count
- trailing_newline
- colon
- comma
@fahied
fahied / MyWKWebVC.Swift
Created January 10, 2017 06:46
WKWebView controller example with progress bar
//
// MyWKWebVC.Swift
// Example
//
// Created by Fahied on 04/01/2017.
//
import Foundation
import UIKit
import WebKit