Posting a Notification First, create a global key before the class definition of the class that is posting the notification Post the notification
Category: tutorials
Add a UITableView to an Existing ViewController in Xcode
Quick and dirty checklist for adding a table view to an existing view controller: Embed existing view controller in a NavigationController Drag a UITableView object into the view controller in the storyboard Make the UITableView the same width and height as the view controller and set the constraints to all four sides with no margins… Continue reading Add a UITableView to an Existing ViewController in Xcode
Setting Up Delegates in iOS
This is copied from the iOS Apprentice tutorial on raywenderlich.com but I wanted to put it where I could easily access it. These are the basic steps for setting up a delegate pattern between two objects, where object A is the delegate for object B, and object B will send messages back to A. Define a delegate protocol for… Continue reading Setting Up Delegates in iOS
Create keyboard shortcut to toggle Document Outline in Xcode
In Xcode, open Preferences and go to the “Key Bindings” section. Type “outline” in the search filter box. Select “Show Document Outline” and double-click to the right, in the “Key” column. A text box should appear and you can type in your new shortcut. I used Cmd+9.
Adding Soft Deletes to Existing Database Table in Laravel
First, enable soft deletes in your model. I’ll use the users table as an example.
Installing the Html and Form Builder package back into Laravel 5
Here’s how to get the Form and Html Builder package back when using Laravel 5. composer require illuminate/html Then, in /config/app.php add the following to the providers and aliases arrays: ‘providers’ => [ … ‘Illuminate\Html\HtmlServiceProvider’, ], ‘aliases’ => [ … ‘Form’=> ‘Illuminate\Html\FormFacade’, ‘HTML’=> ‘Illuminate\Html\HtmlFacade’, ],
Using Laravel 5 Auth Middleware
To restrict pages in your app to authentication status, add the middleware to the controller’s constructor. To restrict a page to guests only (not signed in): public function __construct() { $this->middleware(‘guest’); } For signed in users: public function __construct() { $this->middleware(‘auth’); } If you want to make exceptions for certain methods, just pass those parameters… Continue reading Using Laravel 5 Auth Middleware
Set up Elixir with Laravel 5
First, make sure you have gulp installed. npm install –global gulp Then run npm install in order to install Elixir.
Setting Up a Virtual Host on WAMP
One of the biggest pains about developing on a local server setup like WAMP is that the root filepaths are different when you go live. To get around this I always set up a virtual host so that my development url can be something like, http://myapplication.dev/. Here’s how to do it on Wampserver 2.5. This… Continue reading Setting Up a Virtual Host on WAMP
Laravel Project Setup
First, get composer if you don’t already have it (Windows): https://getcomposer.org/Composer-Setup.exe I like to use the composer installer (as opposed to the Laravel Installer). Open command prompt and move into www directory (or wherever you want your project to live). composer create-project laravel/laravel name-of-project This will create the directory “name-of-project” and place all the laravel… Continue reading Laravel Project Setup