• 2015-01-10

    Build adaptive UI for iOS Apps with flow-layout and CSS properties

    Views: 9505 | No Comments

    The project CocoaUI helps you build fluid User Interfaces for iOS Apps run in iOS devices with different screen sizes and resolutions.

    The code demo has shown in this post.

    It is time to get rid you Apple’s AutoLayout and LayoutContraints things, write your UIs with simple CSS properties like float, clear, width, height, and let CocoaUI do the magic for you!

    Posted by ideawu at 2015-01-10 23:32:24 Tags:
  • 2015-01-06

    Build universal iOS static library in xcode for simulator and real device

    Views: 9536 | No Comments

    The default static library target in Xcode does not support iPhone simulator and real iPhone device at once. You have to build your static library for others to use on simulator, and build another for real device.

    With an Aggregate target, you can mix the two library together in one .a file. Here’s the run script for the Aggregate target:

    # define output folder environment variable
    # Step 1. Build Device and Simulator versions
    xcodebuild -target Target -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
    xcodebuild -target Target -configuration ${CONFIGURATION} -sdk iphonesimulator -arch x86_64 -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
    # make sure the output directory exists
    # Step 2. Create universal binary file using lipo
    lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"
    # Last touch. copy the header files. Just for convenience
    cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/include" "${UNIVERSAL_OUTPUTFOLDER}/"
    Posted by ideawu at 2015-01-06 15:58:48 Tags: ,
  • 2015-01-06

    UIView with background image repeated and stretched

    Views: 13032 | No Comments

    You can set the background of an UIView or a subclass of UIView be filled with an image, repeated or stretched.


    UIImage *img = [UIImage imageNamed:@"bg.png"];
    row.backgroundColor = [UIColor colorWithPatternImage:img];


    UIImage *img = [UIImage imageNamed:@"bg.png"];
    row.layer.contents = (id)img.CGImage;
    Posted by ideawu at 14:38:24 Tags:
  • 2014-12-26

    iOS UIKit flow layout views like in web style

    Views: 4226 | No Comments

    I have made a small library to help easy building iOS layout. It will do the UI layout in the famous and popular Flow Layout. Flow Layout is the basic of web browser, it made UI program simple and powerful.

    For years until now, Apple never provide Flow Layout for iOS and Mac OS X developers. The auto-resizing and auto-layout(contrant-layout) is complicated and few useful. You ofter ruin the WHOLE UI design in XCode IB if you make one LITTLE mistake.

    Continue reading »

    Posted by ideawu at 2014-12-26 23:10:39
  • 2014-12-18

    Convert RSA public key to der format

    Views: 3629 | No Comments


    Posted by ideawu at 2014-12-18 22:47:14
|<<<123456789>>>| 3/19 Pages, 91 Results.