Category: Swift

  • iOS — Play RTSP Streaming

    iOS — Play RTSP Streaming

    Hướng dẫn sử dụng IJK Player để play RTSP streaming. IJK Player là lib được phát triển dựa trên thư viện ffmpeg

  • Khởi tạo (Initialization) trong Swift

    Khởi tạo (Initialization) trong Swift

    Việc khởi tạo trong bất cứ ngôn ngữ lập trình nào đều rất rất quan trọng, trong một project thì bạn sẽ liên tục phải thực hiện khởi tạo các instance của các struct, class hoặc enum. Việc hiểu rõ và sử dụng thành thạo quá trình khởi tạo trong swift sẽ giúp bạn tăng […]

  • Fresher Training—iOS Basic Day 2

    Fresher Training—iOS Basic Day 2

    Today topic: App Life cycle View Controller Life cycle UIView Exerices: Exercise 01: App Life Cycle Hãy phân tích những delegate sẽ được gọi trong những trường hợp sau: Khi user quit app từ fast app switcher (multi task) Khi app bị crash do source code Khi app bị suspended Khi user mở app khác […]

  • Fresher Training—iOS Swift Day 4

    Fresher Training—iOS Swift Day 4

    Today topic: Encoding & Decoding Types Asynchronous Closures & Memory Management Value Types & Value Semantics Protocol-Oriented Programming Tham khảo: https://nhathm.com/swift-closure-escaping-autoclosure-b6cc22729e7 Exercises: Exercise 01: ENCODING & DECODING Make this source code Codeable struct Student { var name: String var age: Int var study: [StudyClass] } struct StudyClass { var className: String var classCode: String } […]

  • Fresher Training—iOS Swift Day 3

    Fresher Training—iOS Swift Day 3

    Today topic: Access Control & Code Organization Custom Operators, Subscripts & Keypaths Pattern Matching Error Handling Thao khảo: Swift—Advanced control flow Exercises: Exercise 01: SINGLETON A singleton is a design pattern that restricts the instantiation of a class to one object. Use access modifiers to create a singleton class Logger. This Logger should: Provide shared, […]

  • Swift—Advanced control flow

    Swift—Advanced control flow

    Bài viết này giới thiếu cái khái niệm và các dùng về control flow trong Swift: For loop Countable ranges countable closed range: 0…5 countable half-open range: let halfOpenRange = 0..<5 For in với where condition Swift hỗ trợ for in where để lọc ra các điều kiện phù hợp trong tập cho trước: var […]

  • Fresher Training—iOS Swift Day 2

    Fresher Training—iOS Swift Day 2

    Today topic: Properties Methods Advanced Classes Enumerations Protocols Generics Exercises: Exercise 01: PROPERTY Show me an example about a struct have property is another struct What is type property, example by source code 1 and 1 point Exercise 02: Methods Define struct Coordinate with property have latitude and longitude. Write a method to get/set for […]

  • Fresher Training—iOS Swift Day 1

    Fresher Training—iOS Swift Day 1

    Today topic: Expressions, Variables & Constants Types & Operations Control Flow Functions Optionals Arrays, Dictionaries & Sets Collection Iteration with Closures Strings Structures Classes Exerices: Exercise 01: Expressions, Variables & Constants Declare four constants named x1, y1, x2 and y2 of type Double. These constants represent the 2-dimensional coordinates of two points. Calculate the distance […]

  • Swift—Closure

    Swift—Closure

    Khi mới làm quen với Swift, đôi khi ta gặp phải những đoạn code như dưới: Tuy nhiên ta không hiểu chúng là gì, và dùng như nào. Trong Swift, những đoạn code kiểu như trên được gọi là Closure, bài Note này sẽ đi sâu vào bới móc xem Closure là gì ;)) Trong Swift […]

  • Swift —Giới thiệu sơ lược

    Swift —Giới thiệu sơ lược

    Swift là gì?Swift là ngôn ngữ lập trình được phát triển bởi Apple, do Chris Lattner làm trưởng nhóm thiết kế. Lần đầu tiên được giới thiệu công khai là vào WWDC năm 2014 của Apple. Năm 2015, Swift chính thức trở thành open source và từ đó luôn phát triển mạnh mẽ với những đóng góp […]