Before the company's app after two times rewrite, are using OC independently developed by myself, but these things I am embarrassed to say that they wrote, a true word: ugly!!! Objective reasons are mainly the company to the special urgency, but also focus on the function rather than the effect, the company's art has not done before the app and other work, but from the subjective side or to their own requirements are somewhat low, so, these two days of thinking for a long time, the company's things are not much of leisure to learn to write Swift, Incidentally, rewrite the previous project again.
Gossip doesn't say, first create a swift project
After the creation, quit the program, because we use cocoapod here to manage the project, as for how to install and use Cocoapod, this is not the scope of this article, we Baidu can.
After the terminal type pod install waits for the pod to complete the third party class library and configures the parameters, we comeandgoswift.xcworkspace to open the project, otherwise it may cause the compilation error.
Then my focus came, how to set the item icon with Launchimage
① First we say that the icon, in fact, a complete project icon needs a lot of, this as to what visitors can go to Baidu understand, I here directly said the simplest way, please visit https://github.com/rickytan/RTImageAssets To download this Xcode plugin, and then run this program, and then restart Xcode, generally the Xcode plugin is so installed, but now because the upgrade to Xcode7.1, only to do this is not enough, but also can not use the plug-in, then how to solve it, here to pick (http:// Blog.csdn.net/oiken/article/details/49123365 the method of this blog post, the brother seems to have turned, his method is:
1. Open the directory where the Xcode plugin is located: ~/{Current user name}/library/application support/developer/shared/xcode/ Plug-ins2. Select an already installed plugin such as vvdocument, right-click on "Open Package Contents", 3. Locate the Info.plist file, locate the Dvtplugincompatibilityuuids project, 4. Add C4A681B0-4A26-480E-93EC-1218098B9AA0 (a number for current Xcode), how do I get this number? Execute at Terminaldefaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID 即可 5. Right-click "Open Package Contents" Double-click a black icon in the Contents\macos directory to open the terminal window and finally print "process completed", restart XcodeBut according to my operation, the first step of the current user name does not seem to be in the 34th step in fact, my own computer on the plist file number already exists, everyone according to their own situation, so basically I think the effective estimate also on the fifth, run the black icon under that directory.when you're done, restart Xcode and you'll find this menu in the file directory on the top menu: Imageasset, select Appicons in his submenu, click Run, a window appears, then drag it into a 1024*1024 picture ( Your app's icon image) then click on the Generate in the top right corner and you'll find that the icon directory in your project has a lot more pictures. Your AppIcon has been set .② then we need to set the transition animation, this actually has two methods, in IOS8 and later can use the system default generated Launchscreen.storyboard file using the Sizeclass scheme to do, but this way before iOS8 is invalid ... Another way is to compare the old method, that is, the launchimage way to do ... I need to do this project is iOS7 and after the adaptation, so I need to put the image format is listed in the following five kinds of resolutions: When you put the picture according to position, run the project, but you will be depressed to find, seemingly these pictures did not appear ah, then how to solve it, see the following steps: Figure 1 2 is required For everyone to set, the launch Images source is set to the name of the folder that you created earlier or the system default generated 5 pictures, you can even click on the back of the small gray point to see if the location to your directory, and then the launch screen file empty, The default is usually the Xib file. At this point, run the program should be able to see your lovely launchimage pictures ... Of course, in some cases, the transition picture disappears too fast, in the entrance to the program first page Gap will have a white screen appear, so that the user's sense is not good, then, at this time we can in the first controller of the program to write the following code: OK, next to tomorrow. This end of the notice: The main start tomorrow in the use of Swift how to call OC Class Library, that is, how to fix the bridge file, and because this project is based on a Baidu map of an application, so there will be Baidu map related content.
Rewrite the company OC Project with Swift (DAY1)--How to set up the AppIcon and launchimage of the program