All about emum in swift

Enum or Enumerations are a special data types that enable us to group related types together and use them in a type-safe manner. enum in swift is not limited to an integer value as they are in another language, such as C or Java. enum in swift can have a string, character, integer, floating-point and much more type and define its actual value (raw value)

Continue reading

Capture a Screen Shot with Mac OS X

  1. To capture the entire desktop, press Command-Shift-3. The screen shot will be automatically saved as a PNG file on your desktop.
  2. To copy the entire desktop, press Command-Control-Shift-3. The screen shot will be placed on your clipboard for you to paste into another program.
  3. To capture a portion of the desktop, press Command-Shift-4. A cross-hair cursor will appear and you can click and drag to select the area you wish to capture. When you release the mouse button, the screen shot will be automatically saved as a PNG file on your desktop. (The file is saved as PDF in Mac OS 10.3 and earlier.)

Continue reading

Simulate Bad Network Connection in iOS Device and Simulator

While developing an app that requires an internet connection, it is very important to handle use-cases when the connection is slow or non-existent. To figure out when there’s a bad connection via your code, you can use this great Reachability library.

Once Reachability is implement it, it’s pretty easy to test it by simulating a bad connection on your iPhone or iPhone Simulator if you know what tools to use. Here is how you can test a your app on different internet connections using your iPhone and iPhone Simulator:

 

Continue reading

Getting Started with SQLite3

SQLite is a C library that implements an SQL database engine. It is a Relational Database Management System (or RDBMS). Most of the SQL databases work with the client/server model. Take MySQL for an example. To enter and receive data from a MySQL database you need to send a request to the MySQL server, which on reception will provide you with the appropriate response. Contrary to MySQL, SQLite databases are operated directly from the disk. There is no need to create requests to the server.

Continue reading

Useful Mac Terminal Command

Combine pdf file into one


/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py” -o “/Users/user name/Desktop/Merged PDF.pdf” “/Users/user name/Desktop/My folder/PDF 1.pdf” “/Users/user name/Desktop/My folder/PDF 2.pdf