Skip to content

Instantly share code, notes, and snippets.

View surjeet-probo's full-sized avatar

Surjeet Singh Rajput surjeet-probo

View GitHub Profile
@luthviar
luthviar / BottomSheetPeopleDetectedInputView+SwiftUI+UIKit.swift
Created August 12, 2024 03:26
Create a Bottom Sheet SwiftUI View and present from UIKit UIViewController
class ViewController: UIViewController, BottomSheetPeopleDetectedInputDelegate {
private var overlayView: UIView?
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
let showButton = UIButton(type: .system)
showButton.setTitle("Show Bottom Sheet", for: .normal)
showButton.addTarget(self, action: #selector(showBottomSheet), for: .touchUpInside)
@huynguyencong
huynguyencong / #BuildiOSWithGitHubAction.md
Last active March 16, 2025 00:45
Script to build iOS and deploy it to TestFlight using GitHub action

When merging code to build/test-flight branch, it is built and uploaded to TestFlight automatically by GitHub Action.

Set up/update the following secrets:

  • CERTIFICATES_FILE_BASE64: Base64 of the App Store distribution certificate.
  • CERTIFICATES_PASSWORD: App Store distribution certificate password.
  • APPSTORE_ISSUER_ID: App Store Connect API key's issuer ID.
  • APPSTORE_KEY_ID: App Store Connect API key's key ID.
  • APPSTORE_PRIVATE_KEY: App Store Connect API key's private key (raw p8 file).
@globulus
globulus / SwiftUIFreeformDrawing.swift
Created June 29, 2021 15:27
SwiftUI freeform drawing
struct DrawingPath {
private var points = [CGPoint]()
private var breaks = [Int]()
mutating func addPoint(_ point: CGPoint) {
points.append(point)
}
mutating func addBreak() {
breaks.append(points.count)
@patriknyblad
patriknyblad / xcrun_simctl_cheatsheet.md
Last active June 6, 2025 12:56
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@hcn1519
hcn1519 / GradientLayer.md
Last active February 8, 2025 21:59
UITableViewCell with GradientLayer in swift

Create GradientLayer on your tableViewCell(collectionViewCell)

1. Create CAGradientLayer Instance on your tableViewCell

class MyCell: UITableViewCell {
    let gradientLayer = CAGradientLayer()
}
@mwaterfall
mwaterfall / StringExtensionHTML.swift
Last active April 17, 2025 13:04
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",