working on it ...

Filters

Explore Public Snippets

Sort by

Found 101 snippets matching: ios7+

    public by marksimon232 modified Jun 23, 2014  5312  8  6  3

    Base64 Decoding in iOS 7+

    Do you have Encoded text(NSString) using NSData Class new API which is Added in iOS7?
    Objective-C
    
    NSString *plainString = @"foo";
    Encoding
    
    NSData *plainData = [plainString dataUsingEncoding:NSUTF8StringEncoding];
    NSString *base64String = [plainData base64EncodedStringWithOptions:0];
    NSLog(@"%@", base64String); // Zm9v
    Decoding
    
    NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:base64String options:0];
    NSString *decodedString = [[NSString alloc] initWithData:decodedData encoding:NSUTF8StringEncoding];
    NSLog(@"%@", decodedString); // foo 
    Swift
    
    let plainString = "foo";
    Encoding
    
    let plainData = (plainString as NSString).dataUsingEncoding(NSUTF8StringEncoding)
    let base64String = plainData.base64EncodedStringWithOptions(NSDataBase64EncodingOptions.fromRaw(0)!)
    println(base64String) // Zm9v
    Decoding
    
    let decodedData = NSData(base64EncodedString: base64String, options: NSDataBase64DecodingOptions.fromRaw(0)!)
    let decodedString = NSString(data: decodedData, encoding: NSUTF8StringEncoding)    
    println(decodedString); // foo 

    external by Apisit Toompakdee modified Jun 30, 2013  197380  1  4  0

    Remove that 1px line from UINavigationBar in iOS7

    Remove that 1px line from UINavigationBar in iOS7: gistfile1.m
    [self.navigationController.navigationBar.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        if ([obj isKindOfClass:NSClassFromString(@"_UINavigationBarBackground")]){
            UIView* v = obj;
            [[v.subviews objectAtIndex:1] removeFromSuperview];
           *stop=YES;
        }
    }];
    
    
    

    external by Tantas modified Oct 10, 2014  698  2  3  0

    iOS7+ Remove UITableView Separator inset

    iOS7+ Remove UITableView Separator inset: UITableView_Seperator_Inset_Removal.m
    // Place in implementation of UITableViewDelegate
    
    #pragma mark - Remove Seperator Inset
    
    // Refer to http://stackoverflow.com/questions/25770119/ios-8-uitableview-separator-inset-0-not-working#answer-25877725
    - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
            [cell setSeparatorInset:UIEdgeInsetsZero];
        }
        if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
            [cell setLayoutMargins:UIEdgeInsetsZero];
        }
    }
    
    - (void)viewDidLayoutSubviews
    {
        if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
            [self.tableView setSeparatorInset:UIEdgeInsetsZero];
        }
        if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
            [self.tableView setLayoutMargins:UIEdgeInsetsZero];
        }
    }
    
    

    external by roachhd modified Sep 29, 2014  9  0  1  0

    My read me file md to html for iOS7 CSS UI kit on Github From http://roachhd.github.io/ios7-css-ui/

    My read me file md to html for iOS7 CSS UI kit on Github From http://roachhd.github.io/ios7-css-ui/: index.html
    <p>Thank you for checking out my UI kit. </p>
    <p>To compile with Sass, run the following command: sass —update scss:css </p>
    <p>If you have any questions, feel free to email me at: <a herf="mailto:katie@roachhd.com">my email</a>.</p>
    <p>Happy coding!</p>
    <p><a href="http://test.roachhaus.com/test/2013/ios7-css-ui/">My Demo</a></p>
    <p><a href="http://roachhd.github.io/ios7-css-ui/">Github Pages</a></p>
    <p>Please give it a STAR or FORK it and make it better!</p>
    
    

    external by designerJordan modified Sep 22, 2014  125  0  2  0

    HLS Alternate Audio Tracks - iOS7 vs. iOS8

    HLS Alternate Audio Tracks - iOS7 vs. iOS8: HLS-alt-audio-iOS8.md
    # Changes to HLS Alternate Audio Tracks
    **iOS7 vs. iOS8**
    
    Since iOS 8 went live on Friday and I updated a few of my devices over the weekend, I decided to do some quick testing of web video playback. Wanted to see if there were any little, undocumented changes that would affect REPlayer, or our general approach to HTML video - like the changes to exiting fullscreen video that came in the update from iOS6->iOS7<sup>[1](#1)</sup>.
    
    Overall, things seem pretty much the same between iOS7->iOS8, and in a quick runthrough, REPlayer looks to be working just fine.
    
    One interesting change to note though, is that the native interface (iOS default controls used when video is fullscreen) for selecting Sub-Title/CC tracks - or Alternate Audio tracks when they're available -  no longer seems to recognize/display the audio tracks in iOS8.
    
    Sub-Title selection still works just fine, but the Audio Section (and Audio Tracks) do not display in iOS8. Confirmed that the testing m3u8 still contains Alternate Audio tracks in the manifest. Viewing the same video on a device running iOS7 will display, and allow the selection of, both Sub-Title and Audio Tracks, while iOS8 will only display the subtitle tracks.
    
    Off the bat, I'm assuming this is a bug, not a feature, and it will be addressed in future updates, though it could also be a result of the transition from QTKit to AVFoundation as the new iOS Media Framework<sup>[2](#2)</sup>. One other possible cause for the discrepancy, is the different versions of WebKit used between the two<sup>[3](#3)</sup>.
    
    ----
    
    ##### Notes and non sequiturs
    
    
    <h6 id="1">1</h6>
    <small>**In iOS6** - when you switched to fullscreen video, there were 2 options available for exiting fullscreen:
    * One was to tap the "Exit Fullscreen" icon in the lower right side of the control bar (Two arrows on a diagonal that were pointing inwards towards each other - the inverse of the icon used to enter fullscreen)
      * This would exit fullscreen, and maintain the current playback state of the video, i.e., if the video was playing in fullscreen, it would continue to be playing after leaving fullscreen - if the video was paused in fullscreen, it would remain paused after leaving fullscreen
    * The other was to tap on the text-button "DONE" in the upper left of the fullscreen interface
      * This would exit fullscreen and pause the video, regardless of current playback state 
    
    **In iOS7** - the "Exit Fullscreen" icon was removed, and the only option was to use "DONE" - this meant that whenever you exited fullscreen in iOS7, the video would be paused every time. Meaning that an extra tap on the Play Button was necessary in order to resume playback.</small>
    
    <h6 id="2">2</h6>
    <small>AVFoundation was added in iOS 7 and existed alongside QTKit, though developers were strongly encouraged to make the switch - Have not yet found explicit documentation of the status/availability of QTKit in iOS8</small>
    
    <h6 id="3">3</h6>
    <small>
    * User Agent String of an iPhone 5S running iOS __8.0__ reports WebKit _v600.1.4_
      * Full User Agent String -  
        `Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A365 Safari/600.1.4`  
    
    * User Agent String of an iPhone 5S running iOS __7.1__ reports WebKit _v537.51.2_
      * Full User Agent String -  
        `Mozilla/5.0 (iPhone; CPU iPhone OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D167 Safari/9537.53`</small>
    
    

    external by tangyumeng modified Jul 19, 2014  80  0  1  0

    iOS7 适配屏幕

    iOS7 适配屏幕: shipei
    #define IOS7_OR_LATER   ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending )
    
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
    	if ( IOS7_OR_LATER )
    	{
    		self.edgesForExtendedLayout = UIRectEdgeNone;
    		self.extendedLayoutIncludesOpaqueBars = NO;
    		self.modalPresentationCapturesStatusBarAppearance = NO;
    		self.navigationController.navigationBar.translucent = NO;
    	}
    #endif
    
    

    external by Github modified Mar 16, 2015  57  0  1  0

    Bash script that starts from the icon set resulting from the App Icon Template [3.2] (http://appicontemplate.com/ios7) and results into a complete set of icons and images for App Store, Google Play and Windows Phone Store (screenshots still missing).

    Bash script that starts from the icon set resulting from the App Icon Template [3.2] (http://appicontemplate.com/ios7) and results into a complete set of icons and images for App Store, Google Play and Windows Phone Store (screenshots still missing).: gistfile1.sh
    #!/bin/bash
    
    # clear terminal window
    clear
    
    # variabili per creare sotto cartelle iOS, Android e WP
    export RET_PATH=$PWD
    
    ######  iOS
    mkdir ./iOS
    echo ""
    echo "=> Entering in $RET_PATH/iOS/"
    cp *.png ./iOS/
    
    cd ./iOS
    
    # 60@3x
    cp iTunesArtwork.png AppIcon60x60\@3x.png
    sips -Z 180 AppIcon60x60\@3x.png
    
    # 29@2x-1
    cp AppIcon29x29\@2x.png AppIcon29x29\@2x-1.png
    
    # 40@2x-1
    cp AppIcon40x40\@2x.png AppIcon40x40\@2x-1.png
    
    # appstore
    cp iTunesArtwork\@2x.png appstore.png
    convert appstore.png -flatten appstore.png
    
    # launch_ipad
    cp iTunesArtwork\@2x.png launch_ipad.png
    sips -Z 708 launch_ipad.png
    sips --padToHeightWidth 1024 768 launch_ipad.png
    convert launch_ipad.png -flatten launch_ipad.png
    
    # launch_ipad@2x
    cp iTunesArtwork\@2x.png launch_ipad\@2x.png
    sips --padToHeightWidth 2048 1536 launch_ipad\@2x.png
    convert launch_ipad\@2x.png -flatten launch_ipad\@2x.png
    
    # launch_r4
    cp iTunesArtwork\@2x.png launch_r4.png
    sips -Z 580 launch_r4.png
    sips --padToHeightWidth 1136 640 launch_r4.png
    convert launch_r4.png -flatten launch_r4.png
    
    # launch
    cp iTunesArtwork\@2x.png launch.png
    sips -Z 580 launch.png
    sips --padToHeightWidth 960 640 launch.png
    convert launch.png -flatten launch.png
    
    echo ""
    echo "<= Coming back to $RET_PATH"
    cd $RET_PATH
    
    
    ######  Android
    mkdir ./Android
    
    echo ""
    echo "=> Entering in $RET_PATH/Android"
    cd ./Android
    
    # ic_launcher-web
    cp ../iOS/iTunesArtwork.png ./ic_launcher-web.png
    
    ### drawable-xxhdpi 144
    mkdir drawable-xxhdpi
    cp ../iOS/launch_ipad\@2x.png ./drawable-xxhdpi/sp_launcher.png
    cp ic_launcher-web.png ./drawable-xxhdpi/ic_launcher.png
    sips -Z 144 ./drawable-xxhdpi/ic_launcher.png
    
    # drawable-xhdpi 96
    mkdir drawable-xhdpi
    cp ./ic_launcher-web.png ./drawable-xhdpi/ic_launcher.png
    sips -Z 96 ./drawable-xhdpi/ic_launcher.png
    
    # drawable-hdpi 72
    mkdir drawable-hdpi
    cp ./ic_launcher-web.png ./drawable-hdpi/ic_launcher.png
    sips -Z 72 ./drawable-hdpi/ic_launcher.png
    
    # drawable-mdpi 48
    mkdir drawable-mdpi
    cp ./ic_launcher-web.png ./drawable-mdpi/ic_launcher.png
    sips -Z 48 ./drawable-mdpi/ic_launcher.png
    
    # store
    cp ../iOS/iTunesArtwork.png ./store.png
    
    # promo
    cp ../iOS/iTunesArtwork\@2x.png ./promo.png
    sips -Z 440 ./promo.png
    sips --padToHeightWidth 500 1024 ./promo.png
    convert ./promo.png -flatten ./promo.png
    
    # promo2
    cp ../iOS/iTunesArtwork\@2x.png ./promo2.png
    sips -Z 80 ./promo2.png
    sips --padToHeightWidth 120 180 ./promo2.png
    convert ./promo2.png -flatten ./promo2.png
    
    echo ""
    echo "<= Coming back to $RET_PATH"
    cd $RET_PATH
    
    
    ######  WP
    mkdir ./WP
    
    echo ""
    echo "=> Entering in $RET_PATH/WP"
    cd ./WP
    
    # store
    cp ../iOS/iTunesArtwork\@2x.png ./store.png
    sips -Z 300 ./store.png
    convert ./store.png -flatten ./store.png
    
    # SplashScreenImage.jpg
    cp ../iOS/iTunesArtwork\@2x.png ./SplashScreenImage.png
    sips -Z 660 ./SplashScreenImage.png
    sips --padToHeightWidth 1280 720 ./SplashScreenImage.png
    convert ./SplashScreenImage.png -flatten ./SplashScreenImage.png
    convert ./SplashScreenImage.png ./SplashScreenImage.jpg
    
    # FlipCycleTileMedium.png
    cp ../iOS/iTunesArtwork\@2x.png ./FlipCycleTileMedium.png
    sips -Z 202 ./FlipCycleTileMedium.png
    convert ./FlipCycleTileMedium.png -flatten ./FlipCycleTileMedium.png
    
    # FlipCycleTileSmall.png
    cp ../iOS/iTunesArtwork\@2x.png ./FlipCycleTileSmall.png
    sips -Z 110 ./FlipCycleTileSmall.png
    convert ./FlipCycleTileSmall.png -flatten ./FlipCycleTileSmall.png
    
    # ApplicationIcon.png
    cp ../iOS/iTunesArtwork\@2x.png ./ApplicationIcon.png
    sips -Z 100 ./ApplicationIcon.png
    convert ./ApplicationIcon.png -flatten ./ApplicationIcon.png
    
     
    echo ""
    echo "<= Coming back to $RET_PATH"
    cd $RET_PATH
    
    

    external by originell modified Jan 7, 2015  57  0  1  0

    Reliably get the top most UIViewController. Tested with iOS7 and 8

    Reliably get the top most UIViewController. Tested with iOS7 and 8: TopMostViewController.swift
    // Note: There are no fancy error checks in here. This is just meant to quickly demonstrate this.
    // I was extremely frustrated because most posts on stackoverflow are missing the important point
    // of checking for the "presentedViewController".
    
    // If you are working in a view that is *already living* in the view hierarchy.
    var topMostController = view.window!.rootViewController!
    // or
    // If you don't have a view in the hierarchy yet (as it might happen in viewDidLoad etc.)
    // (there is also the possibility to use UIApplication.sharedApplication().keyWindow, though it seems
    //  that the internet's general opinion is that it's safer to use the delegate's window)
    var topMostController = UIApplication().sharedApplication().delegate!.window!!.rootViewController
    // Important: do not forgot to check for this. Presented ViewControllers are in front of others!
    // TODO: Might be necessary to do this recursively?
    if let presentedVC = topMostController.presentedViewController {
        topMostController = presentedVC
    }
    
    
    
    
    
    

    external by Wil Ferrel modified Apr 18, 2015  57  0  1  0

    iOS7 Font Names

    iOS7 Font Names: gistfile1.txt
    2013-09-28 15:54:13.369 iOSFontListTest[3753:60b] Font Family Names (
        "Academy Engraved LET",
        "Al Nile",
        "American Typewriter",
        "Apple Color Emoji",
        "Apple SD Gothic Neo",
        Arial,
        "Arial Hebrew",
        "Arial Rounded MT Bold",
        Avenir,
        "Avenir Next",
        "Avenir Next Condensed",
        "Bangla Sangam MN",
        Baskerville,
        "Bodoni 72",
        "Bodoni 72 Oldstyle",
        "Bodoni 72 Smallcaps",
        "Bodoni Ornaments",
        "Bradley Hand",
        "Chalkboard SE",
        Chalkduster,
        Cochin,
        Copperplate,
        Courier,
        "Courier New",
        "DIN Alternate",
        "DIN Condensed",
        Damascus,
        "Devanagari Sangam MN",
        Didot,
        "Euphemia UCAS",
        Farah,
        Futura,
        "Geeza Pro",
        Georgia,
        "Gill Sans",
        "Gujarati Sangam MN",
        "Gurmukhi MN",
        "Heiti SC",
        "Heiti TC",
        Helvetica,
        "Helvetica Neue",
        "Hiragino Kaku Gothic ProN",
        "Hiragino Mincho ProN",
        "Hoefler Text",
        "Iowan Old Style",
        Kailasa,
        "Kannada Sangam MN",
        "Malayalam Sangam MN",
        Marion,
        "Marker Felt",
        Menlo,
        Mishafi,
        Noteworthy,
        Optima,
        "Oriya Sangam MN",
        Palatino,
        Papyrus,
        "Party LET",
        "Savoye LET",
        "Sinhala Sangam MN",
        "Snell Roundhand",
        Superclarendon,
        Symbol,
        "Tamil Sangam MN",
        "Telugu Sangam MN",
        Thonburi,
        "Times New Roman",
        "Trebuchet MS",
        Verdana,
        "Zapf Dingbats",
        Zapfino
    )
    2013-09-28 15:54:13.378 iOSFontListTest[3753:60b] Font Names (
        AcademyEngravedLetPlain,
        "AlNile-Bold",
        AlNile,
        "AmericanTypewriter-Light",
        "AmericanTypewriter-CondensedLight",
        "AmericanTypewriter-CondensedBold",
        AmericanTypewriter,
        "AmericanTypewriter-Condensed",
        "AmericanTypewriter-Bold",
        AppleColorEmoji,
        "AppleSDGothicNeo-Thin",
        "AppleSDGothicNeo-SemiBold",
        "AppleSDGothicNeo-Medium",
        "AppleSDGothicNeo-Regular",
        "AppleSDGothicNeo-Bold",
        "AppleSDGothicNeo-Light",
        ArialMT,
        "Arial-BoldItalicMT",
        "Arial-ItalicMT",
        "Arial-BoldMT",
        "ArialHebrew-Bold",
        "ArialHebrew-Light",
        ArialHebrew,
        ArialRoundedMTBold,
        "Avenir-Heavy",
        "Avenir-Oblique",
        "Avenir-Black",
        "Avenir-Book",
        "Avenir-BlackOblique",
        "Avenir-HeavyOblique",
        "Avenir-Light",
        "Avenir-MediumOblique",
        "Avenir-Medium",
        "Avenir-LightOblique",
        "Avenir-Roman",
        "Avenir-BookOblique",
        "AvenirNext-MediumItalic",
        "AvenirNext-Bold",
        "AvenirNext-UltraLight",
        "AvenirNext-DemiBold",
        "AvenirNext-HeavyItalic",
        "AvenirNext-Heavy",
        "AvenirNext-Medium",
        "AvenirNext-Italic",
        "AvenirNext-UltraLightItalic",
        "AvenirNext-BoldItalic",
        "AvenirNext-Regular",
        "AvenirNext-DemiBoldItalic",
        "AvenirNextCondensed-Regular",
        "AvenirNextCondensed-MediumItalic",
        "AvenirNextCondensed-UltraLightItalic",
        "AvenirNextCondensed-UltraLight",
        "AvenirNextCondensed-BoldItalic",
        "AvenirNextCondensed-Italic",
        "AvenirNextCondensed-Medium",
        "AvenirNextCondensed-HeavyItalic",
        "AvenirNextCondensed-Heavy",
        "AvenirNextCondensed-DemiBoldItalic",
        "AvenirNextCondensed-DemiBold",
        "AvenirNextCondensed-Bold",
        BanglaSangamMN,
        "BanglaSangamMN-Bold",
        "Baskerville-Bold",
        "Baskerville-SemiBoldItalic",
        "Baskerville-BoldItalic",
        Baskerville,
        "Baskerville-SemiBold",
        "Baskerville-Italic",
        "BodoniSvtyTwoITCTT-Book",
        "BodoniSvtyTwoITCTT-Bold",
        "BodoniSvtyTwoITCTT-BookIta",
        "BodoniSvtyTwoOSITCTT-BookIt",
        "BodoniSvtyTwoOSITCTT-Bold",
        "BodoniSvtyTwoOSITCTT-Book",
        "BodoniSvtyTwoSCITCTT-Book",
        BodoniOrnamentsITCTT,
        "BradleyHandITCTT-Bold",
        "ChalkboardSE-Light",
        "ChalkboardSE-Regular",
        "ChalkboardSE-Bold",
        Chalkduster,
        "Cochin-Bold",
        "Cochin-BoldItalic",
        "Cochin-Italic",
        Cochin,
        Copperplate,
        "Copperplate-Light",
        "Copperplate-Bold",
        Courier,
        "Courier-Oblique",
        "Courier-BoldOblique",
        "Courier-Bold",
        CourierNewPSMT,
        "CourierNewPS-BoldMT",
        "CourierNewPS-ItalicMT",
        "CourierNewPS-BoldItalicMT",
        "DINAlternate-Bold",
        "DINCondensed-Bold",
        DamascusBold,
        Damascus,
        DamascusMedium,
        DamascusSemiBold,
        DevanagariSangamMN,
        "DevanagariSangamMN-Bold",
        "Didot-Bold",
        "Didot-Italic",
        Didot,
        EuphemiaUCAS,
        "EuphemiaUCAS-Bold",
        "EuphemiaUCAS-Italic",
        Farah,
        "Futura-Medium",
        "Futura-CondensedMedium",
        "Futura-MediumItalic",
        "Futura-CondensedExtraBold",
        "GeezaPro-Bold",
        GeezaPro,
        "GeezaPro-Light",
        "Georgia-BoldItalic",
        "Georgia-Bold",
        "Georgia-Italic",
        Georgia,
        GillSans,
        "GillSans-Italic",
        "GillSans-BoldItalic",
        "GillSans-Light",
        "GillSans-LightItalic",
        "GillSans-Bold",
        "GujaratiSangamMN-Bold",
        GujaratiSangamMN,
        "GurmukhiMN-Bold",
        GurmukhiMN,
        "STHeitiSC-Medium",
        "STHeitiSC-Light",
        "STHeitiTC-Medium",
        "STHeitiTC-Light",
        "Helvetica-Oblique",
        "Helvetica-Light",
        "Helvetica-Bold",
        Helvetica,
        "Helvetica-BoldOblique",
        "Helvetica-LightOblique",
        "HelveticaNeue-BoldItalic",
        "HelveticaNeue-Light",
        "HelveticaNeue-Italic",
        "HelveticaNeue-UltraLightItalic",
        "HelveticaNeue-CondensedBold",
        "HelveticaNeue-MediumItalic",
        "HelveticaNeue-Thin",
        "HelveticaNeue-Medium",
        "HelveticaNeue-Thin_Italic",
        "HelveticaNeue-LightItalic",
        "HelveticaNeue-UltraLight",
        "HelveticaNeue-Bold",
        HelveticaNeue,
        "HelveticaNeue-CondensedBlack",
        "HiraKakuProN-W6",
        "HiraKakuProN-W3",
        "HiraMinProN-W6",
        "HiraMinProN-W3",
        "HoeflerText-Regular",
        "HoeflerText-BlackItalic",
        "HoeflerText-Italic",
        "HoeflerText-Black",
        "IowanOldStyle-Bold",
        "IowanOldStyle-BoldItalic",
        "IowanOldStyle-Italic",
        "IowanOldStyle-Roman",
        Kailasa,
        "Kailasa-Bold",
        KannadaSangamMN,
        "KannadaSangamMN-Bold",
        MalayalamSangamMN,
        "MalayalamSangamMN-Bold",
        "Marion-Regular",
        "Marion-Italic",
        "Marion-Bold",
        "MarkerFelt-Thin",
        "MarkerFelt-Wide",
        "Menlo-BoldItalic",
        "Menlo-Regular",
        "Menlo-Bold",
        "Menlo-Italic",
        DiwanMishafi,
        "Noteworthy-Bold",
        "Noteworthy-Light",
        "Optima-Regular",
        "Optima-Italic",
        "Optima-Bold",
        "Optima-BoldItalic",
        "Optima-ExtraBlack",
        OriyaSangamMN,
        "OriyaSangamMN-Bold",
        "Palatino-Roman",
        "Palatino-Italic",
        "Palatino-Bold",
        "Palatino-BoldItalic",
        "Papyrus-Condensed",
        Papyrus,
        PartyLetPlain,
        SavoyeLetPlain,
        SinhalaSangamMN,
        "SinhalaSangamMN-Bold",
        "SnellRoundhand-Black",
        "SnellRoundhand-Bold",
        SnellRoundhand,
        "Superclarendon-Regular",
        "Superclarendon-BoldItalic",
        "Superclarendon-Light",
        "Superclarendon-BlackItalic",
        "Superclarendon-Italic",
        "Superclarendon-LightItalic",
        "Superclarendon-Bold",
        "Superclarendon-Black",
        Symbol,
        TamilSangamMN,
        "TamilSangamMN-Bold",
        TeluguSangamMN,
        "TeluguSangamMN-Bold",
        "Thonburi-Bold",
        Thonburi,
        "Thonburi-Light",
        "TimesNewRomanPS-BoldItalicMT",
        TimesNewRomanPSMT,
        "TimesNewRomanPS-BoldMT",
        "TimesNewRomanPS-ItalicMT",
        "Trebuchet-BoldItalic",
        TrebuchetMS,
        "TrebuchetMS-Bold",
        "TrebuchetMS-Italic",
        "Verdana-BoldItalic",
        "Verdana-Italic",
        Verdana,
        "Verdana-Bold",
        ZapfDingbatsITC,
        Zapfino
    )
    
    
    

    external by ZacharyWeiner modified Jan 3, 2015  34  0  1  0

    iOS7 Objective C Camera Code

    iOS7 Objective C Camera Code: gistfile1.txt
    - (IBAction)cameraBarButtonItemPressed:(UIBarButtonItem *)sender {
        
        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        picker.delegate = self;
        if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
            picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        }else if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]){
            picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
        }
        [self presentViewController:picker animated:true completion:nil];
    }
    
    - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
    {
        NSLog(@"Finished Picking");
        UIImage *image = info[UIImagePickerControllerEditedImage];
        if(!image){
            image = info[UIImagePickerControllerOriginalImage];
        }
        [self.photos addObject:[self photoFromImage:image]];
        [self.collectionView reloadData];
        [self dismissViewControllerAnimated:true completion:nil];
    }
    
    - (void) imagePickerControllerDidCancel:(UIImagePickerController *)picker
    {
        NSLog(@"Cancel Clicked");
        [self dismissViewControllerAnimated:true completion:nil];
    }
    
    - (Photo *)photoFromImage:(UIImage *)image
    {
        Photo *photo = [NSEntityDescription insertNewObjectForEntityForName:@"Photo" inManagedObjectContext:[TWCoreDataHelper managedObjectContext]];
        photo.image = image;
        photo.date = [NSDate date];
        photo.albumBook = self.album;
        
        NSError *error = nil;
        if(![[photo managedObjectContext] save:&error]){
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Erro!" delegate:nil cancelButtonTitle:@"Cacel" otherButtonTitles:nil, nil];
            [alertView show];
        }
        return photo;
    }
    
    
    
    @implementation TWPictureDataTransformer
    - (Class)transformedValueClass
    {
        return [NSData class];
    }
    
    - (BOOL)allowsReververseTransformation
    {
        return YES;
    }
    
    - (id)transformedValue:(id)value
    {
        return UIImagePNGRepresentation(value);
    }
    
    - (id)reverseTransformedValue:(id)value
    {
        UIImage *image = [UIImage imageWithData:value];
        return image;
    }
    @end
    
    
    
    • Public Snippets
    • Channels Snippets