This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SmartPhone { | |
| let inch: Double | |
| let isFolded: Bool = false | |
| init(inch: Double) { | |
| self.inch = inch | |
| } | |
| func call(to: String) { | |
| print("calling to \(to)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SmartPhone { | |
| let inch: Double | |
| func call(to: String) { | |
| print("calling to \(to)") | |
| } | |
| func showYoutube() { | |
| print("Watching Youtube") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol Coffee { | |
| func drink() | |
| } | |
| struct Americano: Coffee { | |
| func drink() { | |
| print("아메리카노를 마십니다.") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Programmer { | |
| private let coffee: Coffee | |
| init(coffee: Coffee) { | |
| self.coffee = coffee | |
| } | |
| func startProgramming() { | |
| self.coffee.drink() | |
| //... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Programmer { | |
| private let coffee = Coffee() | |
| func startProgramming() { | |
| self.coffee.drink() | |
| //... | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| let cell = tableView.dequeueReusableCell(withIdentifier: "SearchTableViewCell", for: indexPath) as! SearchTableViewCell | |
| if indexPath.row == 0 { | |
| cell.backgroundColor = .orange | |
| } | |
| return cell | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //DECODE JSON WEB TOKEN (JWT) IN IOS (OBJECTIVE-C) | |
| //http://popdevelop.com/2013/12/decode-json-web-token-jwt-in-ios-objective-c/ | |
| NSString *jwt = @"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIifQ.bVhBeMrW5g33Vi4FLSLn7aqcmAiupmmw-AY17YxCYLI"; | |
| NSArray *segments = [jwt componentsSeparatedByString:@"."]; | |
| NSString *base64String = [segments objectAtIndex: 1]; | |
| NSLog(@"%@", base64String); | |
| // => "eyJmb28iOiJiYXIifQ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import "./styles.css"; | |
| export default function App() { | |
| return <Contact /> | |
| } | |
| class ContactInfo extends React.Component { | |
| render() { | |
| return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import "./styles.css"; | |
| export default function App() { | |
| return <Counter />; | |
| } | |
| class Counter extends React.Component { | |
| constructor(props) { | |
| super(props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Codelab extends React.Component { | |
| render() { | |
| let text = "Hi I am codelab"; | |
| let stylegg = { | |
| backgroundColor: 'aqua' | |
| }; | |
| return ( | |
| <div style={stylegg}>{text}</div> | |
| ); |