Skip to content

Instantly share code, notes, and snippets.

View eliakorkmaz's full-sized avatar
🎯
Focusing

Emrah Korkmaz eliakorkmaz

🎯
Focusing
View GitHub Profile
@eliakorkmaz
eliakorkmaz / how-to-create-a-cocoa-pod
Created November 22, 2022 09:28 — forked from ccabanero/how-to-create-a-cocoa-pod
How to Create a Cocoa Pod
Notes for Creating a Cocoa Pod
Pod Version: 0.39.0
OS: OS X El Capitain (10.11.3)
- - - - - - - - - - - - - - - - - - - - - - -
1. Install CocoaPods (https://guides.cocoapods.org/using/getting-started.html)
2. Create Xcode project to author the Pod
@eliakorkmaz
eliakorkmaz / ios-cell-registration-swift.md
Created December 28, 2020 21:37 — forked from gonzalezreal/ios-cell-registration-swift.md
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)
@eliakorkmaz
eliakorkmaz / saveImage.swift
Created May 30, 2020 10:12 — forked from KrisYu/saveImage.swift
Save image to file on macOS using swift, answers found from SO
// plain write to image
@discardableResult func writeCGImage(_ image: CGImage, to destinationURL: URL) -> Bool {
guard let destination = CGImageDestinationCreateWithURL(destinationURL as CFURL, kUTTypePNG, 1, nil) else { return false }
CGImageDestinationAddImage(destination, image, nil)
return CGImageDestinationFinalize(destination)
}
// There's a panel, save image png
@eliakorkmaz
eliakorkmaz / curl.md
Created October 24, 2018 13:42 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.