Skip to content

Instantly share code, notes, and snippets.

View petrpavlik's full-sized avatar

Petr Pavlik petrpavlik

View GitHub Profile
@petrpavlik
petrpavlik / swiftpack-api.md
Last active September 17, 2023 04:32
Swiftpack.co API

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.

// 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)
],
//
// ViewController.swift
// AccessibilityTest
//
// Created by Petr Pavlik on 28/01/2020.
// Copyright © 2020 Petr Pavlik. All rights reserved.
//
import UIKit
import Foundation
import HTTP
import Dispatch
public class AsyncRequestGroup {
private enum DummyError: Error {
case dummy
}
//
// ViewController.swift
// Alert
//
// Created by Petr Pavlik on 25/03/16.
// Copyright © 2016 Petr Pavlik. All rights reserved.
//
import UIKit
@petrpavlik
petrpavlik / BaseEntity.h
Last active December 19, 2015 16:19
Base class for model objects which allows to initWith/saveTo NSDictionary, JSON string or NSCoder
//
// 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 December 16, 2015 23:59
Example of how to use auto layout inside UITableViewCell
//
// PostCell.m
// Test
//
// Created by Petr Pavlik on 5/4/13.
// Copyright (c) 2013 Petr Pavlik. All rights reserved.
//
#import "PostCell.h"
//
// KeyboardFrameDetectorInputView.swift
// Chat
//
// Created by Petr Pavlik on 18/10/15.
// Copyright © 2015 Petr Pavlik. All rights reserved.
//
import UIKit