Skip to content

Instantly share code, notes, and snippets.

@bcse
bcse / app.yaml
Created August 28, 2015 06:59
Debian repository on Google App Engine
application: altcanvas-repo
version: 1
runtime: python
api_version: 1
handlers:
- url: .*
script: debrepo.py
@bcse
bcse / main.m
Created September 27, 2017 03:56
[GCD] Use semaphore as lock
#import <Foundation/Foundation.h>
int main(int argc, char *argv[]) {
@autoreleasepool {
dispatch_semaphore_t lock = dispatch_semaphore_create(0);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{
NSLog(@"unlock");
dispatch_semaphore_signal(lock);
});
@bcse
bcse / MyMenu.swift
Last active May 25, 2018 07:01
Generics class with delegate
import Foundation
import UIKit
public protocol MenuItem {}
public protocol MenuDelegate: AnyObject {
associatedtype Item: MenuItem
func menu(_ menu: Menu<Item, Self>, didSelect item: Item)
}
@bcse
bcse / gist:3fd23b5d3daaf12c7e99b7b260dd250f
Last active December 3, 2020 15:58
jq - VoTT JSON to CreateML JSON
jq '[.assets[] | { image: .asset.name, annotations: [.regions[] | { label: .tags[0], coordinates: .boundingBox | { x: .left | round, y: .top | round, width: .width | round, height: .height | round } }] }]'
@bcse
bcse / 2026-03-07-transparent-embedded-flutter-view.md
Created March 6, 2026 20:08
Making a Transparent Embedded FlutterView Pass Touches Through on iOS

Making a Transparent Embedded FlutterView Pass Touches Through on iOS

When you embed Flutter into an existing iOS app, one common pattern is to place a FlutterViewController on top of native UIKit content as an overlay. Visually, this is straightforward: make the Flutter view transparent and render only the pieces of UI you want to show.

The tricky part is touch handling.

Even when the Flutter overlay is visually transparent, it still sits on top of the native view hierarchy. That means touches inside the overlay’s frame are usually captured by the Flutter view instead of reaching the UIViews underneath. If your design expects native controls below the transparent parts of Flutter to remain tappable, visual transparency alone is not enough.

This post explains the problem, the recommended solution, and a sample implementation for both iOS and Flutter.