Saturngod

What's on my mind

Enable Bitcode in library file (.a)

After enable bit code in Xcode 7 , I couldn’t build .a file with embed-bitcode. Same problem for the zbar library , too. So, I cannot use my own library with .a file or cannot use the zbar for production. After searching from google , I found a way to build. We need to use the command line with xcodebuild.

I wrote the build.sh like following and same folder with myproject.xcodeproj

folder="Release"
project_name="mycustomlib"
lib_name="libmycustom"
name_simulator=$lib_name"_simulator"
name_device=$lib_name"_device"

xcodebuild OTHER_CFLAGS="-fembed-bitcode" -target $project_name build
xcodebuild OTHER_CFLAGS="-fembed-bitcode" -sdk iphonesimulator -target $project_name build
rm -r build/Production-SDK
cp -r build/$folder-iphoneos build/Production-SDK
cp build/$folder-iphonesimulator/$lib_name.a build/Production-SDK/$name_simulator.a
mv build/Production-SDK/$lib_name.a build/Production-SDK/$name_device.a
cd build/Production-SDK/
lipo -create $name_simulator.a $name_device.a -output $lib_name.a
rm $name_device.a
rm $name_simulator.a
file $lib_name.a
open .

In the build.sh , folder is your release folder name. zbar is using Distribution-iphoneos and Distribution-iphonesimulator .

If you using your own , it may be Release-iphoneos and Release-iphonesimulator. lib_name is your .a library name. In Zbar , it’s using libzbar . project_name is your traget to build. Sometime , lib_name and project_name is different in the project.

After chasing this two, you can run in terminal like

sh ./build.sh

Need to wait until finishing the build and then it will show your lib.a file. In the terminal , you can check , it’s showing what platform are supporting.

If it doesn’t support i386,x86_64,armv7,arm64 , you need to open your project. Go to Build Settings -> Valid Archtectures. Add all architectures like following

  • armv7
  • armv7s
  • i386
  • arm64
  • x86_64

Don’t forget to change Build Active Architecture Only to NO

iOS 6 include new font fall back system

In iOS 5, they only search glyph for missing code at fallback.ttf . However, they changed in iOS 6. In iOS 6, they search the whole font list.

How Do I know ?

In Xcode , add MON3 Anonta 1 in info.plist (UIAppFonts).

Just used UITableViewController and add around 20 rows.

Use text like following.

cell.textLabel.text = [NSString stringWithFormat:@"လက်ရှိ နံပတ် %@",[self numberToMyanmarNumber:indexPath.row]];

We are using Myanmar Unicode and run on iOS 5 simulator.

It didn’t show font and we can scroll smoothly.

Now, let run on the iOS 6 simulator. We will see result like following

Some of the glyph are appear without declaration of the font. It can’t show well yet. But it’s a problem of not working well with some users like me. I can’t use facebook , email because I have a lot Myanmar friends and they are using and sending email with Myanmar Fonts. iOS didn’t support Myanmar Fonts but they are trying to find in all fonts. So, UITableView glitches on fast scrolling.

I hope, Apples will use iOS 5 font fallback problem for us. Myanmar , Khmer and some country didn’t use well with iOS 6 because this fall back system.

Is it best ?

Yes, it may be good for feature. Apple can support new font easily in futture and no need to put on fallback.ttf. Just add new fonts if they want to support. It easy like that in future.

Is it bad ?

Yes, it is bad for me. If apple didn’t support some language like Myanmar , Khmer , it trouble a lot in all of the apps like facebook , email , twitter ,etc.

Tweetbot Like UI

Here is a collection of Tweetbot Like UI for iOS

Tweetbot Like UIAlertView And UI Segment

Source Code at Github

Tweetbot Like Notice View

687474703a2f2f636c6f75642e6769

Source Code At Github
 

Tweetbot Like Tab Bar
 

687474703a2f2f692e696d6775722e636f6d2f71597a45722e706e67
 

Source Code At Github
 

Tweetbot like Spinner
 

ndGAM5XxeD1RmEFTK/screenshot.png">Screenshot
 

Source Code At Github
 

 

Facebook SDK with iOS 6

Update: Facebook already release for iOS 6 (Xcode 4.5)

Today , iOS 6 release and I updated my phone. However, I couldn’t run the project that is using facebook iOS SDK. I found , new Xcode 4.5 have include armv7s Architectures. However, facebook iOS SDK didn’t include this Architectures. So, we need to built our self.

Download facebook source code from https://github.com/facebook/facebook-ios-sdk .

Open the project ( src/facebook-ios-sdk.xcodeproj ) after downloading the facebook ios sdk.

Change the project setting (Architectures , Base SDK) and then save it and close it.

To compile the source , open the terminal.

Go to scripts folder of facebook ios sdk.

run

sudo ./build_all.sh
You will get the new FacebookSDK.framework at build folder after building is completed.