This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIView { | |
public var width:CGFloat { | |
return self.frame.size.width | |
} | |
public var height:CGFloat { | |
return self.frame.size.height | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^[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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Stack<Element> { | |
private var elements:[Element] = [] | |
public var isEmpty:Bool { | |
peek() == nil | |
} | |
public init() { } | |
public mutating func push(_ element:Element) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func multiplicatorWith(base:Int, rate:Int) -> Int { | |
var initialValue = base | |
for _ in 1..<rate { | |
initialValue *= base | |
} | |
OR | |
for _ in 0..<(rate - 1) { | |
initialValue *= base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AdaptiveScroll.swift | |
// RatingApp | |
// | |
// Created by Vladyslav Bugrym on 25.03.2020. | |
// Copyright © 2020 admin. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func findNumbers(_ nums: [Int]) -> Int { | |
var res = 0 | |
if nums.count >= 1 && nums.count <= 500 { | |
nums.map { | |
if $0 >= 1 && $0 <= 100000 { | |
var givenNum = $0 | |
var digits:[Int] = [] | |
repeat { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func subtractProductAndSum(_ n: Int) -> Int { | |
var givenNum = n | |
var num:[Int] = [] | |
if n >= 1 && n <= 100000 { | |
repeat { | |
let digit = givenNum%10 | |
givenNum /= 10 | |
num.append(digit) | |
} while (givenNum != 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func defangIPaddr(_ address: String) -> String { | |
return address.replacingOccurrences(of: ".", with: "[.]") | |
} |
NewerOlder