Giter Site home page Giter Site logo

stanford_ios_lecture_demobundle's Introduction

Stanford_iOS_Lecture_DemoBundle

First of all, thanks for Stanford University gave us such a great open class : Developing Apps for iOS CS193P.

This DemoBundle contains the demo which were taught in this class.

I summarize these lectures in my Chinese blog in JianShu. While, I do not have summarized all the lectues yet, so you can not see all of the demos. But I will continue to summarize and present the demo to you.

And there are two parts of this bundle, one contains the code with Chinese note which is easy to be understood by Chinese-speaking friends. Another part has English note for western friends.

##Note Examples

###Code with English note:

    //1. card front
    //1.1 card front middle image
    UIImage *faceImage = [UIImage imageNamed:[NSString stringWithFormat:@"%@%@",[self rankAsString],self.suit]];
    
    if (faceImage) {
        
        CGRect imageRect = CGRectInset(self.bounds, self.bounds.size.width * (1.0 - self.faceCardScaleFactor) + 20, self.bounds.size.height * ( 1.0 - self.faceCardScaleFactor  ) + 20);
        [faceImage drawInRect:imageRect];
    }
    
    //1.2 draw card corners
    [self drawCorners];
    
}else{
    
    //2. set card back image
    [[UIImage imageNamed:@"cardBack"] drawInRect:self.bounds];


###Code with Chinese note:

    //1. 纸牌正面
    //1.1 纸牌正面中间的图
    UIImage *faceImage = [UIImage imageNamed:[NSString stringWithFormat:@"%@%@",[self rankAsString],self.suit]];
    
    if (faceImage) {
        
        CGRect imageRect = CGRectInset(self.bounds, self.bounds.size.width * (1.0 - self.faceCardScaleFactor) + 20, self.bounds.size.height * ( 1.0 - self.faceCardScaleFactor  ) + 20);
        [faceImage drawInRect:imageRect];
    }
    
    //1.2 纸牌正面四个角
    [self drawCorners];
    
    }else{
    
    //2. 纸牌背面
    [[UIImage imageNamed:@"cardBack"] drawInRect:self.bounds];

    

##Demo Examples

###Card Matching Game

image

###Drop it image

There maybe some bugs, but I think we can make this be better and better! Wecome to download and discuss with me!

Thanks again for Stanford University.

stanford_ios_lecture_demobundle's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.