UIControllerView 加载之后,UITableView 无法滑动到最底部

2022-11-19
阅读 2 分钟
1.4k
项目中,需要在进入 UIViewController 后对它里面的 UITableView 滑动到最底部,那么需要把代码写在 viewDidLoad 中。

Swift Learning Summary: Advanced Operators

2022-06-19
阅读 10 分钟
677
Unlike arithmetic operators in C, arithmetic operators in Swift don’t overflow by default. If want to overflow by default, use the overflow operation begin with ampersand (&). For example, the overflow addition operator (&+).

Swift Learning Summary: Access Control

2022-06-18
阅读 11 分钟
844
Access control restrict access to part of the code form code in other source files and modules. It enable us to hide the implement detail of the code, and to specify a preferred interface which that code can be accessed and used.

Swift Learning Summary: Memory Safety

2022-06-12
阅读 5 分钟
724
Most of the time we don’t have to think about accessing memory, but it’s important to understand where potential conflicts can occur, so we can avoid writing code that has conflicting access to memory.

Swift Learning Summary: Automatic Reference Counting

2022-06-12
阅读 8 分钟
627
Swift use ARC to track and manage the app’s memory usage. ARC frees up the memory used by class instances when those instances are no longer needed.

Swift Learning Summary: Opaque Type

2022-06-05
阅读 6 分钟
903
A function with an opaque type hides its return value’s type information. Hiding type information at some boundaries between a module and code that calls into the module. Unlike returning a value whose type is a protocol type, opaque type preserve type identity —the compile has access to the type...

Swift Learning Summary: Generic

2022-06-05
阅读 10 分钟
683
Write code in a more abstract way. It make the code flexible and more reusable.

Swift Learning Summary: Protocols

2022-05-22
阅读 15 分钟
739
ProtocolsA protocol defines a blueprint of methods, properties. Can be Adopted and implemented by:classstructureenumerationSyntaxDefinition {代码...} Being ConformedBy Struct {代码...} By Class {代码...} Conforming ProtocolThe Dog and People both conform the DoSport protocol, so they have respons...

Swift Learning Summary: Extensions

2022-05-21
阅读 4 分钟
830
Extension add new functionality to an existing class, structure, enumeration, or protocol type.

Swift Learning Summary: Nested Types

2022-05-16
阅读 2 分钟
683
Nested TypesEnumerations, classes or structures can be nested in another type. {代码...} Referring to Nested Types {代码...}

Swift Learning Summary: Type Casting

2022-05-16
阅读 4 分钟
653
Type CastingType casting in Swift is implemented with is and as operators.Type casting:A subclass instance can be use as a superclass instance.Defining a Class Hierarchy {代码...} Checking TypeUse is to check whether an instance is of a certain subclass type. {代码...} When set the movies and son...

Swift Learning Summary: Concurrency

2022-05-08
阅读 6 分钟
854
Swift has built-in support for writing asynchronous and parallel code in a structured way.

Swift Learning Summary: Error Handling

2022-05-07
阅读 6 分钟
736
First-class support for throwing, catching, propagating, and manipulating recoverable errors at runtime.

Swift Learning Summary: Optional Chaining

2022-05-02
阅读 4 分钟
879
A process for querying and calling properties, methods, and subscripts on an optional that might currently be nil .Multiple queries can be chained together, and the chain fails gracefully if any link in the chain is nil .

Swift Learning Summary: Deinitialization

2022-05-02
阅读 2 分钟
867
A deinitializer is called immediately before a class instance is deallocated.

Swift Learning Summary: Initialization

2022-04-30
阅读 19 分钟
944
Initialization is the process of preparing an instance of a class, structure or enumeration for use.

Swift Learning Summary: Inheritance

2022-04-24
阅读 6 分钟
721
Class A inherit from class B. Then A is the so call subclass, B is the superclass.

Swift Learning Summary: Subscripts

2022-04-24
阅读 3 分钟
767
A shortcut for accessing the member of a collection, list, or sequence.

Swift Learning Summary: Method

2022-04-17
阅读 4 分钟
696
MethodMethods are functions that associated with a particular type.Classes, structures and enumerations.Define instance methods for an instance of the given type.Define type method for the type itself.Instance MethodIt is defined in a type. And it can only be called by a specific instance of the ...

Swift Learning Summary: Properties

2022-04-17
阅读 11 分钟
838
Usually associated with instance of a particular type, can be associated with the type itself(type properties).

Swift Learning Summary: Structures and Classes

2022-04-10
阅读 5 分钟
730
Structures and classes are the basic building blocks of the program’s code.

Swift Learning Summary: Enumeration

2022-04-10
阅读 5 分钟
977
When we want to modify the var after the initialized, we can use a shorter form of the enumeration.

Swift Learning Summary: Closures

2022-04-02
阅读 10 分钟
1.1k
Closures are self-contained blocks of functionality that can be passed around and used in your code.

Swift Learning Summary: Function

2022-04-02
阅读 6 分钟
922
Use the inout with reference to change the the original value outside.

Swift Learning Summary: Control Flow

2022-03-28
阅读 6 分钟
737
Control Flowloopwhilefor-inrepeat whilecondition branchifswitchwhereguardcontrol transfer statementsbreakcontinuefallthroughreturnthrowLoopFor-In Loops {代码...} Stride Function {代码...} The for-in can be only use to the object which conform to the Sequence protocol.While {代码...} Repeat WhileT...

Swift Learning Summary: Collection Type

2022-03-28
阅读 8 分钟
807
Collection Typearraysetdictionarycollection type use are generic, the type of element is specific.ArrayWith ordering.Access by subscript.Variable-length. {代码...} Create by class {代码...} result:[0.0, 0.0, 0.0] [2.5, 2.5, 2.5] [0.0, 0.0, 0.0, 2.5, 2.5, 2.5]Create By Array Literal {代码...} {代...

Swift Learning Summary: Strings and Characters

2022-03-20
阅读 9 分钟
759
String type is bridged with Foundation’s NSString. Foundation extends String to expose methods defines by NSString. If import Foundation, you can access those NSString methods on String without casting.

Swift Learning Summary: Basic Operator

2022-03-19
阅读 4 分钟
722
Basic OperatorsTerminologyUnary operator (such as -a)Binary operator(such as 2 + 3)Ternary operator(such as a ? b : c)The values that operators affect are operands. Prefix, infix, suffixAssignment Operator {代码...} Arithmetic OperatorsAddition+Subtraction-Multiplication*Division/ {代码...} Remai...

Swift Learning Summary: Basics

2022-03-12
阅读 10 分钟
958
BasicSyntax {代码...} Base data typeTypeDescUInt8UInt8.min is 0, UInt8.max is 255IntOn the 32-bit platform, it’s as Int32; On the 64-bit platform, it’s as Int64.UintOn the 32-bit platform, it’s as UInt32; On the 64-bit platform, it’s as UInt64.Double64-bit floating-point numberFloat32-bit floatin...