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
// | |
// ViewController2.swift | |
// Test | |
// | |
// Created by Milan on 30/11/23. | |
// | |
import UIKit | |
class ViewController2: UIViewController { |
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
@IBOutlet weak var collectionViewLicenseCategories: UICollectionView! | |
//MARK: Constant | |
let HARIZONTAL_SPCE_IMAGE: CGFloat = 12 | |
let VERTICAL_SPCE_IMAGE: CGFloat = 16 | |
let COLUMN_IMAGE: CGFloat = 4 | |
//MARK: CollectionViewDelegate Method | |
extension SelectLicenseCategoriesView: UICollectionViewDelegate, UICollectionViewDataSource { | |
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { |
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
// | |
// RushFloatingLableTextField.swift | |
// https://github.com/mrushdi24/RushFloatingLableTextField | |
import UIKit | |
enum TextFieldType{ | |
case normal | |
case email | |
} |
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
// AppDelegate.swift | |
var allowLandscape = false | |
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { | |
if allowLandscape == true { | |
return UIInterfaceOrientationMask.all | |
} | |
return UIInterfaceOrientationMask.portrait | |
} |
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 mergeTwoImages()-> UIImage? { | |
let topImage = UIImage(named: "Image1")! | |
let bottomImage = UIImage(named: "Image2")! | |
let size = CGSize(width: topImage.size.width + bottomImage.size.width, height: topImage.size.height) | |
UIGraphicsBeginImageContextWithOptions(size, false, 0.0) | |
topImage.draw(in: CGRect(x: 0, y: 0, width: topImage.size.width, height: size.height)) | |
bottomImage.draw(in: CGRect(x: topImage.size.width + 10, y: 0, width: bottomImage.size.width, height: size.height)) |
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 addSubViewWithAutolayoutSuperView(subView: UIView) { | |
self.addSubview(subView) | |
subView.translatesAutoresizingMaskIntoConstraints = false | |
subView.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true | |
subView.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true | |
subView.topAnchor.constraint(equalTo: self.topAnchor).isActive = true | |
subView.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true | |
subView.layoutIfNeeded() | |
self.layoutIfNeeded() | |
} |
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 func loadNib <T: UIView>() -> T { | |
return Bundle.main.loadNibNamed(String(describing: T.self), owner: nil, options: nil)![0] as! T | |
} | |
class func fromNib(named: String? = nil) -> Self { | |
let name = named ?? "\(Self.self)" | |
guard | |
let nib = Bundle.main.loadNibNamed(name, owner: nil, options: nil) | |
else { fatalError("missing expected nib named: \(name)") } | |
guard |
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
typealias ComplicationHandler = ([String:Any]) -> Void | |
var Complication : ComplicationHandler? | |
let dict = ["id":id,"name":name] | |
guard let ComplicationBlock = Complication else { | |
return | |
} | |
ComplicationBlock(dict) | |
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
//MARK:- IBOutlets | |
//MARK:- Properties | |
//MARK:- LifeCycles | |
//MARK:- Functions | |
//MARK:- IBActions | |
private func setupTagsCollctionView() { |
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
import Foundation | |
import UIKit | |
//https://stackoverflow.com/questions/37370801/how-to-add-a-container-view-programmatically | |
class ViewEmbedder { | |
class func embed( | |
parent:UIViewController, | |
container:UIView, | |
child:UIViewController, | |
previous:UIViewController?){ |
NewerOlder