This file contains 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
@objc class AppDelegate: UIResponder, UIApplicationDelegate { | |
override init() { | |
debugPrint("AppDelegate.init") | |
super.init() | |
} | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { |
This file contains 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
// | |
// ViewController.swift | |
// ConstantArea | |
// | |
// Created by Gleb Tarasov on 24.05.2020. | |
// Copyright © 2020 Gleb Tarasov. All rights reserved. | |
// | |
import UIKit |
This file contains 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
class MyView: UILabel { | |
init() { | |
super.init(frame: .zero) | |
numberOfLines = 0 | |
} | |
required init?(coder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} |
This file contains 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
class MyView: UIView { | |
private var preferredMaxLayoutWidth: CGFloat? { | |
didSet { | |
invalidateIntrinsicContentSize() | |
setNeedsLayout() | |
} | |
} | |
override var intrinsicContentSize: CGSize { | |
return performLayout(changeFrames: false, width: preferredMaxLayoutWidth) |
This file contains 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
Privacy Policy | |
Your privacy is important to us. It is ParkingGuru's policy to respect your privacy regarding any information we may collect from you across our website, http://parkinggu.ru, and other sites we own and operate. | |
We only ask for personal information when we truly need it to provide a service to you. We collect it by fair and lawful means, with your knowledge and consent. We also let you know why we’re collecting it and how it will be used. | |
We only retain collected information for as long as necessary to provide you with your requested service. What data we store, we’ll protect within commercially acceptable means to prevent loss and theft, as well as unauthorized access, disclosure, copying, use or modification. | |
We don’t share any personally identifying information publicly or with third-parties, except when required to by law. | |
Our website may link to external sites that are not operated by us. Please be aware that we have no control over the content and practices of these sites, and cannot acce |
This file contains 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
// | |
// UITestCase.swift | |
// | |
// Created by Gleb Tarasov on 23/04/2018. | |
// | |
import Foundation | |
import XCTest | |
import UIKit |
This file contains 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 typeText(_ text: String, toWebViewField element: XCUIElement) { | |
// xcode has bug, so we cannot directly access webViews XCUIElements | |
// as workaround we can check debugDesciption, find frame, tap by coordinate, | |
// and then paste text there | |
guard let coordBeforeTap = coordinate(forWebViewElement: element) else { | |
XCTFail("no element \(element)") | |
return | |
} | |
// "typeText" doesn't work, so we paste text | |
// first tap to activate field |
This file contains 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
private func coordinate(forWebViewElement element: XCUIElement) -> XCUICoordinate? { | |
// wait for element to appear before searching | |
wait(forWebViewElement: element) | |
// parse description to find its frame | |
let descr = element.firstMatch.debugDescription | |
guard let rangeOpen = descr.range(of: "{{", options: [.backwards]), | |
let rangeClose = descr.range(of: "}}", options: [.backwards]) else { | |
return nil | |
} |
This file contains 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 wait(forWebViewElement element: XCUIElementTypeQueryProvider, timeout: TimeInterval = 20) { | |
// xcode has bug, so we cannot directly access webViews XCUIElements | |
// as a workaround we can check debugDesciption and parse it, that works | |
let predicate = NSPredicate { obj, _ in | |
guard let el = obj as? XCUIElement else { | |
return false | |
} | |
// If element has firstMatch, than there will be description of that at the end | |
// If no match - it will be ended with "FirstMatch\n" | |
return !el.firstMatch.debugDescription.hasSuffix("First Match\n") |
This file contains 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
private_lane :prepare_certificates do |options| | |
sh("base64 -D -o Certificates.p12 <<< \"#{ENV['APPLE_CERTIFICATE']}\"", log: false) | |
create_keychain( | |
name: "default_keychain", | |
default_keychain: true, | |
unlock: true, | |
password: "default" | |
) | |
import_certificate( | |
certificate_path: "fastlane/Certificates.p12", |
NewerOlder