Swift Language Flashcards

1
Q

Internationalization

A

It is the process of making your app able to adapt to different languages, regions and cultures. In our case adapting multiple screens and platforms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Autoresizing Masks

A

Automating the response to external UI. It programmatically controls frames. If the user changes the font size while your app is running, both the fonts and the layout must adapt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Auto Layout

A

It’s better than Autoresizing masks. Instead of the view’s frame, you think about its relationships. It uses constraints. This produces layouts that dynamically respond to both internal and external changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Bounds

A

The bounds rectangle describes the view’s location and size in its own coordinate system.

var bounds: CGRect { get set }

In default, it’s set to (0,0) of the view but you can change the value to display a different portion of the view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Draw(_ : )

A

Draw’s the receiver’s image within the passed-in rectangle.

func draw(_ text: CGRect)

You can get a reference to the graphics context using the UIGraphicGetCurrentContext() -> CGContrxt?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

setToolbarHidden(_ : animated: )

A

Changes the visibility of the navigation controller’s built-in toolbar.

func setToolbarHidden( _ hidden: Bool, animated: Bool)

True: hide the toolbar
False: show the toolbar

True: toolbar animated when screen is on or off

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

navigationControllerSupportedIntrrfaceOrientations(_:)

A

Returns the complete set of supported interface orientations for the navigation controller , as determined by the delegate.

Optional func navigationControllerSupportedIntrrfaceOrientations(_ navigationController: UINavigationController) -> UIInterfaceOrientatinoMask

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Linked Lists Definition 1

A

A fundamental programming concept, linked lists provide the foundation for many algorithms and data structures. Available in print, ePub or pdf format this unique essay introduces linked lists with Swift.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Linked List Definition 2

A

Linear Collection of data Elements, every data item represent a node.

There are two types of Linked Lists : -

  • Singly: Points to optional next-node
  • Doubly: represent two pointers to next and previous
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Core Motion

A

Receive and handle accelerometer events and other motion events.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Custom App URL Schemes

A

URL Schemes, every device can have a specific URL scheme. ‘http://’ hopping from a web device into the application

Add key value pair to info.plist

after we redirect a url to our app, we use OAuth (Token or Flag)

App delegate take care of things before we get directed to the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

OAuth

A

It is an authorization Protocol - set of rules that a allows a third - party website or application to access user’s data without the user needing to share login credentials

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

HTTP vs HTTPS

A

HTTP send the data in plain text without any encryption.

HTTPs does the encryption over the wire

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

OAuth Workflow

Call Back URL

A

1- User make an action from the app to the service
2- The app redirects the user to the service provider for authentication
3- User gives their permission for the service to use their timeline (eg. accessing their twitter photos)
4- Service provider returns the user to the consumer app with a code
5- Consumer sends the temp code with a secret key to the service provider in exchange for an authentication token.
6- The user performs actions and we pass the authentication token with each call to prove who they are.

Once the browser redirects us to the app, the app should handle the information passed in and ask the server for a token.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Most Common HTTP Methods

A

GET - retrieve resource at the url
POST - request that the sever accept data enclosed in the request. Creating a new record like posting a tweet
GELETE - delete a resource
PUT - updating a preexisting record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Domain - The physical server where the website is hosted
URI - The identifier which maps the files on your server
Query String - Part of a GET request to easily pass in values to customize the outputs

A

www.luay.com //the domain

/whatever-in-the-url? // the question mark is the end of the url and everything that follows are key value pairs that are related to the query as the following:
/key:value&key:value

17
Q

API - Application Programming Interface

A

All the applications we have now a days are Front Ends for a Web API.

Web APIs, what you will be working with, are defined as a set of HTTP requests and response messages usually in JSON or occasionally in XML

18
Q

REST

A

REST is an acronym for REpresentational State Transfer. It is not a protocol, it is just a architectural style

The server doesn’t care what app or device we are using to request the data. The only thing the server cares about is to know where to send the data back to the user.

19
Q

REST API

A

Cacheable - Responses must defines themselves as cacheable or not (The cache should be handled by the user/client though)

20
Q

Code On Demand (Cool feature!)

A

Simply an update that happens without hitting the app update on the app store. Like Instagram/snapchat filters that show up out of nowhere!

21
Q

URLSession

A

It’s highly Asynchronous unlike CIImage which was not Asynchronous.

The URLSession class and related classes provide an API for making HTTP requests

URLSession provides two ways of interacting with RESTful services… with completion handlers (closures) or delegation

All http requests made with URLSession are considered “Tasks”. A task must run on a session (URLSession class)

Three types of tasks: Data tasks - receive and send data using Data objects in memory. Upload tasks - send files w/ background support. Download tasks - download w/ background support

URLSession is initialized with a URLSessionConfiguration. URLSessionConfiguration has 3 types: Default session - disk based cache. Ephemeral session - no disk based caching, everything in memory only. Background session - similar to default, except a separate process handles all data transfers

Configurations have many properties for customization. For example you can set the maximum number of connections per host, timeout intervals, cellular access or wifi only, and http header fields
URLSession also has a sharedSession singleton available to use based on a default session

22
Q

AppDelegate

A

The AppDelegate in your app is a regular object that conforms to the UI Application Delegate Protocol

23
Q

UIApplication Delegate Protocol

A

Contains your apps startup code
Responds to changes in your app’s states (foreground to background, etc)
It responds to notifications originating from outside your app, like remote notifications, low memory warnings, download completions, etc
Can be used to store app’s central data objects or any content that does not have an owning view controller

24
Q

UIWindow is part of UIView

A

UIWindow is a class that manages and coordinates the views an app displays on the device screen.

Windows have 2 main jobs, provide area for displaying other views, and distribute events to the views.

UIWindow has a rootViewController property, which can be set to change the root view controller

25
Q

The UISearchBar class

A

The search bar provides a text field for text input, a search button, a bookmark button, and a cancel button

Relies on it’s delegate to perform searches when one of its buttons is pressed

Can be also embed into a tableview by dragging it into the tableview on storyboard

Just like UITableView, we conform to the UISearchBarDelegate protocol to implement the methods we want for handling user input.

searchBar(:textDidChange:)
searchBarSearchButtonClicked(
:)

26
Q

Closure Based Animations

A

Spring Animations

27
Q

presentSafariViewControllerWith

The in-app safari browser

A

1- import SafariServices

2- instant - FSafariViewController(url:URL)

3- self.present(safariController, animated: true, completion: nil)

28
Q

REGEX on IOS

A

To create regex we need an extension that uses Validate on our String