Skip to content

Instantly share code, notes, and snippets.

View erdemildiz's full-sized avatar
🏠
Working from home

Erdem ILDIZ erdemildiz

🏠
Working from home
View GitHub Profile
@erdemildiz
erdemildiz / URLSession POST.swift
Last active September 26, 2020 16:11 — forked from dmathewwws/URLSession POST.swift
URLSession POST request example
private static func createUserEventData(user:SKUser, eventType:SKEventType, sticker:Sticker?) {
// server endpoint
let endpoint = "https://app.stickerkit.io/userEvent/v1/\(user.projectID)"
guard let endpointUrl = URL(string: endpoint) else {
return nil
}
//Make JSON to send to send to server
@erdemildiz
erdemildiz / String+subscript.swift
Last active September 26, 2020 16:12 — forked from foxicode/String+subscript.swift
Swift String subscript extension
#https://medium.com/better-programming/24-swift-extensions-for-cleaner-code-41e250c9c4c3
import Foundation
extension String {
subscript (i: Int) -> Character {
return self[index(startIndex, offsetBy: i)]
}
subscript (bounds: CountableRange<Int>) -> Substring {
@erdemildiz
erdemildiz / duplicate_line_xcode.md
Last active September 26, 2020 16:15 — forked from emotality/duplicate_line_xcode.md
Xcode - Duplicate Line key binding

Xcode line duplicate

Bind keys to duplicate lines in Xcode

  1. Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
@erdemildiz
erdemildiz / LocalStorage.swift
Created December 7, 2018 20:33 — forked from KalpeshTalkar/LocalStorage.swift
LocalStorage is an abstraction over the UserDefaults. The class is written in Swift 3
// Copyright © 2017 Kalpesh Talkar. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,