Skip to content

Instantly share code, notes, and snippets.

View kmav's full-sized avatar

Konstantinos Mavroudakis kmav

View GitHub Profile
@kmav
kmav / generics.swift
Created March 18, 2019 07:20
Swift: Generics with custom type passing and definition
import UIKit
class BaseClass {
let name = "BaseClass"
var key = 0
required init() {
key = 100
}
}
@kmav
kmav / AppDelegate.m
Last active March 26, 2023 20:17
iOS programmatically add UITabBarController with UINavigationController instances as tabs using Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
FeedTableViewController *feedTableViewController = [[FeedTableViewController alloc] initWithStyle:UITableViewStyleGrouped];
UINavigationController *feedNavController = [[UINavigationController alloc] initWithRootViewController:feedTableViewController];
ProfileViewController *profileController = [[ProfileViewController alloc] init];
UINavigationController *profileNavController = [[UINavigationController alloc] initWithRootViewController:profileController];
FavoritesViewController *favController = [[FavoritesViewController alloc] init];
UINavigationController *favNavController = [[UINavigationController alloc] initWithRootViewController:favController];
@kmav
kmav / gist:d6c4826d042074a14ef36e9755275c74
Created December 31, 2016 20:42 — forked from floriankugler/gist:6870499
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N
@kmav
kmav / Main.java
Created May 24, 2013 05:42
Main.java
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello GitHub");
}