Swift Language Flashcards
Internationalization
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.
Autoresizing Masks
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.
Auto Layout
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.
Bounds
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.
Draw(_ : )
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?
setToolbarHidden(_ : animated: )
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
navigationControllerSupportedIntrrfaceOrientations(_:)
Returns the complete set of supported interface orientations for the navigation controller , as determined by the delegate.
Optional func navigationControllerSupportedIntrrfaceOrientations(_ navigationController: UINavigationController) -> UIInterfaceOrientatinoMask
Linked Lists Definition 1
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.
Linked List Definition 2
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
Core Motion
Receive and handle accelerometer events and other motion events.
Custom App URL Schemes
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.
OAuth
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
HTTP vs HTTPS
HTTP send the data in plain text without any encryption.
HTTPs does the encryption over the wire
OAuth Workflow
Call Back URL
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.
Most Common HTTP Methods
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