Big company has lots of ObjC code

/## Swift

class Person: NSObject {

var _name: String

init(name: String){

_name = name

}

function setName(name:String){

_name = name

}

}

run in playground

Person.setName(“Dancer”)

/##ObjC

@interface Person : NSObject {

NSString* _name;

}

-(void)setName: (NSString*) name;

-(NSString*) name;

@end

@Implementation Person

-(void)setName: (NSString * )name {

_name = name;

}

-(NSString*) name {

return _name;

}

Actually, run in Main.m

Person* p1 =[Person new];

[p1 setName:@”Dancer”];

NSLog(@”%ld”, [p1 age]);

--

--

--

Major in physical education. Football referee. And high interest in looking the world through the numbers.

Love podcasts or audiobooks? Learn on the go with our new app.

How to Create a REST API Endpoint with Drupal Views

Codility Algorithm Practice Lesson 13: Fibonacci Numbers, Task 1: FibFrog — a Python approach

spiral stairs

Orgzit Features That Triple Team Productivity

Adding Post Processing Profiles in Unity

Internship Experience at EntHire!

Two-Pointer Technique: Solving Array Problems at Light Speed

An RSpec time issue (and it’s not about timezones)

Part 3: Rooms, Rooms, Rooms!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mario tsai

Mario tsai

Major in physical education. Football referee. And high interest in looking the world through the numbers.

More from Medium

iOS — Single responsibility principle by example

iOS Code Signing breakdown

ARC — Automatic Reference Counting.

Configurations and Code, a way to separate them (iOS)