Parsing and working with Codable in Swift 4

Parsing and working with Codable in Swift 4  
 
The JSON format has become very popular, it is usually used to transfer data and execute queries in client-server applications. JSON parsing requires encoding /decoding tools of this format, and Apple recently upgraded them. In this article, we'll look at JSON parsing methods using the protocol. Decodable , let's compare the new protocol Codable with the predecessor NSCoding , we will evaluate the advantages and disadvantages, we will analyze everything with concrete examples, and also consider some features that are encountered in the implementation of protocols.
 
 
 
What is ...
+ 0 -

Getting deleted data in iOS. Swift 3 version

Getting deleted data in iOS. Swift 3 versionThis article is an update of article Getting deleted data in iOS , written in November 2015 using Objective-C and therefore morally obsolete. Now the code will be copied to Swift 3 and iOS 10 (the latest version is Swift 4.1 and iOS 1? but my computer does not support them any more).
 
 

Brief theory of


 

The format of url is


 
http://www.google.com/?q=Hello&safe=off
 
  •  
  • http is a protocol that determines by what standard a request is made. More options: https, ftp, file  
  • www.google.com - the domain name is  
  • /- directory where the ...[/h][/h]
+ 0 -

Swift and Kotlin - about the most important differences between these languages ​​

Swift and Kotlin - about the most important differences between these languages ​​  
 
Hello colleagues. The title is self-evident, we invite you to familiarize yourself with the translation of an interesting article by Krzysztof Turek. Also note that the author notices interesting improvements that distinguish Kotlin from Java when developing for Android. Word to the author:
 
 
Probably, many of you have seen the following comparison of Swift and Kotlin: nilhcem.com/swift-is-like-kotlin . It turned out quite interesting, right? I agree that there are many parallels between these languages, but in this article I would like to discuss some important differences between them.
 
...
+ 0 -

The same type of methods? Stop writing

Have you ever written adapters for Keychain or NSUserDefaults? They consist entirely of the same setters and getters. I suggest you write the logic once, giving the rest of the runtime. For the implementation of the request under the cut.
 
The same type of methods? Stop writing
dynamic <имя поля> . Then, when accessing the field, we get an exception unrecognized selector sent to instance.
 
Before sending an exception, the class will be called. + (BOOL) resolveInstanceMethod: (SEL) sel in the case of instance property or + (BOOL) resolveClassMethod: (SEL) sel in the case of class property.
 
In them, you can add a ...
+ 0 -

Protocol-Oriented Programming

+ 0 -

Swift for date-sentient: a fast dive in 2 hours

Swift for date-sentient: a fast dive in 2 hours
 
Google announced that TensorFlow moves to Swift . So put off all your business, throw out Python and urgently teach Swift. And the language, I must say, is rather strange in places.
 
python-like code . But it will still be a Python interpreter, which again means slow, non-parallel, inefficient from memory, without type control, and so on.
 
So teach Swift from scratch. Well, not entirely from scratch: it is assumed that you already program well in Python, and therefore many Swift constructs will be further described in comparison with similar Python constructs.
 
The article does not in any ...
+ 0 -

The book "Swift. Basics of developing applications for iOS and macOS. 4 th ed. supplemented and revised "

The book "Swift. Basics of developing applications for iOS and macOS. 4 th ed. supplemented and revised " This book contains exhaustive information for everyone who wants to learn how to program in the wonderful language of Swift in order to create their own iOS-applications (including macOS, tvOS and watchOS) or programs for the Linux operating system. In the course of reading the book you will find not only theoretical information, but also a large number of practical examples and tasks, which you will deepen your knowledge of the studied material.
 
 
During a long and fruitful dialogue with many of you, a lot of ideas were developed, thanks to which the new edition became really useful. In comparison with ...
+ 0 -

Use the MVC pattern when designing TableView

Hello, Habr! I present to your attention the translation of article "IOS Tableview with MVC" , published in October 2016 on Medium.com by the developer Stan Ostrovskiy.
 
 
Use the MVC pattern when designing TableView
 
An example of using UITableView in the application
 
 
In this article, with a specific example, you can see the application of the popular MVC pattern, when designing one of the most popular elements of the interface. UITableView . Also, this article in a fairly understandable and accessible form makes it possible to understand the basic architectural principles when designing your application, and also to give ...
+ 0 -

Reactive programming in Objective-C

Reactive programming in Objective-COver time, programming languages ​​are constantly changing and evolving due to the emergence of new technologies, modern requirements or a simple desire to refresh the style of writing code. Reactive programming can be implemented using various frameworks, such as Reactive Cocoa. It changes the framework of the imperative style of the Objective-C language and this approach to programming has something to offer a standard paradigm. This, of course, attracts the attention of iOS developers.
 
 
ReactiveCocoa introduces a declarative style in Objective-C. What do we mean by this? The traditional imperative ...
+ 0 -