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
| let parameters : Parameters = ["a" : "b","c" : "d"] | |
| // 1๋ฒ ์ฝ๋๊ฐ ์๋ ์ 2๋ฒ ์ฝ๋๋ก encodeing ์ฐจ์ด | |
| 1. AF.request("์ฌ๊ธฐ๋ url๋ฃ์ผ์์ค", method: .post, parameters: parameters, encoding: JSONEncoding.default, headers: nil) | |
| 2. AF.request("์ฌ๊ธฐ๋ url๋ฃ์ผ์์ค", method: .post, parameters: parameters, encoding: URLEncoding.httpBody, headers: nil) | |
| .responseJSON{ response in | |
| debugPrint(response) | |
| switch response.result { |
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 | |
| class ViewController: UIViewController, UITextFieldDelegate { | |
| @IBOutlet var textField: UITextField! // Link this to a UITextField in Storyboard | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| textField.smartInsertDeleteType = UITextSmartInsertDeleteType.no |
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
| Request | |
| ๊ฐ์ฅ ๊ฐ๋จํ url ํธ์ถ์ ๋๋ค. | |
| func get(completionHandler: @escaping (AFDataResponse<Data?>) -> Void){ | |
| AF.request("\(Config.baseURL)").response(completionHandler: completionHandler) | |
| } | |
| // ... | |
| func get_alamofire(){ |
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
| // | |
| // ViewController.swift | |
| // customCameraView | |
| // | |
| // Created by Ik ju Song on 2019/11/12. | |
| // Copyright ยฉ 2019 Ik ju Song. All rights reserved. | |
| // | |
| import UIKit | |
| import AVFoundation |
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
| //์์ ์ฝ๋ | |
| let alert = UIAlertController(title: "์ฌ์ง์ ์ ์กํ์๊ฒ ์ต๋๊น?", message: "", preferredStyle: .alert) | |
| alert.addAction(UIAlertAction(title: "๋ค", style: .default, handler: | |
| { action in | |
| //action ํ ๋ฉ์๋๋ ์ฝ๋ ๋ฃ์ผ๋ฉด๋จ ์ฌ๊ธฐ์๋ค๊ฐ | |
| })) | |
| alert.addAction(UIAlertAction(title: "์๋์", style: .cancel, handler: nil)) |
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 AppDelegate: UIResponder, UIApplicationDelegate { | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
| ApplicationDelegate.shared.application( application, didFinishLaunchingWithOptions: launchOptions )//Facebook loing ํ๊ธฐ ์ํด ์ฌ์ฉ๋ ์ฝ๋ | |
| // Override point for customization after application launch. | |
| FBSDKCoreKit.Settings.appID = "์ฑID"//์ฑ ID : ํ์ด์ค๋ถ ํ์ด์ง์์ ๋ฐ์ ์ฑ์ ID | |
| 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
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
| ApplicationDelegate.shared.application( application, didFinishLaunchingWithOptions: launchOptions )//Facebook loing ํ๊ธฐ ์ํด ์ฌ์ฉ๋ ์ฝ๋ | |
| // Override point for customization after application launch. | |
| FBSDKCoreKit.Settings.appID = "์ฑID"//์ฑ ID : ํ์ด์ค๋ถ ํ์ด์ง์์ ๋ฐ์ ์ฑ์ ID | |
| 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
| func facebookLoginBtn() | |
| { // ๋ฒํผ ์ฝ๋๋ก ๋ฑ๋ก | |
| facebook_login_btn.translatesAutoresizingMaskIntoConstraints = false | |
| facebook_login_btn.setTitle("ํ์ด์ค๋ถ์ผ๋ก ๊ณ์ํ๊ธฐ", for: .normal) | |
| facebook_login_btn.setTitleColor(.black, for: .normal) | |
| facebook_login_btn.titleLabel?.font = .boldSystemFont(ofSize: 13) | |
| facebook_login_btn.addTarget(self, action: #selector(faceBookLoginButtonAction(_:)), for: .touchUpInside) | |
| facebook_login_btn.layer.cornerRadius = 5 | |
| facebook_login_btn.layer.borderWidth = 1 | |
| facebook_login_btn.clipsToBounds = 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
| //๋ณด๋ ๊ฒ๊ณผ๊ฐ์ด ์ด๋ฏธ์ง๋ทฐ์ ํ ๊ทธ๋ฅผ ๋ฌ์์ฃผ๋ ๋ฉ์๋๋ฅผ ๋ง๋ ๋ค. | |
| func imageDragDrop(iv : UIImageView) | |
| { | |
| //์ ์ค์ณ ์ด๋ฒคํธ๋ฅผ ๋ง๋๋ ๋ณ์ | |
| let gesture = UIPanGestureRecognizer(target: self, action: #selector(wasRagged(_:))) | |
| //iv ์ด๋ฏธ์ง ๋ทฐ์๋ค๊ฐ ์ ์ค์ณ๋ฅผ ๋ฃ๋ ํจ์ | |
| iv.addGestureRecognizer(gesture) |
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
| //์์ | |
| let uiObject = UIImageView(frame: CGRect(x: 100, y: 200, width: 100, height: 100 )) | |
| // x์ขํ๋ก 100, y์ขํ๋ก 200์ ์์น์ ํฌ๊ธฐ 100, ๋์ด 100 ํฌ๊ธฐ์ ui์ค๋ธ์ ํธ ์์ฑ | |
| //์ญ์ ๋ฐฉ๋ฒ | |
| uiObejct.removeFromSuperview() //<-ํ์ | |
| removeFromSuperview()๋ฅผ ํ์๋ก ์ ์ฉ ์์ผ์ค์ผ ํฉ๋๋ค. |