How to create a static library using swift 4? - swift4

I would like to know how I can create a Cocoa touch static library using swift 4. I searched in several places but just found vague information. Help me please!

Simple sum step to create Cocoa touch static library.
Step 01: create a new Xcode project.
Step 02: Chose a template -> iOS -> Framework & Library -> Cocoa - Touch Static Library then click next.
Step 03: Write your Library Project name and set our other info then click next.
Step 04: chose your library project location then lick Save.
Step 05: write your logic what dose library project.
Step 06: go to Product menu then click Build Library project.
Step 07: after build your see Your left navigator under product see your libraryName.a file this file move your project the used your library project.
Note: If your not clear please see this video https://www.youtube.com/watch?v=GMYxlkOE35k&t=5s
I think help you.

Related

Add 2 frameworks inside another new framework

I'm trying to generate a swift framework which integrates 2 smaller frameworks developed in objective-c. The idea is to wrap them in order to be able to use them adding only the new framework in a Swift 5 project.
Can I generate it by only adding those 2 frameworks?
Maybe doing some Swift code which does some middle work?
I followed these steps:
1.- Created SDK project.
2.- Inserted both frameworks
3.- In the .h file, added imports to make them public.
4.- Added swift code configurating classes and function as public (most important step)
5.- When swift code was working, deleted in the .h file the imports in order to make both frameworks unaccesibles.
Hope this will help.

Fabric(twitter api) setup issue. Using swift

Hi I am using the Twitter API for the first time and have little experience with APIs in general. I installed the fabric app and am following the documentation to integrate twitter using swift.
When I build my app and install the twitter option on fabric, it asks me to run my code.
When I do that I get a 'Signal SIGABRT' error on the line Fabric.with([Twitter()]) in the AppDelegate.swift file.
Before this I had added the import TwitterKit line to the AppDelegate.
I also tried to add these lines following the API documentation:
Twitter.sharedInstance().startWithConsumerKey("your_key", consumerSecret: "your_secret")
Fabric.with([Twitter.sharedInstance()])
and then the error comes in the Twitter.sharedInstance() line.
I am adding these lines in the func Application method.
From the language I use, it is very evident that I am a newbie to programming and really need good help smiley
Thanks in advance.
To fix the problem, I did the following:
Open XCode Target
Go to the "Build phases" tab
Click the "Copy bundle resources" section
Click the add button
Add TwitterKitResurce.bundle

Getting error in app porting

I am porting an app from HVGA (Bada 2.0.2 device ) to WVGA( Bada 1.2) using ecllipse( version 2.0.2 ).
For this I have done the following changes in my project
Project-> Properties/Bada build
Set Model WVGA and set AutoScaling true(480x800)
I have create a form of Resolution 480x800.
For images I have add a folder in Resouce folder
-> 480x800
->ScreenDensity-High
and place all my resources in these folder .
But my app crashes when I click the button in the app to Select more images as requirement in my app and the log show Output as Shown
Info, Installation completed.
0080.772,EXCEPTION,P32,T00,A125,Osp::Media::__Image::HasAlphaChannels (1547) > [E_UNSUPPORTED_FORMAT]
0080.774,EXCEPTION,P32,T00,A125,Osp::Media::Image::HasAlphaChannels (599) > [E_UNSUPPORTED_FORMAT] Propagated.
0080.851,EXCEPTION,P32,T00,A125,Osp::Media::__Image::HasAlphaChannels (1547) > [E_UNSUPPORTED_FORMAT]
0080.851,EXCEPTION,P32,T00,A125,Osp::Media::Image::HasAlphaChannels (599) > [E_UNSUPPORTED_FORMAT] Propagated.
I had check for this in the Bada Help but unable to find solution.Please give your suggestion to solve this problem
As I see you just moved your Images (optimized for HVGA) to a new folder to use them for WVGA.
If I understand it correctly, I suggest that you with the reference of bada development documentation in your SDK (through bada IDE help system) which specifies that what is the specific images properties for WVGA screens, change your images properties to a compatible ones (re-size them) and rebuild your project.
I think the problem will solve , we like your feedback.
best regards.
I find the reference for you mate: Using Customized and Optimized Resources

iphone twitter code explanation

what is this step doing?
following a tutorial to integrate twitter into an iphone app , this steps is done in the target>
If we right click on this and select Get Info we will see the info about our target. From here we click the build tab and search for the field “Header Search Paths”. You need to add the following into the Header Search Paths:
$(SDKROOT)/usr/include/libxml2
the build works fine, but I want to know what is that accomplishing, linking a library? why not from the normal way of adding libraries?
thanks a lot!
Linking the library is a separate task. This is so the compiler knows where to look when you #import <libxml/...>.

how to integrate ASIHTTPRequest to iphone project

I am trying to add ASIHTTPRequest library to my iphone project
i followed these lines
Integrating ASIHTTPRequest
ASIHTTPRequest is a powerful open source library written by Ben Copsey from All-Seeing Interactive (and he’s a fellow cocos2d developer too!) It makes it easy to post data and files, and has tons of other great features too like cache support, easy access to HTTP headers, cookie support, and much more.
So let’s add ASIHTTPRequest to our project. Take the following steps:
1. Download the latest version of ASIHTTPRequest.
2. Back in FBFun, right click FBFun under “Groups & Files”, click “Add\New Group”, and name the group “ASIHTTPRequest”.
3. Drag all of the files from the “pokeb-asi-http-request-xxx\Classes” to your new group. Make sure “Copy items into destination group’s folder (if needed)” is checked, and click “Add”.
4. Repeat the above for the 2 files in “pokeb-asi-http-request-xxx\External\Reachability”.
5. Right click the Frameworks folder, and click “Add\Exisitng Frameworks…”. Choose CFNetwork from the list, and click Add.
6. Repeat the above for SystemConfiguration.framework, MobileCoreServices.framework, CoreGraphics.framework and libz.1.2.3.dylib (at the bottom of the list).
7. Compile your project. If it works, you’re integrated!
We’ll explain about how ASIHTTPRequest works when we start to use it. But first, let’s integrate the JSON Framework while we’re at it.
but it not worked for me .while building it showing errors
/Classes/Tests/GHUnitTestMain.m:32:26: error: GHUnit/GHUnit.h: No such file or directory
can anybody help me in this issue
Regards
Thanks
*Edit :
I fixed my problem by following these steps
http://allseeing-i.com/ASIHTTPRequest/Setup-instructions ,
If any one want to integrate ASIHTTPRequest just follow those steps :)*
You will need to add the XML library (it's missing in the instructions), and also make reference to it in the project header search paths with the following:
$(SDKROOT)/usr/include/libxml2