Where does UIImage operations run on watchOS extension - uiimage

I am still new to watchOS and trying to understand how the architecture works. I have a watchOS 3 app that I have been working on that uses UIImage in my WatchKit extension. I do some operations with UIImage from assets in the extension. What I can't tell is where these UIImage manipulations happen, is it on the watchOS or on iOS? In some tutorials I read, it sounds like assets for extensions are stored in iOS and UIImage being form UIKit makes me believe its on iOS. Apple's WatchOS programmers guide has these 2 images:
Apple says this image shows the relationship between the Watch app interface, the WatchKit extension, and the iOS app.
Apple says this image show the structure of a watchOS app. This seems to imply images are stored on watch.
I couldn't find any answers in the tutorials or programmers guide and the images used to describe how the watchOS works confused the situation even more.

In WatchOS3 the watch extension code definitely runs on the Watch. This is what the first diagram is showing.
The watch app assets will also be on the watch - I think this is the "Storyboards and Resources" in the second diagram.
Your confusion probably arises from the fact this was different in WatchOS 1, when the extension did actually run on the phone. Maybe you were reading old tutorials?
Anyway I hope that helps!

Related

Editing Swift markup on the iPad Playgrounds app

It does not appear possible to edit previous markup on the iOS Swift Playgrounds app directly. The only way that I have found is to export the file into an Xcode Playground, perform the editing, then re-import it back into the iOS app. This is a bit long winded! Has anyone found a simpler method?
Running latest Swift Playgrounds app under iOS 12.2 on an iPad Pro 2018.
You are right, the markup part of a playground page can only be changed in an external editor. So your workflow
Testing on iPad -> Editing in Xcode -> Syncing with iPad
is just fine.
Currently, this seems to be the philosophy behind Swift Playgrounds.
The developer is intended to build a playground in Xcode, which the user can experience on their iPad. This includes the restriction to certain editable regions within a playground page. The user is not (yet) supposed to change major parts of the source code (including markup parts) solely on iPad.

UIPageControl for Walkthrough

I have previously used MyBlurIntroductionView library for presenting walkthroughs of my app but the problem is it is buggy on iPhone X -- the content gets cut off by the notch on iPhone X. The library has not been updated for years so I need something that works on iPhone X. I am not sure if it a problem with setup of UIPageControl. Any inputs to fix it or an alternative library that is better for presenting walk through tutorials on iOS?
Firstly on MYBlurIntroductionView, Launch screen is missing add it by
Xcode-> NewFile-> LaunchScren
Assign it on your target
Output
Since MyBlurIntroductionView is very old source project you have to provide constraints
with respective to safe area(see here)

Xamarin iOS Storyboard not rendering

I got this error "There was a problem rendering this document" when i tried to load my storyboard in my xamarin iOS application. I created another xamarin iOS project and still got the same error.
You can not do much there right now.
There are two options one should do:
1. Use Xcode storyboard if you can.
2. If the first one is not an option, create and use multiple storyboards in your project, since after your storyboard gets big enough xamarin has a lot of problems rendering and working with it. You have a lot of documentation on how to use multiple storyboards in your project.

Images not showing in iOS 7.1 with XCode 6 / Swift

I have this ObjC code:
[self.myButton setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:#"%#-button", self.myObject.name]]
forState:UIControlStateNormal];
This works great with these combinations:
XCode 5, iOS 7.1
XCode 6, iOS 7.1
XCode 6, iOS 8
But when I port one single class of the project to Swift -- a class which is unrelated to anything that is happening in this code -- the images do not display in XCode 6 for iOS 7.1. It does work with XCode 6 and iOS 8.
I finished porting the entire project to Swift, so now the code looks like:
self.myButton.setBackgroundImage(
UIImage(named:self.myObject.name + "-button"),
forState: UIControlState.Normal
)
And it's still unhappy on iOS 7.1. Still no images. (The custom icon works, though.) Yes, I know this is just beta software, and it's probably just a bug ... ? But I'm just wondering if anyone has a solution or insight.
I only started using XCode and ObjC about a week ago (surprise! ObjC is now deprecated!), so it could be that I am missing something, but since it works in ObjC, and in Swift+iOS8, it seems like it's probably a bug.
I've managed to overcome this by not using Asset Libraries to store my images.
Add your images to the project using the "old style naming", like Image.png and Image#2x.png, then load them without any extensions in the filename, as such:
let myImage = UIImage(named:"Image")
Fixed in XCode 6 beta 2
Images from asset catalogs in projects with a minimum deployment target of iOS 7 or OS X
10.9 will be available when running on iOS 8 and OS X 10.10, and now also iOS 7 and OS X
10.9. (17029658)
release xcode 6 beta 2 notes
For me it was because I suddenly add jpg image to Image Assets. Just resaved it as png and all work well
I guess you are testing it on simulator. Make sure the desired image is copied to 7.1 bundle. To do it check copy resources bundle build stage or check manually app bundles for different simulators at ~/Library/Application Support/iPhone Simulator/.
#o KB o points out here that the Xcode6 Beta release notes mention that xcassets bundles aren't supported for iOS7. Additionally, I've found it surprisingly hard to get rid of asset bundles in your project. This can cause naming collisions if your images have the same name as images that were previously in the bundle (you probably want the same names, so you don't have to rename your images everywhere in code / IB).
Here's a workaround:
Copy each image out of your .xcassets image bundle to a new directory (let's call it Images/). See below for a script to make this easier.
Delete your .xcassets bundle. (surprisingly, removing it from the project isn't enough. In my testing, if the .xcassets bundle was anywhere in the same directory as the Xcode project or related sources, it would get copied in. Alternately, you can remove the .xcassets extension)
Add all your image files to your Xcode project
Clean (cmd + shift + k)
Delete the app from the target device or simulator
Install and run
To make step #1 less tedious, I wrote a script to copy images out of the .xcassets bundle and into a directory of your choice: https://github.com/johnboiles/xcasset_exporter
mkdir Images
./xcasset_exporter.py MyProject/Images.xcassets Images
I had a problem where some images in xcassets worked and others didn't (only for iOS 7.1).
I solved it by deleting the problematic image sets and creating new ones with different names.
If you are attempting to use an external bundle with proper PNG images stored in either an "old style" folder or inside xcassets then apps running on iOS 7 will not be able to access these images.
I tried a suggestion from another answer here to add the "old style" folder path of the images in the external bundle but that didn't work for me. My solution, which fit my scenario, was to expose an outlet for the resource in the nib inside the external bundle. This allowed the main app to set with an accessible image to it. Whether this is a bug or simply a constraint in using nibs contained in external bundles with iOS 7 will matter less as it rides on to the usage sunset...
PS: Apps running on iOS 8 where able to access images in the external bundle xcassets just fine so choose your poison for supporting iOS 7.

How to limit iTunes App Store "Requirements" listing?

The iTunes AppStore auto generates some listings on its published pages. One of them is "Requirements:" and shows the devices that this app is compatible with. iPod, iPhone or iPad etc.
QUESTION: Where is this REQUIREMENTS listing set during the build process?
I have submitted an app that I 'thought' was properly configured because the Xcode settings for iPhone and NOT iPhone/iPad. But apparently this is either broken or I am totally confused as to where this is set and how its created on the AppStore.
Can someone enlighten me?
If you create an app that is iPod/iPhone only, it will still run on an iPad, just not as an iPad native app. That is to say, an iPhone/iPod-only app will run in an iPhone-sized window on an iPad. I do not think that you can say you want your iPhone app NOT to run on iPad.
When you select iPhone/iPad for your app type in Xcode, that is telling Apple and iTunes that your app binary is a universal app -- built for both platforms.
may be it's done by apple reviewers according to this guidelines limitation
App Store Review Guidelines:
2.10
iPhone apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution
... or else it will be rejected.
What's the problem? When you start a project you get to choose whether its for iPhone or iPad or both. When you submit it to apple this is also checked against your iOS build version and other things (normally though if there's a conflict it'll let you know before submission - eg: if you haven't included the iPad icons and your app says that its for iPad too).
In XCode4 theres a nice handy interface now that you can use. If you select your project in the left hand pane and click on your main target in the main window you can select the iOS application targets that your app is for.
In your Project settings Version, Device and Deployment Target are where the iTunes Requirements come from. If you choose only iPhone, then your requirements will inlcude iPod touch.
I believe this is the answer you are looking for:
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/App-RelatedResources/App-RelatedResources.html

Resources