I'm new to Xcode and Objective-c. I have the latest Xcode version, but when I create a new IOS project, regardless of the version, the generated code does not use auto property synthesis or storyboards, although I found some tutorials that says that it should use them by default. How can I change this behavior?
The easy way is to select a single view application from the list of template projects you are shown when you start a new project.
To do if from scratch you need to create a new storyboard and add the name of that storyboard to the Info Plist. See the screenshot.
Related
New Project
Old Project
When I create a new one or go on old one I cannot use the storyboard at all. Any help please?
Select User Interface as Storyboard while creating a new project in Xcode 11.
I just got Xcode and I am trying to follow an online tutorial but in every single tutorial, when a new project is made (a single activity) app, the project comes with 2 files that I simply don't have by default! I can't figure out how to make a main.storyboard or ViewController.swift file by default upon creating a project.
The only files I have are AppDelegate.swift, SceneDelegate.swift, and ContentView.swift. I also have Assets.xcassets, LaunchScreen.storyboard, Info.plist, Preview Content directory, and Products directory.
Is this part of a new update or something? Or is there some way I can get those 2 files to create upon initialization?
I tried reinstalling, and have made multiple new projects - each time they lack those 2 crucial files, so any help would be appreciated.
In the latest Xcode, select Storyboard from the User Interface dropdown,
Older Xcode
Unselect Use SwiftUI at the following step,
On latest Xcode release you should change in the dropdown menu from "Swift UI" to "Storyboard"
I'm trying to create Xcode project templates with swift and got bit success but facing issues to load xib file
Error popup when xib selected in Xcode: "Interface Builder was unable to determine the type of "ViewController.xib". This may be due to a missing SDK."
anyone know how to create xib file in Xcode project template?
I have added project template at below path:
~/Library/Developer/Xcode/Templates/Project Templates/CustomTemplate/
and created below folders..
/Base.xctemplate
/Bundle Base.xctemplate
/iOS Application.xctemplate
/Swift Application.xctemplate
Few queries I have for Xcode template usage:
I have not found any apple documentation for creating Xcode project templates, so that mean apple stoped supporting to create Xcode custom project templates?
Swift apps allows to have custom Xcode project templates?
Apple will reject app submitted which was built with custom project templates?
Xcode custom project templates are better way to have it in practice or not?
All links and reference I found are upto Xcode4.x, is that mean no support available for Xcode project templates then after?
Reference:
http://www.telerik.com/blogs/how-to-create-custom-project-templates-in-xcode-7
any help will be appreciated..
I want to add some stuff to the built-in UIViewController template for new Projects (for example, keyboard dismissal methods). I found this question that explains how to go into the Xcode bundle, and modify a particular class template. However, when I make a new iOS Project, the particular template that I find in the iPhoneOS folder is slightly different from the one that is actually used, and of course, my modifications to the template don't take effect (after restarting Xcode to make sure). (FYI, I am selecting iOS / Single View template to start the Project.)
Then, of course, how do you protect the customizations you make from updates to Xcode? I assume when the .app bundle is overwritten by a download from the App Store, it will overwrite all the templates?
You need to create a custom Xcode project template and tell that project template to use your customized ViewController file. Creating custom project templates is a royal pain and too large a subject to cover completely in an answer here. What I can answer here is where to place your custom templates so they don't get overwritten by Xcode updates. Place your custom project templates in the following folder:
/Users/Username/Library/Developer/Xcode/Templates/Project Templates/GroupName
Where GroupName is the group name on the left side of the New Project Assistant. You can create your own group name or use one of the existing group names.
A Google search for Xcode custom project templates uncovered the following article for Xcode 7 on the first page of results:
How to Create Custom Project Templates in Xcode 7
I wrote everything I know about creating custom Xcode project templates in the following article:
Creating Custom Xcode 4 Project Templates
Really having a tough time getting Firebase stood up in xcode. I'm trying to get a project going using Swift with the instructions here.
Per the instructions I create a new project using Templates. I choose Firebase > Single View Application, which creates a project. From here I have problems.
I try to create a bridging header by first creating a temp objc file. I'm never presented with the option to actually create the bridging header during that process. Only the objc file is created. I manually create a header file using these instructions.
I note some strangely name view controller files are created which fail the build due to containing multiple syntax errors (___VARIABLE_classPrefix:identifier___ViewController.h and ___VARIABLE_classPrefix:identifier___ViewController.m).
Main.storyboard won't open. I get a message saying it is corrupt.
What is going on here? I'm able to stand up a normal non-Firebase project via templates. I'm new to Swift/XCode dev so I'm not sure if I'm missing a step. Is it possible to install this SDK via templates?
Not quite sure what you've done here lol.
Best to use this guide when new to swift.
To create a header file go to 'file' -> 'new' -> 'file' -> In the IOS tab 'Header file'.
I've been having problems with Firebase in Xcode 8 Beta so probably best to stick with Xcode 7 until official release.