Thursday, January 14, 2021

How to disable a modal from swiping down to close

let vc = DetailViewController() vc.isModalInPresentation = true present(vc, animated: true)

Wednesday, January 13, 2021

adding borders

 extension UIView {

    func addTopBorderWithColor(color: UIColor, width: CGFloat) {

        let border = CALayer()

        border.backgroundColor = color.cgColor

        border.frame = CGRect(x:0,y: 0, width:self.frame.size.width, height:width)

        self.layer.addSublayer(border)

    }


    func addRightBorderWithColor(color: UIColor, width: CGFloat) {

        let border = CALayer()

        border.backgroundColor = color.cgColor

        border.frame = CGRect(x: self.frame.size.width - width,y: 0, width:width, height:self.frame.size.height)

        self.layer.addSublayer(border)

    }


    func addBottomBorderWithColor(color: UIColor, width: CGFloat) {

        let border = CALayer()

        border.backgroundColor = color.cgColor

        border.frame = CGRect(x:0, y:self.frame.size.height - width, width:self.frame.size.width, height:width)

        self.layer.addSublayer(border)

    }


    func addLeftBorderWithColor(color: UIColor, width: CGFloat) {

        let border = CALayer()

        border.backgroundColor = color.cgColor

        border.frame = CGRect(x:0, y:0, width:width, height:self.frame.size.height)

        self.layer.addSublayer(border)

    }


    func addMiddleBorderWithColor(color: UIColor, width: CGFloat) {

        let border = CALayer()

        border.backgroundColor = color.cgColor

        border.frame = CGRect(x:self.frame.size.width/2, y:0, width:width, height:self.frame.size.height)

        self.layer.addSublayer(border)

    }

}


Thursday, January 7, 2021

How to generate a app size report

xcodebuild -exportArchive -archivePath iOSApp.xcarchive -exportPath Release/MyApp -exportOptionsPlist OptionsPlist.plist