Skip to content

Instantly share code, notes, and snippets.

View mayooresan's full-sized avatar
💜
In love with JS stack.

Jay Mayu mayooresan

💜
In love with JS stack.
View GitHub Profile
//new navigation code for apple navigation
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(self.m_lattitutef,self.m_longitutef);
NSLog(@"%f - %f", self.m_longitutef, self.m_lattitutef);
MKPlacemark *place = [[MKPlacemark alloc]
initWithCoordinate:coords addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
//current location
MKMapItem *mapItem2 = [MKMapItem mapItemForCurrentLocation];
@mayooresan
mayooresan / gist:01747a21d1582029adf1
Last active January 11, 2017 08:17
Laravel 5.2 - Jay's notes

Laraval Commands

php artisan - common comands
php artisan tinker - playground

Create a controller :

php artisan make:controller ArticlesController
@mayooresan
mayooresan / Swift 3 - Appdelegate NavigationBar Customisation
Last active October 17, 2016 08:36
This is a sample that can be reused to change the font / colours / tint of your navigation bar.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// Override point for customization after application launch.
UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent
let navigationController : UINavigationController = self.window?.rootViewController as! UINavigationController
// Change the navigation bar background color to blue.
navigationController.navigationBar.barTintColor = UIColor(red: 243/255, green: 129/255, blue: 37/255, alpha: 0)

Generic UI Stuff

Creating and adding multiple bar buttons to navigation bar

let addBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(ViewController.addPerson(_:)))
let filterBarButtonItem = UIBarButtonItem(title: "Filter", style: .plain, target: self, action: #selector(ViewController.filter))

navigationItem.rightBarButtonItems = [addBarButtonItem, filterBarButtonItem]

creating a actionsheet style alert controller without using third party apps

protocol Animal{
func run()
func stop()
}
class Cat{
}
class Cat : Animal{
}
class Cat : Animal{
func run() {
print("Cat is running now")
}
func stop() {
print("Cat has stopped now")
}
}
class Dog : Animal{
func run() {
print("Dog is running now")
}
func stop() {
print("Dog has stopped now")
}
}
protocol Animal{
func run()
func stop()
}
protocol Eye{
func closeEyesAndSleep()
func openEyesAndLookAround()
}