Skip to content

Instantly share code, notes, and snippets.

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

Ramiz Raja informramiz

🏠
Working from home
View GitHub Profile
@informramiz
informramiz / CollectionDataSource.swift
Created December 11, 2019 16:37
A common data source for CollectionView with NSFetchedResultsControllerDelegate
//
// CollectionDataSource.swift
// VirtualTourist
//
// Created by Ramiz on 10/12/2019.
// Copyright © 2019 RR Inc. All rights reserved.
//
import Foundation
import CoreData
@informramiz
informramiz / ListDataSource.swift
Created December 7, 2019 15:02
A generic data source class for making UITableView with NSFetchedResultsController
//
// ListDataSource.swift
// Mooskine
//
// Created by Ramiz on 07/12/2019.
//
import Foundation
import CoreData
import UIKit
@informramiz
informramiz / flicker-photos-API-call.swift
Created September 5, 2019 06:52
Flicker photos API call
import Foundation
class AppClient {
struct Auth {
static var key = "YOUR_API_KEY"
}
enum Endpoint {
static let baseUrl = "https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=\(Auth.key)"
case base
@informramiz
informramiz / flicker-photos-json-parsing.swift
Created September 4, 2019 02:39
Flicker Photos json parsing
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
let flickerPhotos = """
{"photos":{
"page":1,
"pages":1,
"perpage":250,
"total":"36",
//
// MyUICollectionView.swift
// VirtualTourist
//
// Created by Apple on 10/12/2019.
// Copyright © 2019 RR Inc. All rights reserved.
//
import Foundation
import UIKit