I'm creating an app in SwiftUI. I have it running on Mac and iOS.
How do I get it to run on my Apple TV?
I've never developed for Apple TV before. Can I run the existing app and see what it looks like on the TV. Thanks for any tips you can share.
The first step is to add a new target for tvos. In your project settings click the + button under targets, then select the tvos tab, and choose Single View App.
Finish creating the target, make sure you select SwiftUI for the user interface.
You should have a new tvos folder under your project, go to AppDelegate.swift and change the UIHostingController to point to your main SwiftUI view.
window.rootViewController = UIHostingController(rootView: YourMainView())
You may need to go to your swift source files and check that the target membership includes tvos
Change your run target to tvos, and click run.
You will probably have to do some work to support the tvos platform in your app, some of the swiftUI user input events are pretty different in tvos.
Related
I'm on Xcode 14.0.1 on macOS 12.6.
I'm trying to create a new watch complication in my existing app with WidgetKit, starting with adding a Widget Extension template target to my project.
This generated a new folder with an intent definition file, an Assets file, an Info.plist file, and a SwiftUI file. The SwiftUI file refuses to preview, with the error
AppExtensionNeedsContainingAppError<XcodeGraphSource>: MyWatchExtension.appex must be in an app
The app extension "MyWatchExtension.appex" needs to be embedded in an app in order to use previews
I'm able to compile the target and run it in the watchOS simulator just fine. Am I missing a crucial step somewhere?
I was getting the same error message. For me, the problem was that I had started with a "WatchOS" only app template and then added a WidgetKit target for "iOS" by accident. In this case, there was indeed no app for the iOS WidgetKit target.
Later, I re-created everything and created a "WatchOS" WidgetKit target. Then the preview was running fine.
Could you have done something similar?
recently I finished my app with ionic2 and about to build, when I use ionic build --release --prod ,it can work well in ios but not in android.when I build android a package or just use ionic run android with product mode,I can run my app and get the main page.But wherever I click next,the screen will go white like get a white mask and every thing hardly seen,but in console no thing goes wrong.here is some screenshot:
first in
do some click and go white
could someone help me or did some one get same situation?
finally i solved it by remove my setting in variables.scss, by reducing $colors setting to less than 20 makes my app work well in prod mode, more detail in ionic issues
I'm new to Xcode. I am using version 8.3.3 on MacOS 10.12.5 (Sierra) to develop an experimental command line application. I want to set up a version number for the application. According to instructions in Apple documentation and many other places I should be able to do this under the General tab for the project. However, under the General tab Xcode does not seem to be able to find a plist file and instead
displays a 'Choose info.plist File' button.
When I click the click the button Xcode displays a selection dialog containing a project icon, but no sign of an info.plist file and no obvious way to navigate to or create one.
I have tried the technique described at Youtube (v=gYh4_80jHDk: sorry -- can't post it as a link as I'm also new to Stack Overflow!) but to no avail. It just gives me another 'Choose info.plist File' button.
I expect I'm missing something obvious, but it's not obvious to me. I'd be grateful for any help!
Many thanks
I have an Objective-C project with a large portion of it written in C++. I've also written a C++ main file in the project which allows the processing done in the C++ side of things to be run as a standalone without the iOS component. Is there anyway to setup a C++ debug execution configuration inside of the iOS project? As far as I can see I can only create configurations meant to run on an iOS device when in an iOS project. Yet, AppCode does have the project type to create command line tools. Is there anyway to enable those command line tool configurations inside of an iOS project? Thank you much!
Yep, you can do it using your current project.
Here are some screenshots which hopefully are clear enough. Note this is Xcode 6.
In Xcode, in the Nav Area, select the project (selected on the left in the image). You'll see your targets. Click on that '+' to add a new target.
You'll then get a a dialog sheet where you can select your OSX Command Line Tool. It will then let you configure how that target is setup.
If you take a look at Google Chrome's configuration menu you will see several neat UI features. Specifically the edit and zoom menu items. How can I implement a similar version of Chromes zoom menu item inside Qt 4.7.1.
Since Chrome is based on the open source project Chromium you can download the source code and see exactly how Google have done it.
Chromium is made on VC++
link here -> http://cotsog.wordpress.com/2009/11/08/how-to-compile-google-chrome-with-visual-c-2008-express-edition/