Skip to content

Instantly share code, notes, and snippets.

@vzqwer
vzqwer / APNSTest.rb
Created December 5, 2014 12:03
Apple Push Notification Service using example with Swift. Supports iOS7.
# Install APNS gem:
# sudo gem install APNS
require 'APNS'
# gateway.sandbox.push.apple.com is default
# APNS.host = 'gateway.push.apple.com' # Production
APNS.host = 'gateway.sandbox.push.apple.com' # Development
# this is also the default. Shouldn't ever have to set this, but just in case Apple goes crazy, you can.
APNS.port = 2195
@vzqwer
vzqwer / ViewFactory.swift
Created March 11, 2022 20:16
Factory for simplifying UIKit views creation from code.
import UIKit
public struct ViewFactory {
public static var labelColor: UIColor = .black
public static var secondaryLabelColor: UIColor = .gray
public static var labelFont: UIFont = .systemFont(ofSize: 15, weight: .medium)
public static var fieldFont: UIFont = .systemFont(ofSize: 15, weight: .semibold)
public static func view(
_ backgroundColor: UIColor? = UIColor.clear,