Skip to content

Instantly share code, notes, and snippets.

💜
Working from anywhere

Yusuf Özgül yusufozgul

💜
Working from anywhere
Block or report user

Report or block yusufozgul

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DatasetDownloader.js
// for: https://medium.com/@ozgurs/hızlı-şekilde-resim-dataseti-oluşturma-cfccf4a40c79
urls=Array.from(document.querySelectorAll(".rg_i")).map(el=> el.hasAttribute("data-src")?el.getAttribute("data-src"):el.getAttribute("data-iurl"));
window.open("data:text/csv;charset=utf-8," + escape(urls.join("\n")));
View CodableDetailedDebugging.swift
import UIKit
var jsonString: String = """
{
"link": "https://yusufozgul.com",
"data": [
{ "type": "comments", "content": "Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir." },
{ "type": "comments", "content": "Lorem Ipsum, adı bilinmeyen bir matbaacının bir hurufat numune kitabı oluşturmak üzere bir yazı galerisini alarak karıştırdığı 1500'lerden beri endüstri standardı sahte metinler olarak kullanılmıştır." }
]
}
@yusufozgul
yusufozgul / willPerformPreviewActionForMenuWith.swift
Last active Mar 18, 2020
willPerformPreviewActionForMenuWith.swift
View willPerformPreviewActionForMenuWith.swift
func tableView(_ tableView: UITableView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
guard let destinationViewController = animator.previewViewController else { return }
animator.addAnimations { self.present(destinationViewController, animated: true) }
}
View DetailVC.Swift
import UIKit
class DetailViewController: UIViewController
{
var selectedText: String?
override func viewDidLoad() {
super.viewDidLoad()
let label = UILabel()
label.text = "Selected Row: \(selectedText ?? "NO TEXT")"
View contextMenuConfigurationForRowAt.Swift
func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
let config = UIContextMenuConfiguration(identifier: "\(indexPath.row)" as NSCopying, previewProvider: {
return DetailViewController(selectedText: self.array[indexPath.row])
}) { action in
let viewMenu = UIAction(title: "Go Detail VC", image: UIImage(systemName: "eye.fill"), identifier: UIAction.Identifier(rawValue: "view")) {_ in
self.present(DetailViewController(selectedText: "\(indexPath.row)"), animated: true)
}
let deleteMenu = UIAction(title: "Delete", image: UIImage(systemName: "trash.fill"), identifier: nil) { (action) in
@yusufozgul
yusufozgul / Alert,ActionSheet-SwiftUI.swift
Last active Aug 5, 2019
SwiftUI Alert & Action Sheet
View Alert,ActionSheet-SwiftUI.swift
struct ContentView: View
{
@State var isShowAlert = false
@State var isShowActionSheet = false
var body: some View
{
VStack
{
View PresentationLink.swift
View ListRowPresent.swift
struct ThridViewRow : View {
var city: String
var body: some View {
Text(city)
}
}
struct ThirdView : View
{
var listElement = ["Antalya", "İzmir", "İstanbul", "Ankara", "Muğla", "Çanakkale", "Bursa", "Adana"]
View NavigationLink.Swift
View Calculator-SwiftUI-2.swift
var buttonsText = ["AC", "±", "%", "÷",
"7", "8", "9", "x",
"4", "5", "6", "-",
"1", "2", "3", "+",
"0", "00", ".", "="]
@State var screenValue = "0"
var calculator = Calculator()
var body: some View {
VStack { // Vertical Stack İçerisindeki elemanları yatay olarak alt alta ekler
You can’t perform that action at this time.