Skip to content

Instantly share code, notes, and snippets.

//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
class GradientCircle: UIView, CAAnimationDelegate {
let gradientLayer: CAGradientLayer = CAGradientLayer()
var startAngle: CGFloat = (-(.pi) / 2)
var endAngle: CGFloat = 3 * ((.pi) / 2)
override func draw(_ rect: CGRect) {
let center = CGPoint(x: rect.midX, y: rect.midY)
@azuredark
azuredark / QueryParms.swift
Created June 16, 2023 06:52 — forked from bhoopendraUmrao/QueryParms.swift
Get query parameters from URL in dictionary form.
func getQueryItems(_ urlString: String) -> [String : String] {
var queryItems: [String : String] = [:]
let components: NSURLComponents? = getURLComonents(urlString)
for item in components?.queryItems ?? [] {
queryItems[item.name] = item.value?.removingPercentEncoding
}
return queryItems
}
func getURLComonents(_ urlString: String?) -> NSURLComponents? {
@azuredark
azuredark / QueryParms.swift
Created June 16, 2023 06:52 — forked from bhoopendraUmrao/QueryParms.swift
Get query parameters from URL in dictionary form.
func getQueryItems(_ urlString: String) -> [String : String] {
var queryItems: [String : String] = [:]
let components: NSURLComponents? = getURLComonents(urlString)
for item in components?.queryItems ?? [] {
queryItems[item.name] = item.value?.removingPercentEncoding
}
return queryItems
}
func getURLComonents(_ urlString: String?) -> NSURLComponents? {
@azuredark
azuredark / CollectionViewCellAutomaticsizeLeftAlign.swift
Created June 7, 2023 04:58 — forked from fomagran/CollectionViewCellAutomaticsizeLeftAlign.swift
컬렉션뷰셀 자동 크기 조정 및 왼쪽 정렬
import UIKit
class ViewController: UIViewController {
let letters = ["안녕","안녕하세요","안녕하세요 저는 포마입니다.","안녕하세요 만나서 정말 반갑습니다."]
@IBOutlet weak var collection: UICollectionView!
override func viewDidLoad() {
configure()
//
// TestimonyCollectionViewController.swift
// EMtrade
//
// Created by Fachruzi Ramadhan on 02/09/20.
// Copyright © 2020 Fachruzi Ramadhan. All rights reserved.
//
import UIKit
//
// TestimonyCollectionViewController.swift
// EMtrade
//
// Created by Fachruzi Ramadhan on 02/09/20.
// Copyright © 2020 Fachruzi Ramadhan. All rights reserved.
//
import UIKit
@azuredark
azuredark / twotableviewsInOneView.swift
Created June 5, 2023 08:47 — forked from mchirico/twotableviewsInOneView.swift
Creating multiple tableViews in one ViewController...this just starts out as a view controller
//
// ViewController.swift
// Delete
//
// Created by Mike Chirico on 10/21/15.
// Copyright © 2015 Mike Chirico. All rights reserved.
//
import UIKit
@azuredark
azuredark / UIViewRoundCorners1.swift
Created June 5, 2023 03:53 — forked from swieeft/UIViewRoundCorners1.swift
[iOS] UIView 특정 모서리만 둥글게 만들기(Round Corners)
class ViewController: UIViewController {
@IBOutlet weak var cornerView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
cornerView.clipsToBounds = true
cornerView.layer.cornerRadius = 50
cornerView.layer.maskedCorners = CACornerMask(arrayLiteral: .layerMinXMinYCorner, .layerMaxXMinYCorner)
class LocationDataSource: NSObject, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
{
let locations: [LocationModel];
let setSelectedLocation: SetLocationDelegate;
init(locations: [LocationModel], delegate: @escaping SetLocationDelegate)
{
self.locations = locations;
self.setSelectedLocation = delegate;
}