Skip to content

Instantly share code, notes, and snippets.

Avatar

Petr Pavlik petrpavlik

View GitHub Profile
@petrpavlik
petrpavlik / swiftpack-api.md
Last active Aug 28, 2021
Swiftpack.co API
View swiftpack-api.md

Authorization

You need to provide Authorization header in form Basic yourtoken and User-Agent header

Endpoints

  • /api/fresh
  • /api/popular
  • /api/search

All endpoints accept offset and limit (max 1000) query params. Search endpoint also requires query endpoint.

View package.swift
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "BusinessLogic",
platforms: [
.iOS(.v13), .macOS(.v10_15)
],
View voiceover issue.swift
//
// ViewController.swift
// AccessibilityTest
//
// Created by Petr Pavlik on 28/01/2020.
// Copyright © 2020 Petr Pavlik. All rights reserved.
//
import UIKit
View AsyncRequestGroup.swift
import Foundation
import HTTP
import Dispatch
public class AsyncRequestGroup {
private enum DummyError: Error {
case dummy
}
View AlertController.swift
//
// ViewController.swift
// Alert
//
// Created by Petr Pavlik on 25/03/16.
// Copyright © 2016 Petr Pavlik. All rights reserved.
//
import UIKit
View KeyboardFrameDetectorInputView.swift
//
// KeyboardFrameDetectorInputView.swift
// Chat
//
// Created by Petr Pavlik on 18/10/15.
// Copyright © 2015 Petr Pavlik. All rights reserved.
//
import UIKit
@petrpavlik
petrpavlik / BaseEntity.h
Last active Dec 19, 2015
Base class for model objects which allows to initWith/saveTo NSDictionary, JSON string or NSCoder
View BaseEntity.h
//
// BaseEntity.h
// Base Entity
//
// Created by Petr Pavlik on 12/30/12.
// Copyright (c) 2012 Petr Pavlik. All rights reserved.
//
#import <Foundation/Foundation.h>
@petrpavlik
petrpavlik / gist:5517894
Last active Dec 16, 2015
Example of how to use auto layout inside UITableViewCell
View gist:5517894
//
// PostCell.m
// Test
//
// Created by Petr Pavlik on 5/4/13.
// Copyright (c) 2013 Petr Pavlik. All rights reserved.
//
#import "PostCell.h"