Skip to content

Instantly share code, notes, and snippets.

View victorBaro's full-sized avatar
👾

Victor Baro victorBaro

👾
View GitHub Profile
@alikaragoz
alikaragoz / RubberBandSwitch.swift
Created October 12, 2023 12:20
iOS Control Center Rubber Band Swift
import SwiftUI
struct RubberBandSwitch: View {
enum Const {
static let shapeSize: CGSize = .init(width: 90.0, height: 190.0)
static let cornerRadius: CGFloat = 26.0
}
@State var value = 0.5
@stammy
stammy / LiquidBlobs.swift
Last active April 3, 2024 20:55
Liquid Blob effect with SwiftUI
//
// ContentView.swift
// LiquidCircles
//
// Created by Paul Stamatiou on 10/10/22.
//
import SwiftUI
struct ContentView: View {
@nicklockwood
nicklockwood / Withable.swift
Created January 28, 2019 12:06
Withable.swift
/// Withable is a simple protocol to make constructing
/// and modifying objects with multiple properties
/// more pleasant (functional, chainable, point-free)
public protocol Withable {
init()
}
public extension Withable {
/// Construct a new instance, setting an arbitrary subset of properties
init(with config: (inout Self) -> Void) {
@smileyborg
smileyborg / InteractiveTransitionCollectionViewDeselection.m
Last active January 15, 2023 13:03
Animate table & collection view deselection alongside interactive transition (for iOS 11 and later)
// UICollectionView Objective-C example
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject];
if (selectedIndexPath != nil) {
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
if (coordinator != nil) {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
@tahmmee
tahmmee / opencv_text_detect
Created December 16, 2016 14:29
opencv Text Detection in ios
+ (UIImage*) detectWithImage: (UIImage*) inputImage
{
cv::Mat src = [inputImage CVMat3];
// Extract channels to be processed individually
std::vector<cv::Mat> channels;
cv::text::computeNMChannels(src, channels);
int cn = (int)channels.size();
@MP0w
MP0w / IntrinsicSizeAwareScrollView.swift
Created November 29, 2016 13:47
A `UIScrollView` subclass that adapts its `intrinsicContentSize` to its `contentSize`
import Foundation
import UIKit
/// A `UIScrollView` subclass that adapts its `intrinsicContentSize` to its `contentSize`
final class IntrinsicSizeAwareScrollView: UIScrollView {
private let keyPath = NSStringFromSelector(#selector(getter: contentSize))
override init(frame: CGRect) {
super.init(frame: frame)
@nixta
nixta / AGSSingleFingerZoomGestureRecognizer.swift
Last active March 23, 2021 13:17
A Google-Maps like single-finger zoom gesture for the ArcGIS Runtime SDK for iOS. Awesome idea, Google Maps team! 👏👏👏
//
// AGSSingleFingerZoomGestureRecognizer.swift
//
// Created by Nicholas Furness on 6/17/16.
// Copyright © 2016 Esri. All rights reserved.
//
import Foundation
import ArcGIS
@Ashton-W
Ashton-W / Breakpoints_v2.xcbkptlist
Last active January 25, 2023 09:28
My User Breakpoints_v2.xcbkptlist
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<!-- All Exceptions -->
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@andymatuschak
andymatuschak / MultiDirectionAdjudicatingScrollView.swift
Created January 26, 2015 19:31
Source for the Khan Academy app's unusual scrolling interactions
//
// MultiDirectionAdjudicatingScrollView.swift
// Khan Academy
//
// Created by Andy Matuschak on 12/16/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
import UIKit.UIGestureRecognizerSubclass