- Not in Swift
main.m , @UIApplicationMain It's a program entry.
- Only files in Swift
.swift , no .h/.m distinction between files
- In Swift, a class is enclosed in a pair
{} , with no @implementation@end
1. Method invocation OC [[UIView alloc] initwithxxx:]Swift UIView (XXX:)
UIView ()
class name () = = Alloc/init
2. Class Methods
OC [Uicolor Redcolor]
Swift uicolor.red ()
3. To access the properties of the current object, you can not use ' self ';
Recommendation: Do not use, when the compiler prompts to add, will have a better understanding of the ' context '
Cause: Closure (block similar to OC), need to use self
4. No '; '
'; ' Purpose: delimited statement, in Swift, by default does not require
5. Enumeration type
OC Uibuttontypecontactadd
Swift. Contactadd
6. Monitoring Methods
OC @selector
Swift #selector, if with parameters, do not need to use ': '
7. Commissioning
OC NSLog
Swift Print
? No time
efficiency is higher than NSLog.
OC __function__
Swift #function
8. Notes
OC #pragma mark-what to comment on
Swift//MARK:-What to comment
OC #warning
Swift//TODO://Fixme:
Swift Learning Note One: the difference from OC