Firebase App 추가
iOS/Firebase Chat1) ADD APP
2) iOS 선택
3) iOS App Name 등록
4) plist 파일 다운로드해서 XCode 에 등록
5) SDK 추가
Swift 로 추가
6) 등록후 Skip...
7) 확인.
'iOS > Firebase Chat' 카테고리의 다른 글
iOS Chat based Firebase (0) | 2018.06.01 |
---|
1) ADD APP
2) iOS 선택
3) iOS App Name 등록
4) plist 파일 다운로드해서 XCode 에 등록
5) SDK 추가
Swift 로 추가
6) 등록후 Skip...
7) 확인.
iOS Chat based Firebase (0) | 2018.06.01 |
---|
https://cocoapods.org
sudo gem install cocoapods
Android 와 SWIFT 개념 비교 (0) | 2018.05.20 |
---|---|
화면 처리 순서 (0) | 2018.05.19 |
동적으로 NavigationBar 와 TableView 추가.code (0) | 2018.05.18 |
Status Bar 숨기기 (Carrier/ Wifi/ BatteryIcon Bar) (0) | 2018.05.18 |
Constraint 동적 추가 (0) | 2018.05.17 |
[ 참조 ] https://github.com/Hpark11/firebaseChatTest
https://github.com/Hpark11/firebaseChatTest
[ 2017-509 ]
Firebase App 추가 (0) | 2018.06.04 |
---|
- Activity => ViewController
- Intent => Segue
Cocoapods 설치 (0) | 2018.06.02 |
---|---|
화면 처리 순서 (0) | 2018.05.19 |
동적으로 NavigationBar 와 TableView 추가.code (0) | 2018.05.18 |
Status Bar 숨기기 (Carrier/ Wifi/ BatteryIcon Bar) (0) | 2018.05.18 |
Constraint 동적 추가 (0) | 2018.05.17 |
Cocoapods 설치 (0) | 2018.06.02 |
---|---|
Android 와 SWIFT 개념 비교 (0) | 2018.05.20 |
동적으로 NavigationBar 와 TableView 추가.code (0) | 2018.05.18 |
Status Bar 숨기기 (Carrier/ Wifi/ BatteryIcon Bar) (0) | 2018.05.18 |
Constraint 동적 추가 (0) | 2018.05.17 |
//
// ViewController.swift
// ToDoApp2
//
// Created by GANG WOOK KIM on 17/05/2018.
// Copyright © 2018 GANG WOOK KIM. All rights reserved.
//
import UIKit
extension ViewController:UITableViewDataSource
{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.subtitle, reuseIdentifier:"Cell")
cell.textLabel?.text = items[indexPath.row]
return cell
}
// 왼쪽 공백 제거
/*
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if(self.tableView.respondsToSelector(Selector("setSeparatorInset:"))) {
self.tableView.separatorInset = UIEdgeInsetsZero
}
if(self.tableView.respondsToSelector(Selector("setLayoutMargins:"))) {
self.tableView.layoutMargins = UIEdgeInsetsZero
}
if(cell.respondsToSelector(Selector("setLayoutMargins:"))) {
cell.layoutMargins = UIEdgeInsetsZero
}
}
*/
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
}
extension ViewController:UITableViewDelegate
{
// 터치시 터치한 아이템을 처리한다.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(items[indexPath.row])
}
}
class ViewController: UIViewController {
// ** TableView Variable
var items:[String] = ["First", "Second", "Third"]
var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
let navigationBarHeight:Int = 44
// ** Add Navigation Bar
let navigationBar = UINavigationBar(frame:CGRect(x:0, y:0, width:Int(view.frame.size.width),height:navigationBarHeight))
navigationBar.backgroundColor = UIColor.gray
let navigationItem = UINavigationItem()
navigationItem.title = "AlimPang"
let leftButton = UIBarButtonItem(title:"Save", style: .plain, target: self, action:#selector(ViewController.btn_clicked(_:)))
let rightButton = UIBarButtonItem(title:"Right", style: .plain, target: self, action:nil)
navigationItem.leftBarButtonItem = leftButton
navigationItem.rightBarButtonItem = rightButton
navigationBar.items = [navigationItem]
self.view.addSubview(navigationBar)
// ** TableView Adding
let barHeight: CGFloat = UIApplication.shared.statusBarFrame.size.height
let displayWidth: CGFloat = self.view.frame.width
let displayHeight: CGFloat = self.view.frame.height
tableView = UITableView(frame: CGRect(x: CGFloat(0), y: CGFloat(navigationBarHeight), width: displayWidth, height: displayHeight - barHeight - CGFloat(navigationBarHeight)))
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "MyCell")
tableView.dataSource = self
tableView.delegate = self
self.view.addSubview(tableView)
/*
self.tableView.translatesAutoresizingMaskIntoConstraints = false
self.view.addConstraint(NSLayoutConstraint(item: self.tableView,
attribute: .top, relatedBy: .equal, toItem: self.view,
attribute: .top, multiplier: 1.0, constant: 0))
self.view.addConstraint(NSLayoutConstraint(item: self.tableView,
attribute: .bottom, relatedBy: .equal, toItem: self.view,
attribute: .bottom, multiplier: 1.0, constant: 0))
self.view.addConstraint(NSLayoutConstraint(item: self.tableView,
attribute: .leading, relatedBy: .equal, toItem: self.view,
attribute: .leading, multiplier: 1.0, constant: 0))
*/
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewWillAppear(_ animated: Bool)
{
super.viewWillAppear(animated)
UIApplication.shared.isStatusBarHidden = true
//tableView.reloadData()
/*
let screenSize:CGRect = UIScreen.main.bounds
tableView.frame = CGRect(x:0, y:0, width:screenSize.width, height:screenSize.height)
tableView.dataSource = self
tableView.delegate = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier:"myCell")
self.view.addSubview(tableView)
*/
}
@objc func btn_clicked(_ sender:UIBarButtonItem)
{
}
}
Android 와 SWIFT 개념 비교 (0) | 2018.05.20 |
---|---|
화면 처리 순서 (0) | 2018.05.19 |
Status Bar 숨기기 (Carrier/ Wifi/ BatteryIcon Bar) (0) | 2018.05.18 |
Constraint 동적 추가 (0) | 2018.05.17 |
CommonLib.swift (0) | 2018.05.17 |
1. info.plist 에서 (+) 를 눌러 View controller-based status...를 추가한다.
Value = NO 로 한다.
그리고, (+) 를 눌러 Status bar is initially hidden = YES 도 추가한다.
2. ViewController.swift 열어서 아래 코드를 추가한다.
override func viewWillAppear(_ animated: Bool)
{
super.viewWillAppear(animated)
UIApplication.shared.isStatusBarHidden = true
}
화면 처리 순서 (0) | 2018.05.19 |
---|---|
동적으로 NavigationBar 와 TableView 추가.code (0) | 2018.05.18 |
Constraint 동적 추가 (0) | 2018.05.17 |
CommonLib.swift (0) | 2018.05.17 |
Class 정의 (0) | 2018.05.16 |
참고 : https://magi82.github.io/implement-uitableview-programmatically-in-swift/
동적으로 NavigationBar 와 TableView 추가.code (0) | 2018.05.18 |
---|---|
Status Bar 숨기기 (Carrier/ Wifi/ BatteryIcon Bar) (0) | 2018.05.18 |
CommonLib.swift (0) | 2018.05.17 |
Class 정의 (0) | 2018.05.16 |
애플 Swift Standard Library (0) | 2018.05.16 |
참고 : http://zeany.net/28
//
// CommonLib.swift
// TodoBox
//
// Created by GANG WOOK KIM on 16/05/2018.
// Copyright © 2018 GANG WOOK KIM. All rights reserved.
//
import Foundation
import UIKit
public class CommonLib
{
init()
{
}
class public func UIColorFromRGB(_ rgbValue: UInt) -> UIColor
{
return UIColor(
red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat( rgbValue & 0x0000FF ) / 255.0,
alpha: CGFloat(1.0)
)
}
class public func UIColorFromRGB(_ rgbValue:String) -> UIColor
{
var cString:String = rgbValue.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
if (cString.hasPrefix("#"))
{
cString.remove(at: cString.startIndex)
}
if ((cString.count) != 6)
{
return UIColor.gray
}
var rgbValue:UInt32 = 0
Scanner(string: cString).scanHexInt32(&rgbValue)
return UIColor(
red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat( rgbValue & 0x0000FF ) / 255.0,
alpha: CGFloat(1.0)
)
}
}
Status Bar 숨기기 (Carrier/ Wifi/ BatteryIcon Bar) (0) | 2018.05.18 |
---|---|
Constraint 동적 추가 (0) | 2018.05.17 |
Class 정의 (0) | 2018.05.16 |
애플 Swift Standard Library (0) | 2018.05.16 |
Swift.org (0) | 2018.05.16 |