Skip to content

Instantly share code, notes, and snippets.

View ren6's full-sized avatar

Renat Kurbanov ren6

View GitHub Profile
@ren6
ren6 / Example.swift
Created June 17, 2019 14:10
Auto-renewable subscriptions transaction observer
extension IAPManager: SKPaymentTransactionObserver {
public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
switch (transaction.transactionState) {
case .purchased:
SKPaymentQueue.default().finishTransaction(transaction)
notifyIsPurchased(transaction: transaction)
break
case .failed:
var body: some View {
VStack{
Text("World Time").font(.system(size: 30))
Text("Yet another subtitle").font(.system(size: 20))
}
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
@_functionBuilder public struct ViewBuilder {
/// Builds an empty view from an block containing no statements, `{ }`.
public static func buildBlock() -> EmptyView
/// Passes a single view written as a child view (e..g, `{ Text("Hello") }`) through
/// unmodified.
public static func buildBlock<Content>(_ content: Content) -> Content where Content : View
}
@ren6
ren6 / gist:ab5da6d6a696c61836fc
Last active September 28, 2015 14:37
VTakte Configuration
{
"vk_playback": 1,
}
//
// ViewController.m
// AVPlayerCaching
//
// Created by Anurag Mishra on 5/19/14.
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer
//
#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>