6 Text Navigation Shortcuts for Mac

6 Text Navigation Shortcuts
The first group of keyboard shortcuts allow for quickly moving around text:

  • Jump to beginning of a line– Command+Left Arrow
  • Jump to end of a line– Command+Right Arrow
  • Jump to beginning of current word– Option+Right Arrow
  • Jump to end of current word– Option+Right Arrow
  • Jump to beginning of all text– Command+Up Arrow
  • Jump to end of all text – Command+Down Arrow

 
By adding a shift key to the above shortcuts, we are given six new tricks that allow for quick text selection of lines, words, and entire documents.

Getting Started with CocoaPods

Installation

  1. make sure the ruby system is up to date
    1. $ sudo gem update --system
  2. install cocoapods
    1. $ sudo gem install cocoapods
    2. If you get an error message about fuzzy_match, try this command instead,
    3. $ sudo gem install -n /usr/local/bin cocoapods
  3. setup the pods
    1. $ pod setup

To Test / use cocoa pods

  1. Create a new single view project in Xcode
  2. Quit Xcode
  3. navigate to the folder of the new project in Terminal
  4. create a new podfile
    1. $ pod init
  5. This will create a file called “Podfile”
  6. Open the file for editing
  7. Un comment the platform line. (the second line)
  8. Make sure the use_frameworks! line is not commented out if you’re using swift
  9. after the first Pods for <project> line add a Pod file
  10. e.g. pod ‘Firebase/Core’
  11. run install command
    1. $ pod install
  12. not the output about using the new xcworkspace file instead of the old project file.

 
To Install FireBase

  1. Do all of the above
  2. Then go to the Firebase console and register your app
  3. Download the google plist file and add it to your project
  4. Open the application.swift file
  5. add the following line to the top of the file
    1. import Firebase
  6. in the didFinishLaunchingWithOptions method, add the following line
    1. FirebaseApp.configure()
  7. NOTE: You have to do step 3, otherwise you’ll get and error for the line you add at 6A

 
 

Connecting a second ViewContoller to another Swift file

  1. Make sure the swift file looks like the default ViewContoller.swift file
    i.e. import UIKit, inherits from UIViewController, have at least the viewDidLoad function
  2. Click on the yellow dot that represents the view controller in the story board
  3. Select the identify inspector page
  4. In the Class drop down at the top, you should be able to select the name of your new class
    NOTE: you may have to save and or compile you app to get the new class to appear on the list.

Detecting iPad or iPhone in swift

To detect if the user is using an iPad or iPhone or something else in Swift do something like this:

switch UIDevice.current.userInterfaceIdiom {
 case .phone:
 deviceLavel.text = "iPhone"
 case .pad:
 deviceLavel.text = "iPad"
 case .unspecified:
 deviceLavel.text = "unspecified"
 case .tv:
 deviceLavel.text = "tv"
 case .carPlay:
 deviceLavel.text = "carPlay"
 }

How to record an App Preview

1. Connect your iPhone or iPad to you Mac
2. Open Quick Time Player
3. From the File menu, Choose new Movie recording
4. Fromt the drop down next to the record button choose you iphone/ipad for video and microphone
5. Click record
6. Do steps
7. Click Stop
8. File | Save
9. Add name, click Save
10. Close quick time player
11. Open imovie
12. From the File menu, choose new app preview
you may have to go back to the projects screen first
13. If you get the app previews info screen click OK
14. Drag and drop your recording from steps 1-9 into the bottom half of the iMovies window
15. File | Share | App Preview 
Or use the share button in the top right corner and choose app preview
16. Type a new title if required and click next
17. Type name if required, click save
18. Wait for iMovie to process
19. Click Close
20. Exit iMovie