Giter Site home page Giter Site logo

Lesson 002. Practice. about otus-ios-ozalexo HOT 1 OPEN

ozalexo avatar ozalexo commented on September 26, 2024
Lesson 002. Practice.

from otus-ios-ozalexo.

Comments (1)

ozalexo avatar ozalexo commented on September 26, 2024

Lesson 002: Preservation и Restoration техники, стек UINavigationController, Life cycles

Practice 001. Application life cycle (App Delegate)

  • Webinar timeframes 00:00:00 – 00:27:50
  • Self test: added "Exit" button.
  • GitHub branch

Practice 002. UIViewController lifecycle

Practice 003. ViewControllerLifeCycleBehavior

Practice 004. UIResponder and Responder chain

Practice 005. UINavigation stack

QA


❔ How to use willFinishLaunchingWithOptions? I don't want just copy-paste it from lessons's example. Need to dig it out.

❕ Type func willFinishLaunchingWithOption and wait for XCode autocompletition


❔XCode 11 beta. New "Single View App" project (with Swift UI checkbox) generates two files AppDelegate.swift and SceneDelegate.swift. Need to understand how it works (in parallel or step-by-step, depneds on ios version or not etc.)

❕First of all, AppDelegate's methods willFinishLaunchingWithOption and
didFinishLaunchingWithOptions, then sceneWIllEnterForeground etc.


❓How to use method hitTest to get info which TextField was touched? Did not found appropriate info. Also I need more info about drag and drop.

❗️


❓Why segues push and modal marked as deprecated in XCode11?

❗️


❓How to implement return back to two screens?

❗️


presentViewController etc: where to read about it?

❗️


❓implemented pop with reomve from stack:
Title of 'Back' button is a title of previous screen. On display next controller I can see how title changin from VC2 to VC1. How to prevent this behaviour and replace title before it will be shown?

❗️


let newControllers = controllers.filter { !($0 is VC2ViewController) }
What is $0 in this line?

❕This is each item of iterable type (Array, for example). See also: https://habr.com/ru/post/440722/


Notes

Practice 004

  • UIResponder is superclass for UIWindow, UIApplication, UIView and UIViewController
  • UIResponder handles all UI events: touch, scroll, swipe, keyboard input etc.
  • UIResponder chain is like bubbling in browsers: View -> ViewController -> Window -> Application
  • Common example of UIResponder: UITextField input
    1. UITextField.becomeFirstReponder calls automatically on tap on UIText
    2. If we need to switch to a next Text field:
      UITextFirst.resignFirstReponder() UITextSecond.becomeFirtsResponder()
    3. Actually we do not need to call resignFirstReponder, it is enough to call becomeFirtsResponder (will be resigned automatically)
  • Check that UITextField is firstResponder: textFieldOne.isFirstResponder
  • Any UIKit event handle by:
    • func touchesBegan()
    • func touchesMoved()
    • func touchesEnded()
    • func touchesCancelled()

from otus-ios-ozalexo.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.