[Code-only] Developing Sina Weibo in Swift 2.0 -- day 1, swift2.0
Development Environment: Xcode 7 Beta 4
1.1: initial deployment architecture
1.2 set the root controller (AppDelegate. swift)
1.3 custom TarbBar
1.4 set the logon interface through the inheritance relationship
Note: Determine whether to switch the interface based on whether the user logs
1.Swift limit TextField The number of input bits is 10 bits:string: String), Bool { else{ returntrue } string. Count- range.length returnten }2.iOS float with double range and precision:https://www.jianshu.com/p/ab37c083317b // when the bill is too large, it causes the decimal point to be erased. PO bill["Billmoney"]! 5978501.1 // Let Formatmoney = String (format: "%.2f", (bill["Billmo
settings. The Setup procedure in Xcode is to open the menu xcode→preferences, select the Text Editing tab, and select show→page guideat column. Because some code longer requires a line break, it can be broken according to the following general specification:
Break after a comma.
Break in front of an operator to select the higher-level operator to break, not the lower-level operator.
The new line should be indented two levels (8 space
Swift AVFoundation QR code scanning and generation,
The project does not need to support iOS6 at last (tear collapse). Scanning the QR code can completely give up.ZXingLibrary, instead of the systemAVFoundationNow, takeswiftI wrote a Demo with the following effect:Github address: click here
RelatedAVFoundationAndCore Image(Filter, etc.), you can first lookObjc
following general specification:
Break after a comma.
Break in front of an operator to select the higher-level operator to break, not the lower-level operator.
The new line should be indented two levels (8 spaces) with the previous line
Indent in4 spaces are often used as a unit of indentation, and are indented using tabs at development time, although a tab is equal to 8 spaces by default, but the number of tabs and spaces that may be set in different IDE tools will vary.
.
Welcome to follow Dongsheng Sina Weibo@tony_Dongsheng. Learn about the latest technical articles, books, tutorials and information on the public platform of the smart Jie classroom650) this.width=650; "title=" 00.png "src=" http://s4.51cto.com/wyfs02/M01/7C/F2/wKiom1bdBSbSn2wcAAAs2MBEZnc219.png "alt=" Wkiom1bdbsbsn2wcaaas2mbeznc219.png "/>More ProductsIOS,Cocos, mobile Design course please pay attention to the official website of Chi Jie Classroom:http://www.zhijieketang.comSmart-Jie Cla
Swift UI special training 41 implements step per value transfer using pure code, uistepper
I have previously discussed how to capture the value of a control through storyboard. Now let's try to implement the same function through code-only. First define a stepper and a label, and use the label to display the current value of stepper.
Self. priceStepper = UIStepp
//Main.swift//02- Statement//Created by Wanghy on 15/8/9.//Copyright (c) years Wanghy. All rights reserved.//Import Foundation1.// flow of control code using branch loops// Branch: If If - Else Switch// Loop: for and do - while for - inch// true or false: with BOOL judging the true and false, the value is true and the false//2. except Do - while and the Switch the other is basically the same, the difference is parentheses can be omitted, and curl
//Main.swift//02- Statement//Created by Wanghy on 15/8/9.//Copyright (c) years Wanghy. All rights reserved.//Import Foundation1.// flow of control code using branch loops// Branch: If If - Else Switch// Loop: for and do - while for - inch// true or false: with BOOL infer True or false. Evaluates to true and false//2. except Do - while and the Switch the other is basically the same, the difference is parentheses can be omitted. Curly braces cannot
1. Determine if the current controller is displayed:// determines whether the current controller is displayed Func iscurrentviewcontrollervisible (), Bool { return (self.isviewloaded) (( Self.view.window = nil) }2. Solve the white screen problem:In fact, white screen problem is the controller's jump problem.ifLet Tempnav = window?. Rootviewcontroller as?basenavigationcontroller{ forVcinchtempNav.childViewControllers.reversed () {if(VC = = TempNav.childViewControllers.last vc.iskin
// lazy Loading this input box private lazy var Textview:uitextview = { = uitextview () = Uifont.systemfontofsize ( - ) = uicolor.darkgraycolor ()// working with the keyboard, setting the keyboard's vanishing mode Textview.keyboarddismissmode = Uiscrollviewkeyboarddismissmode.ondrag // set Spring effect TruereturnTextView} () //lazy-Loading placeholder text PrivateLazy var Placehoderlabel:uilabel = UILabel (title:"Share New
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.