Skip to content

Instantly share code, notes, and snippets.

View bugrym's full-sized avatar
🥋
Focusing

Vladyslav bugrym

🥋
Focusing
  • Ukraine
View GitHub Profile
@bugrym
bugrym / Adaptive ScrollView
Created March 25, 2020 12:10
Adaptive ScrollView
//
// AdaptiveScroll.swift
// RatingApp
//
// Created by Vladyslav Bugrym on 25.03.2020.
// Copyright © 2020 admin. All rights reserved.
//
import UIKit
@bugrym
bugrym / TestFlightSteps
Created June 2, 2020 10:45
Add a new tester to TestFlight
1. App Store Connect
2. Users and Access
3. Tap +
4. Send an invite and add new user to App Store Connect
5. App Store Connect -> My Apps
6. App Store Connect Users
7. Tap + to add a new tester to App
@bugrym
bugrym / exponentiating
Created June 15, 2020 06:30
Universal exponentiating method
func multiplicatorWith(base:Int, rate:Int) -> Int {
var initialValue = base
for _ in 1..<rate {
initialValue *= base
}
OR
for _ in 0..<(rate - 1) {
initialValue *= base
@bugrym
bugrym / stackDataStructure
Created June 15, 2020 14:39
Generic stack data structure
public struct Stack<Element> {
private var elements:[Element] = []
public var isEmpty:Bool {
peek() == nil
}
public init() { }
public mutating func push(_ element:Element) {
@bugrym
bugrym / passport_validation_regex_expression
Last active July 21, 2020 10:21
Passport Series Validation
^[A-Z](?:[A-Z][0-9]{0,6})?$ regex for validate passport series format: XX000000
let validatedString = NSPredicate(format:"SELF MATCHES %@", validationExpression)
return validatedString.evaluate(with: text)
@bugrym
bugrym / UIView + Extension
Created August 4, 2020 07:40
Extension for UIView with all parameters
extension UIView {
public var width:CGFloat {
return self.frame.size.width
}
public var height:CGFloat {
return self.frame.size.height
}
@bugrym
bugrym / ScrollViewLayout
Created September 4, 2020 10:04
ScrollViewLayout
ScrollView:
leading & trailing constraints to safe area
top & bottom constraints to super view
ContainerView:
leading, trailing, top, bottom constraints to super view (ScrollView)
equal width to super view (ScrollView)
center vertically(Y) to super view (ScrollView)