Swift Project Seventh Day: Building the Guest interface and listening button click

Source: Internet
Author: User

One: Guest interface effect

Two: Code

1: Business logic Analysis: 1: Because the user is not logged in to display the guest view, to determine whether the user is logged in, not logged in the guest view, login to display the normal landing interface, because the controller in the four sub-controller interface to determine whether to show the guest view, the same logic, so consider the parent class, The logic that determines whether to show the guest view is encapsulated in the parent class, allowing subclasses to inherit. 2: The guest view's interface encapsulates the guest view in a view with a relatively fixed interface, so it is built with Xib, and the controls shown as much as possible are encapsulated in the interior of the view first. Based on the external model or defining methods in the encapsulation class to control the display of the control or the display and hiding of the corresponding control, 3: Determine whether the user is logged in by overriding the Loadview method in the parent class controller to set whether to load the guest view

2: Guest View build: New file Inheritance UIView, new xib with the new UIView class with the same name, first came to Xib, the class is associated with xib, you can not set the effect of freeform,xib build

1:1: Drag into the Uiimageview to set the rotated picture: Set the Xib constraint at first, set the control to center horizontally vertically relative to the parent view, center horizontally vertically at position (where 1 is set to the horizontal vertical center relative to the parent view, Figure 2 is vertically centered horizontally, and is generally selected two controls , set control A to center vertically horizontally relative to control B). 2: Set

Swift Project Seventh Day: Building the Guest interface and listening button click

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.