• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Beauty Gallery is an iOS App written in Swift

BeautyGallery

Beauty Gallery is an iOS App written in Swift. This app is used for an online video training course. This app demonstrates how to use storyboards and segues, Navigation Controller, Social Framework, Tab Bar Controller and Auto Layout.

Screenshots

BeautyGallery

BeautyGallery

BeautyGallery

中文描述

Beauty Gallery是一个使用Swift语言开发的iOS App,这是免费在线视频课程 女神画廊 app)的源代码,在这个app中,我演示了如何使用Storyboards和Segues, Navigation Controller, Social Framework, Tab Bar Controller以及Auto Layout。

Storyboards和Segues - 女神画廊 app

最终截图

BeautyGallery

BeautyGallery

BeautyGallery

最终源码

Storyboards和Segues课程源码

Navigation Controller - 女神画廊 app

课程开始源码

如果没有学习前面的课程,可以下载下面的源码开始学习。 课程开始源码 请注意,由于Apple不断的修改Swift的编译器,这里需要进行小量修改使得代码可以通过Xcode 6 GM版本的编译。在 Auto Layout - 女神画廊 app 视频中讲述到如何修改这些代码,也可以参考下面的方法进行修改。

在ViewControllerExtension.swift文件

extension ViewController: UIPickerViewDataSource {
    // two required methods
    func numberOfComponentsInPickerView(pickerView: UIPickerView!) -> Int {
        return 1
    }
    
    func pickerView(pickerView: UIPickerView!, numberOfRowsInComponent component: Int) -> Int {
        return beauties.count
    }
}

extension ViewController: UIPickerViewDelegate {
    func pickerView(pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String! {
        return beauties[row]
    }
}

删除UIPickerView后的三个感叹号,修改为

extension ViewController: UIPickerViewDataSource {
    // two required methods
    func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
        return 1
    }
    
    func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        return beauties.count
    }
}

extension ViewController: UIPickerViewDelegate {
    func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
        return beauties[row]
    }
}

在ViewController.swift文件

override func prepareForSegue(segue:
        UIStoryboardSegue!, sender: AnyObject!) {
            if segue.identifier == "GoToGallery" {
                let index = beautyPicker.selectedRowInComponent(0)
                
                var vc = segue.destinationViewController as GalleryViewController
                switch index {
                case 0:
                    vc.imageName = "fanbingbing"
                case 1:
                    vc.imageName = "libingbing"
                case 2:
                    vc.imageName = "wangfei"
                case 3:
                    vc.imageName = "yangmi"
                case 4:
                    vc.imageName = "zhouxun"
                default:
                    vc.imageName = nil
                }
            }
    }

删除UIStoryboardSegue后的感叹号,修改为

override func prepareForSegue(segue:
        UIStoryboardSegue, sender: AnyObject!) {
            if segue.identifier == "GoToGallery" {
                let index = beautyPicker.selectedRowInComponent(0)
                
                var vc = segue.destinationViewController as GalleryViewController
                switch index {
                case 0:
                    vc.imageName = "fanbingbing"
                case 1:
                    vc.imageName = "libingbing"
                case 2:
                    vc.imageName = "wangfei"
                case 3:
                    vc.imageName = "yangmi"
                case 4:
                    vc.imageName = "zhouxun"
                default:
                    vc.imageName = nil
                }
            }
    }

最终截图

BeautyGallery

BeautyGallery

最终源码

Navigation Controller课程源码

Tab Bar Controller - 女神画廊 app

课程开始源码

如果没有学习前面的课程,可以下载下面的源码开始学习。 课程开始源码 请注意,由于Apple不断的修改Swift的编译器,这里需要进行小量修改使得代码可以通过Xcode 6 GM版本的编译。在 Auto Layout - 女神画廊 app 视频中讲述到如何修改这些代码,也可以参考下面的方法进行修改。

在ViewControllerExtension.swift文件

extension ViewController: UIPickerViewDataSource {
    // two required methods
    func numberOfComponentsInPickerView(pickerView: UIPickerView!) -> Int {
        return 1
    }
    
    func pickerView(pickerView: UIPickerView!, numberOfRowsInComponent component: Int) -> Int {
        return beauties.count
    }
}

extension ViewController: UIPickerViewDelegate {
    func pickerView(pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String! {
        return beauties[row]
    }
}

删除UIPickerView后的三个感叹号,修改为

extension ViewController: UIPickerViewDataSource {
    // two required methods
    func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
        return 1
    }
    
    func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        return beauties.count
    }
}

extension ViewController: UIPickerViewDelegate {
    func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
        return beauties[row]
    }
}

在ViewController.swift文件

override func prepareForSegue(segue:
        UIStoryboardSegue!, sender: AnyObject!) {
            if segue.identifier == "GoToGallery" {
                let index = beautyPicker.selectedRowInComponent(0)
                
                var vc = segue.destinationViewController as GalleryViewController
                switch index {
                case 0:
                    vc.imageName = "fanbingbing"
                case 1:
                    vc.imageName = "libingbing"
                case 2:
                    vc.imageName = "wangfei"
                case 3:
                    vc.imageName = "yangmi"
                case 4:
                    vc.imageName = "zhouxun"
                default:
                    vc.imageName = nil
                }
            }
    }

删除UIStoryboardSegue后的感叹号,修改为

override func prepareForSegue(segue:
        UIStoryboardSegue, sender: AnyObject!) {
            if segue.identifier == "GoToGallery" {
                let index = beautyPicker.selectedRowInComponent(0)
                
                var vc = segue.destinationViewController as GalleryViewController
                switch index {
                case 0:
                    vc.imageName = "fanbingbing"
                case 1:
                    vc.imageName = "libingbing"
                case 2:
                    vc.imageName = "wangfei"
                case 3:
                    vc.imageName = "yangmi"
                case 4:
                    vc.imageName = "zhouxun"
                default:
                    vc.imageName = nil
                }
            }
    }

最终截图

BeautyGallery

BeautyGallery

BeautyGallery

BeautyGallery

最终源码

Tab Bar Controller课程源码

Auto Layout - 女神画廊 app

课程开始源码

如果没有学习前面的课程,可以下载下面的源码开始学习。 课程开始源码 请注意,由于Apple不断的修改Swift的编译器,这里需要进行小量修改使得代码可以通过Xcode 6 GM版本的编译。在 Auto Layout - 女神画廊 app 视频中讲述到如何修改这些代码,也可以参考下面的方法进行修改。

在ViewControllerExtension.swift文件

extension ViewController: UIPickerViewDataSource {
    // two required methods
    func numberOfComponentsInPickerView(pickerView: UIPickerView!) -> Int {
        return 1
    }
    
    func pickerView(pickerView: UIPickerView!, numberOfRowsInComponent component: Int) -> Int {
        return beauties.count
    }
}

extension ViewController: UIPickerViewDelegate {
    func pickerView(pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String! {
        return beauties[row]
    }
}

删除UIPickerView后的三个感叹号,修改为

extension ViewController: UIPickerViewDataSource {
    // two required methods
    func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
        return 1
    }
    
    func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        return beauties.count
    }
}

extension ViewController: UIPickerViewDelegate {
    func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
        return beauties[row]
    }
}

在ViewController.swift文件

override func prepareForSegue(segue:
        UIStoryboardSegue!, sender: AnyObject!) {
            if segue.identifier == "GoToGallery" {
                let index = beautyPicker.selectedRowInComponent(0)
                
                var vc = segue.destinationViewController as GalleryViewController
                switch index {
                case 0:
                    vc.imageName = "fanbingbing"
                case 1:
                    vc.imageName = "libingbing"
                case 2:
                    vc.imageName = "wangfei"
                case 3:
                    vc.imageName = "yangmi"
                case 4:
                    vc.imageName = "zhouxun"
                default:
                    vc.imageName = nil
                }
            }
    }

删除UIStoryboardSegue后的感叹号,修改为

override func prepareForSegue(segue:
        UIStoryboardSegue, sender: AnyObject!) {
            if segue.identifier == "GoToGallery" {
                let index = beautyPicker.selectedRowInComponent(0)
                
                var vc = segue.destinationViewController as GalleryViewController
                switch index {
                case 0:
                    vc.imageName = "fanbingbing"
                case 1:
                    vc.imageName = "libingbing"
                case 2:
                    vc.imageName = "wangfei"
                case 3:
                    vc.imageName = "yangmi"
                case 4:
                    vc.imageName = "zhouxun"
                default:
                    vc.imageName = nil
                }
            }
    }

最终截图

BeautyGallery

BeautyGallery

最终源码

Auto Layout课程源码

More Repositories

1

SwiftLanguageWeather

Swift Language Weather is an iOS weather app developed in Swift 4.
Swift
5,239
star
2

SaveTheDot

A game developed using UIViewPropertyAnimator
Swift
803
star
3

Todo

A todo list app written in Swift
Swift
272
star
4

iOSAnimationSample

This app is an iOS Animation playground to exercise different iOS Animations. The app is written in Swift.
Swift
189
star
5

ChineseZodiac

Chinese Zodiac is an iOS app developed in Swift
Swift
152
star
6

LoveFinder

Love Finder is an iOS App written in Swift
Swift
151
star
7

IBCalculator

IBCalculator is an example app to demonstrate how to use @IBDesignable and @IBInspectable
Swift
62
star
8

PokemonStickerPack

PokémonStickerPack is a Pokémon sticker pack for iOS 10 Messages app
57
star
9

Moments-SwiftUI

WeChat-like Moments App implemented using Swift 5.5 and SwiftUI
Swift
47
star
10

ConflictResolver

ConflictResolver is an Apple Watch App written in Swift. It is a typical Rock Paper Scissors game.
Swift
44
star
11

Underscore

Functional programming extensions for cross-platform Swift
Swift
30
star
12

ReactNativeWeather

A weather app developed in React Native. It is the React Native version of SwiftWeather.
JavaScript
22
star
13

cocos2d-meteor

Bring Cocos2d-js and Meteor together.
JavaScript
17
star
14

DuolingoNotes

Duolingo Notes can help the duolingo users save notes during learning.
JavaScript
11
star
15

SchoolZones

An iOS app uses MapKit to display School Zones, it is written in Swift.
Swift
7
star
16

IBPresentation

Slides made in Interface Builder with IBAnimatable for presentations in /dev/world and Yow Connected Conferences
Swift
7
star
17

spritekit-parkour

Packour is a fully functional mini game which is developed using Sprite Kit.
Objective-C
5
star
18

CombinePlayground

A Swift Playground to play around Combine
Swift
5
star
19

crypto-raffle

Crypto Raffle is an example project to demonstrate how to develop Ethereum smart contract and DApp
JavaScript
3
star
20

SwiftWeather-Slides

Slides for Swift Weather app video course.
JavaScript
3
star
21

glossary

A Windows Phone 7 app using XML, Isolated Storage.
C#
3
star
22

ethereum-smart-contract-course

This repo is used for Ethereum Smart contract development course
2
star
23

weex

A framework for building Mobile cross-platform UI
Java
1
star
24

99multiplier

A simple game for practicing multiplications, good for school kids for learning.
TypeScript
1
star
25

ethereum-remittance

A smart contract for remittance running on Ethereum EVM
JavaScript
1
star
26

Meteor2048

A multiplayer online 2048 game made with Meteor
CSS
1
star
27

ruby-basic-slides

Slides for Ruby Basic video course
JavaScript
1
star
28

SwiftAlgorithmsPlayground

Swift playground to play around algorithms
Swift
1
star