Objective C: Custom keyboard extensions with images in iOS - objective-c

I have created custom keyboard in my application.Now i want to display only 8 images at the beginning and later after payment i want to display whole collection of images. I am checking condition for payment if its done then only show all images but i cant debug it why images are not displayed even though condition is satisfied.
Also my question is keyboard view is base class of UIInputViewController so it will hit only once after app execution.
Please any help would be appreciated.

Click on image resources and then File Inspector tab in right side. Check Targets are selected or not.

Related

Codenameone form with header picture - how to navigate?

I'm writing a codenameone application where I want to have an image displayed across the top of the screen as a header. I do not want to include this image in every form/container that I create so therefore I came up with the following solution:
I have a Main form which contains the image (North) and a container (Center) which will then hold all the components of the specific screen that I want to show.
I will then create containers that represent each individual screen. My idea was to add these containers to the container of the main form, one by one and that navigation between them would be handled by changing the contents of that main screen container.
But I cannot find out how to make this work. As long as I have one single screen to show it is easy... The main form container can be an embedded container that is set to show the container for the single screen. But when I try to navigate to another I cannot make it work.
So, is there another approach I should use?
If not, how should I handle navigation between screens?
Is this with a GUI builder app or with a handcoded app?
Either way a simple way of customizing this if your app has a side menu or Toolbar would be to customize the TitleArea UIID to include your background image. E.g. start with a modern theme like the Business Theme and in the designer theme change the title area border property to be "Empty".
Then define the background image to be the image you want with "scaled to fit" or "aligned bottom" depending on what you want. Make sure to include enough space in the image for the title are and use a multi image so it will adapt for other OS's.

Add Stickers in Custom KeyBoard Extension

I am looking to create a Custom Keyboard for iPhone,iPad. I have successfully integrated Phrases and Emoticons into the Keyboard, But couldn't get any idea how to add stickers in the keyboard.
Anyone knows how to add ?
Thanks.
I recently created a custom keyboard for sending stickers on iPhone. I noticed this question is tagged as Objective-C but I will be responding in Swift since that’s how I did it.
If I am understanding your question correctly, “add stickers in the keyboard” may refer to stickers similar to those on Facebook Messenger or Peach. My personal inspiration came from wanting to create something similar to Kim Kardashian’s KIMOJI app. This custom keyboard extension works by allowing the user to tap on a sticker, copy it, and then paste it into an input field to send.
To begin with, I found this great custom keyboard tutorial on AppCoda: Creating a Custom Keyboard Using iOS 8 App Extension (written in Swift). The tutorial walks you through how to create a new keyboard extension within an app, add a view which holds buttons (or keys), and apply appropriate constraints. However, I found all the details of creating keys less necessary for a sticker keyboard.
Following the tutorial, once you create a basic keyboard with a KeyboardViewController and KeyboardView xib, I added UIButtons. In my case, I added six buttons to correspond to six stickers. The first UIView row and second UIView row both held three buttons each. I applied constraints so that each button was equal height and width (approximately 100 x 100). In Storyboard, I clicked on each button and in the attributes inspector I set the button “image” property to the corresponding sticker image I had in my assets. Also, to determine an appropriate height for my keyboard, I found this helpful resource: iPhone Development 101 - iPhone & iPad Keyboard Sizes.
Note: In order to create stickers you need images of some sort. I drew / designed my own. You could also design them using Adobe Illustrator or an equivalent program.
Once you set the images for each button and run the app, the images may not appear. To fix this, I had to visit my sticker keyboard Target > Build Phases > Copy Bundle Resources to ensure Assets.xcassets was included. Running the app again, the images appeared.
Next, assuming you have created a KeyboardViewController that corresponds to your KeyboardView.xib, you can create a corresponding #IBAction for each button/sticker in the view controller. We want the user to copy the sticker selected to Pasteboard so they can send the stickers. To enable your custom keyboard to access Pasteboard, go into the keyboard extension’s Info.plist file. Under Information Property List > NSExtension > NSExtensionAttributes, change the RequestsOpenAccess property to YES.
Now, the IBAction method you created can assign the appropriate sticker image path to the Pasteboard! This is very generally how my code looked:
#IBAction func stickerPressed(sender: UIButton) {
let image = UIImage(named: "sticker")
UIPasteboard.generalPasteboard().image = image
}
When you run and test your app on a device and install it, click the globe icon on the keyboard to switch to your custom keyboard. Tap on a button/sticker, then tap in an input field to paste. In Facebook Messenger, options may appear to “Send Photo” “Edit” or “Cancel.” In Peach or Messages, it will send inline. It just depends on the app.
This process worked for me and I hope it can help someone else out there!
You can create UIImageView inside UICollectionView or UITableView, and show sticker images inside these UIImageViews. And when user taps on them, just get the UIImage present in that view.

Multiple ImageView's that allow for deletion

I am currently trying to add multiple imageviews like in this picture (http://i.imgur.com/DEkoBD0.png) to a view controller. I would also like the option to be able to delete specific images, and also have the whole view controller in a scrollview incase the user wants to add numerous images.
So far I have one imageview that can be set to either a picture from the camera or from the photo library, what I would like is when a user add's a image, another option displays next to it to upload another image such as the picture in the link I provided.
I am currently using the Xcode 5 with storyboards and developing for iOS 7 also.
Any help is appreciated.
Thanks.
Simply use a UICollectionView !
Reference : https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/Reference/Reference.html
It will allow you to add functionalities like delete or add for example (w/ ScrollView ;) )!

wait_fences: failed to receive reply: 10004003

i am trying to add splitview into my project code.
I understand that most of the SplitView project have their splitview loaded on the main window.
but i need to have other views before i come to the split view. That's the reason that i added split view to one of my view controller.
i have successfully added my split view.. but currently whenever i change the orientation of my ipad, wait_fences: failed to receive reply: 10004003 will be thrown on the debugging window and will have a lag time during the orientation change.
i have tried to look around for a solution but i failed.
anybody have any idea?
many many thanks!
p/s:i would like to upload my project code.. but i am not sure how to do it.. any tips will be great!
A quick search in Google and clicking the very first link revealed this: http://www.iphonedevsdk.com/forum/iphone-sdk-development-advanced-discussion/17373-wait_fences-failed-receive-reply-10004003-a.html
You can upload your code to a filesharing website and post the link or copy the code into your question and format is accordingly using the "101010" button on top of the text view where you enter the question into.
I had a similar issue. Basically I believe that some UI elements (in my case, an alert box) was delaying some of the other UI elements in the split view to show up. I put my alert box in the didFinishLaunchingWithOptions method (it executes when a flag becomes true) so I no longer get the error (as all the elements are displayed by that point)
Hope the advice is useful for you. good luck.
Edward

Animating Tab Bar page switching

I'm quite confused with the whole animation stuff in iPhone SDK. I tried to study throught the SDK documentation, this website or tried googling it out without success.
I'm unable to get my scenario work.
I have single XIB file, with tab bar and a 4 tabs.
In a special event i want to switch from one page to another "in code", so I call eg: [tabController selectedIndex: 0].
I need this transition to be animated. Is there a way?
If user switches tabs manually, no animated transitions are needed
Also I have one subquestion:
In one of the tabs I have a UITableView with set of items. When user clicks any of these items, another set of items are beign shown (sort of hierarchy browser)
I tried to animate this transition using -deleteRowsAtIndexPaths:withRowAnimation: and -insertRowsAtIndexPaths:withRowAnimation:, but without luck.
Desired transition is shifting the old items set to the left side and the new items from the right side.
This is first time of my iPhone development, when I got lost even with all the forums and documentation. :)
Thanks in advance to anyone trying to help me!
As for your first question: Yes you can.
Try this link for some answer:
transition on tab bar sample code.
In short words: you should add a delegate object to handle the tab bar switching by setting the tabBarController.delegate = self.
Yet, what this forum post won't tell you is that you need to "import" some framework to do it.
First - right-click on the framework folder on the left hand list in Xcode and add an existing framework named: "QuartzCore.framework".
Than - add these lines to your tab bar holder (on .h file):
#import <QuartzCore/CAAnimation.h>
#import <QuartzCore/CAMediaTimingFunction.h>
As for your second question, try to replace the datasource (array or what ever) or create login function on the cell to replace its content.
Enjoy!
First Question: No, you can't animate tab switching. Please read Apple's Human Interface Guidelines on this. Tabs are meant to switch instantly. An animated transition would break the "tab" paradigm.
Second Question: When you tap on a row, the user does not expect other rows to disappear and new ones to appear. Instead, this sounds like a case for a UINavigationController. Please refer to Apple's sample code, specifically the UICatalog for sample code on how to implement this.