The purpose of this projects is to create a community for Artists and photographers to show off their artworks as well as photos.
git clone https://github.com/Ivan275/MyiOSApp.git
You need install git and pod in you local machine
git install
pod install
A step by step series of examples that tell you have to get a development env running
Say what the step will be
git install
pod install
End with an example of getting some data out of the system or using it for a little demo
- Introduction page with Swipping horizontal features
- Loggin page with Facebook Authetication login through Facebook SDK
- Animation of buttons with smonthly disappear
- Navigation of Main User Interface with Tap bar
- Map displays in location by Google SDK
- Add Photos and list contacts
Explain how to run the automated tests for this system
- AutoLayout Function 1
view.addSubview(collectionView)
collectionView.translatesAutoresizingMaskIntoConstraints = false
collectionView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
collectionView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor).isActive = true
collectionView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true
collectionView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor).isActive = true
- AutoLayout Function 2
addSubview(selectedImage)
selectedImage.translatesAutoresizingMaskIntoConstraints = false
addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[v0]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": selectedImage]))
addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[v0]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": selectedImage]))
- UIcollectionView -Data Source and Delegate
private let scrollCellId = "scrollId"
collectionView?.register(DetailScrollImageCell.self, forCellWithReuseIdentifier: scrollCellId)
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 2
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
return collectionView.dequeueReusableCell(withReuseIdentifier: scrollCellId, for: indexPath) as! DetailScrollImageCell
}
class DetailImageCell: UICollectionViewCell {
.....
}
- Animation button disappear in the screen
private func disappearButtonsAndPageController() {
if(pageController.currentPage == pages.count) {
pageConstraint?.constant = 30
skipConstraint?.constant = -30
nextConstraint?.constant = 30
} else {
pageConstraint?.constant = 0
skipConstraint?.constant = 20
nextConstraint?.constant = -20
}
UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseOut, animations: {
self.view.layoutIfNeeded()
}, completion: nil)
}
- Auto adjust to fit height text
let attributeString = NSMutableAttributedString(string: page.title, attributes: [NSAttributedStringKey.font: UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.medium), NSAttributedStringKey.foregroundColor: UIColor(white: 0.2, alpha: 1)])
attributeString.append(NSAttributedString(string: "\n\n \(page.description)", attributes: [NSAttributedStringKey.font: UIFont.systemFont(ofSize: 14), NSAttributedStringKey.foregroundColor: UIColor(white: 0.2, alpha: 1)]))
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = .center
let length = attributeString.string.count
attributeString.addAttribute(NSAttributedStringKey.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: length))
textArea.attributedText = attributeString
- Data persistence for user login - User Dafault (store small piece of data)
func finishLogin() {
UserDefaults.standard.setLogin(value: true)
}
func isLogin() -> Bool {
return UserDefaults.standard.getLogin()
}
extension UserDefaults {
func setLogin(value: Bool) {
set(value, forKey: "isLoggedIn")
synchronize()
}
func getLogin() -> Bool {
return bool(forKey: "isLoggedIn")
}
}
- ObserveKeyboard - show and end keyboard
func observeKeyboard() {
NotificationCenter.default.addObserver(self, selector: #selector(showKeyboard), name: .UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(endKeyboard), name: .UIKeyboardWillHide, object: nil)
}
- Adding Tap in main TapBarController
var gallery : GalleryController?
var contact : ContactController?
var setting : SettingController?
var subViewController: [UIViewController] = []
override func viewDidLoad() {
super.viewDidLoad()
gallery = GalleryController()
contact = ContactController()
setting = SettingController()
subViewController.append(gallery)
subViewController.append(contact)
subViewController.append(setting)
gallery.tabBarItem.tag = 0
contact.tabBarItem.tag = 1
setting.tabBarItem.tag = 2
self.setViewControllers(subViewController, animated: true)
- Ivan He - Software Developer - Home Website
See other project in the list of contributors in my project.
This project is licensed under the Ivan He.