Skip to content

Instantly share code, notes, and snippets.


Rostyslav Dovhaliuk RenGate

View GitHub Profile
View article20-09-3.swift
@available(iOS 14.0, *)
func splitViewController(_ svc: UISplitViewController, topColumnForCollapsingToProposedTopColumn proposedTopColumn: UISplitViewController.Column) -> UISplitViewController.Column {
return .primary
View article20-09-2.swift
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
if let navigationController = secondaryViewController as? EEHNavigationController, navigationController.topViewController is PlaceholderViewController {
return true
} else {
return false
View article20-09-1.swift
viewController.navigationItem.leftBarButtonItem = splitViewController?.displayModeButtonItem
viewController.navigationItem.leftItemsSupplementBackButton = true
RenGate / InAppPurchaseManager.swift
Last active May 10, 2023 14:42
Sample implementation of In-App purchase manager class
View InAppPurchaseManager.swift
// MIT License
// Copyright (c) 2019 Rostyslav Dovhaliuk
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
RenGate /
Created February 20, 2015 09:11
Automatic generation of build number in Xcode project for easy Apple TestFlight distribution. It is a known fact that Apple TestFlight checks build number of uploaded ipa file and rejects binary if its build number is "less" than the one of the latest accepted build. It is hard to constantly change build number and push it to repo for building u…
buildNumber=$(date +%y.%m.%d.%H%M)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"