This is a function, and the one in the class is called a method. This is a C function. C has no type, so it can only be written like this. The first letter is capitalized. It is a function under UIKit, so there is UI in front of it.
Generally, the internal part of Class is called Method, which is the method; while the external part is called Function, which is the function.
When you write it outside, this function does not need to be removed through Class or Class instance when calling.
The reason why the first letter is capitalized is because of Apple’s ancient tradition. Because there is no such thing as namespace in the Objective-C era, name conflicts may occur in many cases. Therefore, Classes in the Cocoa framework are all prefixed, such as NS, UI, etc. (to give a simple example: UIImage and CGImage, you can imagine if there is no prefix). And Apple agrees that prefixes are all in uppercase, so this is the case.
Generally, the internal part of Class is called Method, which is the method; while the external part is called Function, which is the function.
When you write it outside, this function does not need to be removed through Class or Class instance when calling.
The reason why the first letter is capitalized is because of Apple’s ancient tradition. Because there is no such thing as namespace in the Objective-C era, name conflicts may occur in many cases. Therefore, Classes in the Cocoa framework are all prefixed, such as NS, UI, etc. (to give a simple example: UIImage and CGImage, you can imagine if there is no prefix). And Apple agrees that prefixes are all in uppercase, so this is the case.
public func after_delay(time:NSTimeInterval,block: dispatch_block_t){ let time_uint64:UInt64 = UInt64(time) let delay = dispatch_time(DISPATCH_TIME_NOW, Int64(time_uint64 * NSEC_PER_SEC)) dispatch_after(delay, dispatch_get_main_queue(), block) } Just like this, you can also write such a function yourself. When you call it, you don’t need to use a class or structure enumeration to call it. You can use it directly
This is a function, and the one in the class is called a method. This is a C function. C has no type, so it can only be written like this. The first letter is capitalized. It is a function under UIKit, so there is UI in front of it.
Generally, the internal part of Class is called Method, which is the method; while the external part is called Function, which is the function.
When you write it outside, this function does not need to be removed through Class or Class instance when calling.
The reason why the first letter is capitalized is because of Apple’s ancient tradition. Because there is no such thing as namespace in the Objective-C era, name conflicts may occur in many cases. Therefore, Classes in the Cocoa framework are all prefixed, such as NS, UI, etc. (to give a simple example: UIImage and CGImage, you can imagine if there is no prefix). And Apple agrees that prefixes are all in uppercase, so this is the case.
Generally, the internal part of Class is called Method, which is the method; while the external part is called Function, which is the function.
When you write it outside, this function does not need to be removed through Class or Class instance when calling.
The reason why the first letter is capitalized is because of Apple’s ancient tradition. Because there is no such thing as namespace in the Objective-C era, name conflicts may occur in many cases. Therefore, Classes in the Cocoa framework are all prefixed, such as NS, UI, etc. (to give a simple example: UIImage and CGImage, you can imagine if there is no prefix). And Apple agrees that prefixes are all in uppercase, so this is the case.
public func after_delay(time:NSTimeInterval,block: dispatch_block_t){
let time_uint64:UInt64 = UInt64(time)
let delay = dispatch_time(DISPATCH_TIME_NOW, Int64(time_uint64 * NSEC_PER_SEC))
dispatch_after(delay, dispatch_get_main_queue(), block)
}
Just like this, you can also write such a function yourself. When you call it, you don’t need to use a class or structure enumeration to call it. You can use it directly
UIImagePNGRepresentation() This is the C function. OC can compile C language. This function is defined in the UIKit framework.