Skip to content

Instantly share code, notes, and snippets.

View pcolton's full-sized avatar

Paul Colton pcolton

View GitHub Profile
@pcolton
pcolton / dismissSearch.swift
Created June 24, 2021 23:33
SwiftUI dismissSearch example
//
// Created by Paul Colton on 6/24/21.
//
import SwiftUI
@main
struct DismissApp: App {
var body: some Scene {
WindowGroup {
@pcolton
pcolton / ObserveOnly.swift
Created May 19, 2021 19:41
A swift property wrapper that allows you to Observe a scoped down state of an ObservableObject.
// ObserveOnly
//
// Created by Paul Colton on 5/19/21.
//
/**
Given a model publisher, define the state and scoped state that you want to observe.
// Example usage: Given a data model...
@pcolton
pcolton / UIView+PixatePlaceholder.h
Created February 10, 2014 23:13
Remove Pixate from your project by using these temporary placeholder categories.
#import <UIKit/UIKit.h>
@interface UIView (PixatePlaceholder)
@property (nonatomic, copy) NSString *styleId;
@property (nonatomic, copy) NSString *styleClass;
@property (nonatomic, copy) NSString *styleCSS;
@property (nonatomic) int styleMode;
@end
@pcolton
pcolton / gist:6471193
Last active December 22, 2015 12:18
navigation-bar styling sample
navigation-bar {
color: blue;
background-color: lightblue;
}
navigation-bar title {
color: darkblue;
}
navigation-bar bar-button {
@pcolton
pcolton / gist:6144104
Created August 2, 2013 22:51
Styling a UISlider "thumb" with Pixate.
#slider thumb {
background-image : linear-gradient(#808487, #cbd1d5);
background-size : 16px 16px;
border-radius : 8px;
}
@pcolton
pcolton / gist:4597894
Created January 22, 2013 19:57
Custom back button styling for a UINavigation bar.
.myLeftNavButtons {
top : 6;
size : 115 31;
shape : arrow-button-left;
content-edge-inset : 0 0 0 6;
font-weight : regular;
font-size : 12px;
color : #ffffff;
border-radius : 3px;
@pcolton
pcolton / gist:4410841
Last active December 10, 2015 08:58
Sample of monitoring CSS file changes with Pixate and RubyMotion. #pixate #rubymotion
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
PixateFreestyle.initializePixateFreestyle
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = UIViewController.alloc.init
@window.styleMode = PXStylingNormal
@button = UIButton.buttonWithType UIButtonTypeSystem