How can I set background image using xml file like android ? - ios

I want to create a button with the background. But I want to set using the xml file as same like android have.
Is there a way to achieve this ?

Simply put, you cannot directly port your Android specifics or liberties in XCode/Objective-C. You must learn atleast the basics.
For your specific query, you can use the following answer
Set a button background image iPhone programmatically
Also, I would firmly suggest you start learning Objective-C. There are ample resources out there:
APPLE.
Ray Wenderlich
Cocoa Dev Central
iPhone Dev SDK
Geeky Lemon
and many many many more ...

Related

Using Ray RLlib with custom simulator

I'm very new to Ray RLlib and have an issue with using a custom simulator my team made.
We're trying to integrate a custom Python-based simulator into Ray RLlib to do a single-agent DQN training. However, I'm uncertain about how to integrate the simulator into RLlib as an environment.
According to the image below from Ray documentation, it seems like I have two different options:
Standard environment: according to the Carla simulator example, it seems like I can just simply use the gym.Env class API to wrap my custom simulator and register as an environment using ray.tune.registry.register_env function.
External environment: however, the image below and RLlib documentation gave me more confusion since it's suggesting that external simulators that can run independently outside the control of RLlib should be used via the ExternalEnv class.
If anyone can suggest what I should do, it will be very much appreciated! Thanks!
If your environment is indeed can be made to structurized to fit Gym style (init,reset,step functions) you can use first one.
External environment is mostly for RL environments that doesn't fit this style for example Web Browser(test automation etc) based application or any continual finance app etc.
Since you wrote that you work with a custom Python-based simulator, I would say that you can employ PolicyClient and PolicyServerInput API. Implement the PolicyClient on your simulator (env) side and provide the PolicyClient with data from the simulator (observations, rewards etc.). This is what I think may help you.

Fix to get my wishes?

I have problems in myself when I drive cars 🚘 I forget to slowly in some way have cameras 🎥 speed in high ways so I thinked if possible to make IOS APP to fixing these problems I explain my thing in image but I can't convert to coding by this step ?
1-After to speed camera 🎥 100 Miter Alerts me app( (there are camera speeds pleas slow down your speed.))
2- just post code i have basic programming languages in swift.
I'm not sure if I got you wright, so please correct me if I'm wrong.
You want an iOS app that tells you if there is a speed camera on the road you're driving, right?
So you have some possibilities to achieve that:
you can have a look at the app store. There are lot of such apps (e.g. TomTom) (easiest way)
if you want to build your own app you can make a use of the navigation sdk provided by mapbox: https://www.mapbox.com/help/ios-navigation-sdk/ (some programming skills needed)
Build your own app from scratch (much work and advanced programming skills)
If you want to build your app by mapbox or on your own you'll need the GPS-locations of speed cameras like provided here: https://www.scdb.info/

iOS SDK - How to know which kit, class to use?

I'm new to iOS development and was wanting to know how to efficiently locate which kit, class to use to achieve certain things.
For example, I'm planning to build an app that heavily makes use of calendar events and I found that I should be looking at using something like eventkit to build upon but it's not clear for me within this kit which class to instantiate and which method to use in what order.
Can someone please direct me to a place where I can see some code examples of using a range of different kits?
I think you can learn things as you described from 'Reference'.
Two ways to check Apple Official References in Xcode. One is clicking the function name, parameter or those colorful keywords while you pushing the 'option'. The second way is using three fingers to touch those "keywords" slightly on the touchPad.
Or you can check many kits references by visiting iOS Developer Library (website). I'm also new to iOS Development, I wish things I said can help you.

Understanding Newsstand App

I have a big question about how newsstand works.
When you have to create a new magazine(issue), how do you do it?
I mean, Do I have to implement new code for each magazine (with new views and new view controllers) which doesn't look the same as the others and has interactive content? In this case, how do I add/upload/integrate them to my newsstand app which is already in the market?
In the case that It doesn't work in this way, How does it work?
Thank you very much in advance.
Your question really goes to the heart of how Apple has chosen to implement Newsstand. Basically, there are three possibilities for using Newsstand: use image/pdf content, use HTML5 content, and use the CoreText native API.
I take it from what you are saying that you would like to use the CoreText API. This is difficult to do in the Newsstand framework for the reason you suggest: you really are not supposed to upload a whole new app with each edition.
There are two possible solutions. The first is simply not to use Newsstand. Instead you can publish your magazine as an app, and simply upload a new app for each edition. This means you miss out on things such as subscriptions and the "double-listing" promotion of Newsstand, but you can make high-quality, native, custom interfaces.
The second is to do what I am in the process of doing right now, which is to develop something like an XML encoding that when loaded into your base app will generate the kind of interface you want.
At least that is my analysis so far. I would be so pleased to be told I'm wrong, really. But I do think this is one of those cases where Apple hasn't really thought through what they are offering. Maybe next year it will get better!
If you use the Baker framework you can download the interface elements (html, images) as "issues" and the code part (Baker framework) will stay the same.
To add a new issue you do the same as you do with downloading the PDFs using NKAssetDownload. If you're using Baker you will want to extract the whole "book" into the documents directory.

iOS sample projects to learn from

I am just starting iOS development. I read some tutorials, watched stuff on iTunes U and wrote some sample code myself. Now I want to take the next step. I want to learn about best practices for iOS development in XCode.
Are there any well written and well organized iOS projects that one could take a look at?
(As I see it, iOS is not exactly the place for open source enthusiasts, however.)
Thanks
Mike.
I agree with several of the other answers that state that looking at many, many projects for mini-examples of what you want to do in your own app is the way to go.
However, you asked for an example of an app demonstrating best practices.
You could do worse than to read Matt Gallagher's blog, Cocoa with Love from beginning to end. However, the app example you asked for is right here.
Not only will it show a variety of techniques, some novel design and best-practices, but also he points out where he feels that he might have done something better.
It's a great read.
I would suggest the following process: (it worked for me)
Think of an advanced app. that you eventually want to be proficient enough to create.
Make a top-down problem-solving tree containing the necessary skills required to build your final app.
Use this tree to divide your final app. into 'sub apps'. Start at the bottom of the tree, find a tutorial specifically for that skill, and make a "Hello World" app. that uses that skill.
Keep progressing upwards, creating 'sub apps' as you go.
When you are finally ready to make your final app. (it will take a while), you will have a good handle on how iOS development works. It will also be a great test of your knowledge via direct application!
Getting the hang of iOS development can be tricky; it really does require a top-down approach, and every online resource I've found takes a linear one. The only way that I think a linear approach to learning iOS development would be manageable, is to take it one small task at a time.
As for specific resources, I always google "[what I want to do] iPhone SDK" and browse the tutorials and forum posts that come up.
Here are some open source iOS apps. However, they aren't very well documented and are also very advanced.
TKAWebView - A subclass of UIWebView that handles authentication and downloading.
Welcome to your Mac - An iOS app. to VNC into a PC/Mac and do some cool stuff.
InAppSettingsKit - A settings screen creator for your apps.
Good luck!
The people behind the Parse platform have made two complete projects.
For each project there is the complete source code, a tutorial and the resulting app is also available from the AppStore.
Anywall: https://parse.com/anywall
Anypic: https://parse.com/anypic
They both rely heavily on the Parse platform as the data source, but you still get a feel for an iOS project.
Molecules is a great open-source app that uses 3D OpenGL to render complex models of molecules.
Just keep coding my friend. You'll learn over a period of time. The best way to get dirty in a mud fight is to jump into it... Weird analogy but you get the point.
Maybe someday, we all will learn from you then !
Like you said there many and many source codes are available internet, but most are incomplete.
I found some Open source codes of REAL application currently available through Apple app store are given here
Free iPhone App Source Codes of real apps
and also, you can find many answers here on stackoverflow question - Are there any Open-source iPhone applications around?
You can download free IOS sample projects from http://devcodemarket.com
I realize this is an old thread but I've also been looking for good objective-c code examples recently and I just realized that TextEdit's source code is available at the Mac Developer Library webpage.
Also, here are some popular objective-c libraries that have caught my attention:
CocoaPods
AFNetworking.
you can also go through UICatalog from Developers Library and download the sample code. just google it and you will find a project containing all basics of iphone.
I don't think there is any perfect project that can demonstrate all the qualities of great code. Developers have stylistic preferences and may make mistakes. That said, you should look at a lot of different projects and try to look at the conventions used.
I'd suggest starting on GitHub. Besides for seeing code, you'll see what libraries are out there, which may help further your projects later on. Here's the Objective-C page on GitHub.
(Also, I (GitHub link) think you're wrong about iOS devs not being in favor open source. Yes, there's money to be made, but you can't sell a CSV paring library on the App Store as is.)
Have a look at https://github.com/mozilla/firefox-ios
That is Firefox for iOS, written in Swift.
Cocoacontrols has a wide range of controls written using Objective-C & Swift.
I believe these days, this is one of the most famous website for iOS Developers.
But, before you jump onto this, you have to learn Objective-C & Swift very well, so that you will understand how to use the controls in your app which makes your app smooth.

Resources