Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 11    Views: 129

Merchantguy
Aspiring developer
Profile
Posts: 21
Reg: Feb 10, 2012
SLC
210
03/10/12 10:54 PM (13 years ago)

Using .xib files in building a plugin

Hey all, I've got a small native app working I'm working on turning into a plug-in (it allows you to connect a card swiper and process payments) but I've used interface builder and have .xib files to help render my views. In looking into other plugin code I haven't seen any .xib files, but rather displays being coded in the controllers. Before I go down the road of trying to make a plugin I want to make sure that buzztouch doesn't have any conflicts with using .xib files for interfacing . . .does it? If so I will just go back and re-write but I don't want to spend a bunch of time trying to get it to work and De-bugging only to find it's not supported. Thanks!
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
03/11/12 07:34 AM (13 years ago)
I've used .xib files while calling a custom plugin in BT. Works just fine. In the existing plugins, I believe you dont see any .xib files because they all re-use the main views created by BT already.
 
Merchantguy
Aspiring developer
Profile
Posts: 21
Reg: Feb 10, 2012
SLC
210
like
03/11/12 02:00 PM (13 years ago)
Awesome - thank you!
 
Merchantguy
Aspiring developer
Profile
Posts: 21
Reg: Feb 10, 2012
SLC
210
like
03/12/12 07:06 AM (13 years ago)
Hey all, I know at one time there was a pdf guide to making a custom plugin but the link no longer works - any idea where I can get a copy? I'm almost there but probably missing something really simple and some docs would be nice. Thanks!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/12/12 07:39 AM (13 years ago)
@Merchantguy: Account > Self Hosted Servers (on right side of this screen in resources)
 
Merchantguy
Aspiring developer
Profile
Posts: 21
Reg: Feb 10, 2012
SLC
210
like
03/12/12 07:41 AM (13 years ago)
Well don't I feel sheepish . . . thank you.
 
theGreek
Aspiring developer
Profile
Posts: 648
Reg: May 25, 2011
Schaumburg, IL
7,830
like
03/12/12 12:40 PM (13 years ago)
It would be great to get a better understanding of how to mix the .xib files into the BT projects. Having the best of both worlds I dare say. I would assume then by doing that you truly get a free form approach to designing a screen say with Buttons. Is that correct. Being able to use the xcode Builder to create the screen and move buttons around free-form vs the Grid, Vert and Horiz .
 
Merchantguy
Aspiring developer
Profile
Posts: 21
Reg: Feb 10, 2012
SLC
210
like
03/12/12 12:43 PM (13 years ago)
thus far it's been relatively simple. I've just included it in my source code folder for ios and it loads up great.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
03/12/12 12:57 PM (13 years ago)
Yes, gbakakos. Its opens up a whole new world of customization. But with that, it opens a whole new world of learning, too.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
04/17/12 10:58 AM (13 years ago)
great thread here. a card swiper to process payments in an app? that makes the whole world a kiosk! no more RS232 connectors. they just started using this in a deli in my building concourse. i saw it and thought 'bet those guys at VIVO are not happy about that...' i just started tinkering with making my first plug-in. trying something calendar related as i want to see if i can use the native iOS calendar in my app. i'm planning to 'repurpose' code as suggested in the BT Plugin HOW to Guide. i've found some great calendar xcode projects/examples out there. to start - I'm following an iOS tutorial that teaches you how to use the XCode Builder Screen to create an .XIB screen. as it sounds like you guys have some key steps figured out here. is this the method you used to get this going..? 1) Start by creating a new, NON Buzztouch, Xcode project 2) Use the XCode Builder to make the screen (.xib file) and then you just copy all the files from the new 'project' into which folder exactly? is it that 'my_first_plugin' folder that you create when you make your first demo plug-in?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
04/17/12 07:52 PM (13 years ago)
Generally speaking, iOS needs three files when using .XIB files. a) The .XIB file itself (this is the design view file you use to layout the screen) b) The .m and .h file for the class you "connect" to the XIB file. Every XIB file is connected to a class file. Three files in total (in the simplest case). When turing this into a plugin, add the three files tot he source-ios folder in your plugin. These files will be added to the BT_Plugins folder when the app is packaged using the control panel. When the user drags the BT_Plugins folder into their Xcode project, it won't matter where they are added in the project. In other words, Xcode doesn't care how images, audio, class files, xib file and other assets are organized before adding them to the project. Drag them over the project - "Add Files" - should work.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
04/18/12 08:38 AM (13 years ago)
prefect, exactly what i needed to know on the file locations. thanks. the more i started watching tutorials on this, the more i kept seeing that Interface Builder and XIB files. that's where i was having disconect from BT as i didn't see them in there. But now that you've bridged the gap and explain how the current BT screens are generated dynamically and shown how/where XIB could be used in BT, i can trudge on. (you do need a video or hands on demo when learning to using GUI tools like the IB) next question: UINavigationController seems to be the first thing most tutorials are teaching me so that i can Navigate between my screens. but the way the BT screens are generated dynamically now, (BT_ViewUtilities, correct?) you seem to be handling all the UINavigationControler actions for us? i would need to code my own UINavigationController(s) if i want to link to more than just one XIB screen i create in my plug-in? but as long as i have a Top Navigation Bar in my app (specified by the BT Control panel on my new plug-in screen), i'll be able to navigate back to my standard BT screens from my "new" screen sans any new UINavigationController code? my demo app so far seems to work like this and i'm happy with this functionality to navigate. it keeps them in the APP and we all know Apple will like that. so now looking at the .m file and see the line that says: //put code here that adds UI controls to the screen } that is the area where we start to make the magic happen with UIViewControllers? all of the the text below //view will appear this is the BT "UINavigationController" code?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.