Swift parses Struct like HandyJSON

HandyJSON HandyJSON is a framework developed by Ali to convert JSON data into corresponding models on swift. Compared with other popular Swift JSON libraries, HandyJSON is characterized by its support for pure swift classes and ease of use. When it is deserialized (converting JSON to Model), it does not require Model to inherit from NSObje ...

Posted by garg_vivek on Wed, 12 Jan 2022 18:25:47 +0100

Classes and structs in Swift

Comparison of classes and structures Classes in swift: class LLPerson { var age: Int var name: String init(_ age: Int, _ name: String) { self.age = age self.name = name } } var person = LLPerson(18, "LL") var person1 = person Class is a reference type, person to person1 is the assignment of the poi ...

Posted by DarkShadowWing on Mon, 03 Jan 2022 08:17:32 +0100

SwiftUI custom segmented control

Boring start: You need to create a segmented control. The effect is as follows: Does it look familiar? Yes, it looks like Android, right?! The black underline will move under the selected title, and can automatically expand and shrink according to the length of the text. Why is it so Android like? Because I spent an afternoon getting i ...

Posted by pl_harish on Thu, 23 Dec 2021 20:52:54 +0100

Subscript in Swfit

catalogue Subscript syntax (subscript for subscript definition) An example of subscript usage is dictionary Subscript option (get set, if only get is implemented, it is a read-only attribute) Type subscript (modified by adding static before subscript) Summary: Subscripts can be defined in classes, structs, and enumerations. They are shor ...

Posted by duvys on Mon, 20 Dec 2021 02:53:22 +0100

Alamofire introduction notes

Newcomers began to learn IOS development. Today, they read the basic commands of alamofire and referred to the official website. To sum up, the official documents are as follows. You can use cocapods to import the Alamo fire Library: https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md Send request: AF.reque ...

Posted by rcmehta_14 on Mon, 06 Dec 2021 23:30:30 +0100

[iOS] record the widget development process and problems encountered

Write in front 1. After iOS14, apple updated the extension component and introduced a new UI component: WidgetKit, but abandoned the Today Extension component of versions below iOS14; 2. The widgextension uses a new WidgetKit, which is different from the Today Widget. It can only be developed using SwiftUI, so SwiftUI and Swift foundation are ...

Posted by Froolah on Fri, 03 Dec 2021 15:52:04 +0100

iOS development from scratch: 00 | Swift basic syntax

catalogue 1, Development environment 2, About Swift (1) Introduction to Swift (2) Swift properties (3) Conclusion 3, Swift basic syntax (1) Programming preparation (2) Hello,world! (3) Simple value 1. Variables and constants 2. String 3. Arrays, dictionaries, sets, and tuples 4. Optional type (4) Control flow 1. Conditional state ...

Posted by ziv on Fri, 03 Dec 2021 00:06:37 +0100

Practice of Flux architecture in Toka App

Introduction: in order to cope with the complex interaction of video editing tools, Toka iOS draws lessons from the design idea of Flux architecture mode and the topology concept of directed acyclic graph, centralizes the event management, and realizes a comfortable, refreshing and easy to control "one-way flow" mode from the dev ...

Posted by bidnshop on Thu, 28 Oct 2021 03:54:27 +0200

How does iOS development limit the scope of NSNotification

  in actual development, NSNotification can well decouple code and transmit data across layers. But because it is globally effective. Therefore, sometimes we don't want to have such a wide range of functions, but just want to send and receive notifications within a certain range. Recently, I made a plan to share with you. My side is mainly ...

Posted by josephferris on Mon, 20 Sep 2021 19:07:29 +0200

Swift4.0 learning notes (VIII) - UI progress view

1. Declare control There are two styles of progress bars bar default The two styles work as follows: self.view.backgroundColor = UIColor.red progressView = UIProgressView(progressViewStyle: .default) progressView.frame = CGRect(x: 0, y: 0, width: 200, height: 10) progressView.layer.position = CGPoint(x: self.view.frame.width/2, y: 90) progres ...

Posted by vtroubled on Sun, 03 May 2020 06:31:13 +0200