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
private func attribute() { | |
tableView.dataSource = self | |
tableView.register(TableViewCell.self, forCellReuseIdentifier: "tableViewCell") | |
tableView.rowHeight = 80 | |
tableView.separatorInset.left = 0 | |
} |
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
extension LoginView: UITextFieldDelegate { | |
func textFieldShouldReturn(_ textField: UITextField) -> Bool { | |
if textField == emailTextField { | |
passwordTextField.becomeFirstResponder() | |
} else { | |
passwordTextField.resignFirstResponder() | |
} | |
return true | |
} | |
} |
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
private func addKeyboardNotification() { | |
NotificationCenter.default.addObserver( | |
self, | |
selector: #selector(keyboardWillShow), | |
name: UIResponder.keyboardWillShowNotification, | |
object: nil | |
) | |
NotificationCenter.default.addObserver( | |
self, |
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
@objc private func keyboardWillShow(_ notification: Notification) { | |
if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue { | |
let keybaordRectangle = keyboardFrame.cgRectValue | |
let keyboardHeight = keybaordRectangle.height | |
preparedView.nextButton.frame.origin.y -= keyboardHeight | |
} | |
} | |
@objc private func keyboardWillHide(_ notification: Notification) { | |
if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue { |
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
extension ViewController: UITableViewDataSource { | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return 20 | |
} | |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell(withIdentifier: "tableViewCell", for: indexPath) as! TableViewCell | |
if indexPath.row % 2 == 0 { | |
cell.isUserInteractionEnabled = false |
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 application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
NMFAuthManager.shared().clientId = "YOUR_CLIENT_ID_HERE" | |
return true | |
} |
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 UIKit | |
import NMapsMap | |
class ViewController: UIViewController { | |
var authState: NMFAuthState! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
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 UIKit | |
enum AssetsColor { | |
// MegaBox Main Color | |
case megaBoxColor | |
// Button Color | |
case defaultGrayColor | |
// Division Line Color |
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
private let topViewBottomLine: UILabel = { | |
let label = UILabel() | |
label.backgroundColor = UIColor.appColor(.defaultGrayColor) | |
label.translatesAutoresizingMaskIntoConstraints = false | |
return label | |
}() |
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
private let pointLabel = UILabel() | |
// NSMutableAttributedString Type으로 바꾼 text를 저장 | |
let attributedStr = NSMutableAttributedString(string: pointLabel.text!) | |
// text의 range 중에서 "Bonus"라는 글자는 UIColor를 blue로 변경 | |
attributedStr.addAttribute(.foregroundColor, value: UIColor.blue, range: (pointLabel.text! as NSString).range(of: "Bonus")) | |
// text의 range 중에서 "Point"라는 글자는 UIColor를 orange로 변경 | |
attributedStr.addAttribute(.foregroundColor, value: UIColor.orange, range: (pointLabel.text! as NSString).range(of: "Point")) |