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
import Foundation | |
/// Protocol defining the behavior of a repeated task service. | |
protocol RepeatedTaskServiceProtocol { | |
/// Schedules a repeated task to be executed at specified intervals. | |
/// - Parameters: | |
/// - interval: The time interval between executions. | |
/// - repeatCount: The number of times to repeat the task. | |
/// - identifier: The optional unique identifier for the task. If nil, an identifier will be auto-generated. | |
func execute( |
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
// | |
// Created by Egzon Pllana on 28.12.21. | |
// | |
import Foundation | |
class FilesIOManager { | |
// MARK: - Properties |
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
import Foundation | |
extension String { | |
func isValidEmailAddress() -> Bool { | |
// swiftlint:disable line_length | |
let emailRegEx = """ | |
(?:[a-zA-Z0-9!#$%\\&‘*+/=?\\^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%\\&'*+/=?\\^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\]) | |
""" | |
// swiftlint:enable line_length | |
let emailTest = NSPredicate(format: "SELF MATCHES[c] %@", emailRegEx) |
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
/// Copyright (c) 2021 Razeware LLC | |
/// RayWenderlich SwiftUI Book 3.0 (2021) | |
/// Egzon Pllana 07.03.2021 | |
import SwiftUI | |
import MapKit | |
// MARK: - SwiftUI Coordinator (connect delegate & protocols) | |
class MapCoordinator: NSObject { |
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
var countCharactersInRow = getCharactersInARowCount(fromString: "aaaabbbcca") | |
func getCharactersInARowCount(fromString string: String) -> [[Character: Int]] { | |
print("Given string: ", string) | |
guard !string.isEmpty else { return []} | |
let charactersArray: [Character] = string.map { $0 } | |
var collectedData: [[Character: Int]] = [] | |
var lastCharacter: Character = charactersArray.first! |
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
import UIKit | |
import TYUtils | |
// Codable Model | |
struct Person: Codable { | |
var name: String | |
} | |
// UserDefault Extension | |
private extension UserDefault.Key { |
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
// | |
// Created by Egzon Pllana on 13.4.23. | |
// Copyright © 2023 Native Coders. All rights reserved. | |
// | |
import UIKit | |
class IndicatingTabBarController: UITabBarController, UITabBarControllerDelegate { | |
// MARK: - Properties - |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
let gestureRecognizer = UIPanGestureRecognizer(target: self, | |
action: #selector(panGestureRecognizerHandler(_:))) | |
view.addGestureRecognizer(gestureRecognizer) | |
} | |
@IBAction func panGestureRecognizerHandler(_ sender: UIPanGestureRecognizer) { | |
let touchPoint = sender.location(in: view?.window) | |
var initialTouchPoint = CGPoint.zero |
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
// Created on 7/9/2020. | |
// | |
// Developed by: Kilo Loco | |
// Improved by Egzon Pllana | |
import Foundation | |
import StoreKit | |
protocol IAPServiceDelegate: class { |
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
// | |
// Created by Egzon Pllana on 5/15/20. | |
// Copyright © 2020 Native Coders. All rights reserved. | |
// | |
import UIKit | |
class HomeTableViewController: UITableViewController { | |
// MARK: - Outlets |
NewerOlder