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 | |
func handleAuthorizationAppleIDButtonPress() { | |
let appleIDProvider = ASAuthorizationAppleIDProvider() | |
let request = appleIDProvider.createRequest() | |
request.requestedScopes = [.fullName, .email] | |
let authorizationController = ASAuthorizationController(authorizationRequests: [request]) | |
authorizationController.delegate = self | |
authorizationController.presentationContextProvider = self | |
authorizationController.performRequests() |
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 AuthenticationServices | |
class LoginViewController: UIViewController { | |
@IBOutlet weak var loginProviderStackView: UIStackView! | |
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
extension UITextField { | |
func addLeftPadding() { | |
let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: 10, height: self.frame.height)) | |
self.leftView = paddingView | |
self.leftViewMode = ViewMode.always | |
} | |
} |
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
<key>LSApplicationQueriesSchemes</key> | |
<array> | |
<string>googlechromes</string> | |
<string>comgooglemaps</string> | |
</array> |
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 SearchViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.view.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) | |
let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0) | |
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera) | |
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 SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
var window: UIWindow? | |
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
guard let windowScene = (scene as? UIWindowScene) else { return } | |
window = UIWindow(frame: windowScene.coordinateSpace.bounds) | |
window?.windowScene = windowScene | |
window?.rootViewController = ViewController() |
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 HomeTableViewCell: UICollectionViewDelegate { | |
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) { | |
let page = Int(targetContentOffset.pointee.x / self.frame.width) | |
self.pageControl.currentPage = page | |
} | |
} |
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 pageControl = UIPageControl() | |
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
super.init(style: style, reuseIdentifier: reuseIdentifier) | |
pageControl.hidesForSinglePage = true | |
pageControl.numberOfPages = 5 | |
pageControl.pageIndicatorTintColor = .darkGray | |
// AutoLayout은 SnapKit으로 잡아주고 있습니다. |
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
contentsLabel.text = "안녕하세요. 저는 iOS 개발자 Fury 입니다. 좋은 개발자가 되기 위해서 열심히 노력하고 있어요!!!! 앞으로 좋은 인연이 되었으면 좋겠습니다. 감사합니다." | |
contentsLabel.numberOfLines = 0 | |
let attrString = NSMutableAttributedString(string: contentsLabel.text!) | |
let paragraphStyle = NSMutableParagraphStyle() | |
paragraphStyle.lineSpacing = 4 | |
attrString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, attrString.length)) | |
contentsLabel.attributedText = attrString |
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 UILabel { | |
func dynamicFont(fontSize size: CGFloat, weight: UIFont.Weight) { | |
let currentFontName = self.font.fontName | |
var calculatedFont: UIFont? | |
let bounds = UIScreen.main.bounds | |
let height = bounds.size.height | |
switch height { | |
case 480.0: //Iphone 3,4S => 3.5 inch | |
calculatedFont = UIFont(name: currentFontName, size: size * 0.7) |