The first page after iOS configuration starts

Source: Internet
Author: User

Configure Viewcontroller.swift as the first page after startup in Appdelegate.swift

Import Uikit@uiapplicationmainclass Appdelegate:uiresponder, uiapplicationdelegate {    var window:uiwindow?    Func application (application:uiapplication, didfinishlaunchingwithoptions launchoptions: [Nsobject:anyobject]?)- > Bool {        //start with the first page        Self.window = UIWindow (Frame:UIScreen.mainScreen (). bounds);                Here set Rootviewcontroller for Viewcontroller instance let        VC = Viewcontroller ();        Self.window?. Rootviewcontroller = vc;//The bank VC to fill out the page you want to select                Self.window? BackgroundColor =. Whitecolor ();        Self.window?. Makekeyandvisible ();        return true;    }

Write the background color briefly in the Viewcontroller.swift

Import Uikitclass Viewcontroller:uiviewcontroller {    override func Viewdidload () {        super.viewdidload ()        // Additional setup after loading the view, typically from a nib.        Self.view.backgroundColor =. Yellowcolor ();//Background color settings    }    override Func didreceivememorywarning () {        Super.didreceivememorywarning ()        //Dispose of any resources, can be recreated.    }}

Select the appropriate "TARGETS", select "General", find the following two configuration items, and clear the contents.

Delete the Main.storyboard and Launchscreen.storyboard files.

Then the yellow page appears on the run

The first page after iOS configuration starts

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.