diff --git a/BeautyGallery.xcodeproj/project.pbxproj b/BeautyGallery.xcodeproj/project.pbxproj index 9283ab8..74668a8 100644 --- a/BeautyGallery.xcodeproj/project.pbxproj +++ b/BeautyGallery.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 236CE15119B0B31900B1E85A /* GalleryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 236CE15019B0B31900B1E85A /* GalleryViewController.swift */; }; 236CE15319B0B50900B1E85A /* ViewControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 236CE15219B0B50900B1E85A /* ViewControllerExtension.swift */; }; 236E400619B5B15A00A4233B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 236E400519B5B15A00A4233B /* Images.xcassets */; }; + 239A1C4719BDE32F008DFF40 /* KoreanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239A1C4619BDE32F008DFF40 /* KoreanViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -38,6 +39,7 @@ 236CE15019B0B31900B1E85A /* GalleryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GalleryViewController.swift; sourceTree = ""; }; 236CE15219B0B50900B1E85A /* ViewControllerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewControllerExtension.swift; sourceTree = ""; }; 236E400519B5B15A00A4233B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 239A1C4619BDE32F008DFF40 /* KoreanViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KoreanViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -83,6 +85,7 @@ 236CE13519B0B0FA00B1E85A /* ViewController.swift */, 236CE15219B0B50900B1E85A /* ViewControllerExtension.swift */, 236CE15019B0B31900B1E85A /* GalleryViewController.swift */, + 239A1C4619BDE32F008DFF40 /* KoreanViewController.swift */, 236CE13719B0B0FA00B1E85A /* Main.storyboard */, 236E400519B5B15A00A4233B /* Images.xcassets */, 236CE13119B0B0FA00B1E85A /* Supporting Files */, @@ -215,6 +218,7 @@ buildActionMask = 2147483647; files = ( 236CE15319B0B50900B1E85A /* ViewControllerExtension.swift in Sources */, + 239A1C4719BDE32F008DFF40 /* KoreanViewController.swift in Sources */, 236CE15119B0B31900B1E85A /* GalleryViewController.swift in Sources */, 236CE13619B0B0FA00B1E85A /* ViewController.swift in Sources */, 236CE13419B0B0FA00B1E85A /* AppDelegate.swift in Sources */, diff --git a/BeautyGallery/Base.lproj/Main.storyboard b/BeautyGallery/Base.lproj/Main.storyboard index f6c5357..f114026 100644 --- a/BeautyGallery/Base.lproj/Main.storyboard +++ b/BeautyGallery/Base.lproj/Main.storyboard @@ -1,31 +1,30 @@ - + + + + + + - @@ -49,17 +51,19 @@ + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -169,12 +261,15 @@ + + + diff --git a/BeautyGallery/Images.xcassets/facebook.imageset/Contents.json b/BeautyGallery/Images.xcassets/facebook.imageset/Contents.json new file mode 100644 index 0000000..4af9a09 --- /dev/null +++ b/BeautyGallery/Images.xcassets/facebook.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "facebook.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "facebook@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/BeautyGallery/Images.xcassets/facebook.imageset/facebook.png b/BeautyGallery/Images.xcassets/facebook.imageset/facebook.png new file mode 100644 index 0000000..4fdfd6a Binary files /dev/null and b/BeautyGallery/Images.xcassets/facebook.imageset/facebook.png differ diff --git a/BeautyGallery/Images.xcassets/facebook.imageset/facebook@2x.png b/BeautyGallery/Images.xcassets/facebook.imageset/facebook@2x.png new file mode 100644 index 0000000..4ebea8f Binary files /dev/null and b/BeautyGallery/Images.xcassets/facebook.imageset/facebook@2x.png differ diff --git a/BeautyGallery/Images.xcassets/twitter.imageset/Contents.json b/BeautyGallery/Images.xcassets/twitter.imageset/Contents.json new file mode 100644 index 0000000..fb99250 --- /dev/null +++ b/BeautyGallery/Images.xcassets/twitter.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "twitter.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "twitter@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/BeautyGallery/Images.xcassets/twitter.imageset/twitter.png b/BeautyGallery/Images.xcassets/twitter.imageset/twitter.png new file mode 100644 index 0000000..accc696 Binary files /dev/null and b/BeautyGallery/Images.xcassets/twitter.imageset/twitter.png differ diff --git a/BeautyGallery/Images.xcassets/twitter.imageset/twitter@2x.png b/BeautyGallery/Images.xcassets/twitter.imageset/twitter@2x.png new file mode 100644 index 0000000..127dd1b Binary files /dev/null and b/BeautyGallery/Images.xcassets/twitter.imageset/twitter@2x.png differ diff --git a/BeautyGallery/Images.xcassets/weibo.imageset/Contents.json b/BeautyGallery/Images.xcassets/weibo.imageset/Contents.json new file mode 100644 index 0000000..d239aa9 --- /dev/null +++ b/BeautyGallery/Images.xcassets/weibo.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "weibo.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "weibo@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/BeautyGallery/Images.xcassets/weibo.imageset/weibo.png b/BeautyGallery/Images.xcassets/weibo.imageset/weibo.png new file mode 100644 index 0000000..50f5c11 Binary files /dev/null and b/BeautyGallery/Images.xcassets/weibo.imageset/weibo.png differ diff --git a/BeautyGallery/Images.xcassets/weibo.imageset/weibo@2x.png b/BeautyGallery/Images.xcassets/weibo.imageset/weibo@2x.png new file mode 100644 index 0000000..230ecc7 Binary files /dev/null and b/BeautyGallery/Images.xcassets/weibo.imageset/weibo@2x.png differ diff --git a/BeautyGallery/Info.plist b/BeautyGallery/Info.plist index f0589d3..ec1b356 100644 --- a/BeautyGallery/Info.plist +++ b/BeautyGallery/Info.plist @@ -31,6 +31,8 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight diff --git a/BeautyGallery/KoreanViewController.swift b/BeautyGallery/KoreanViewController.swift new file mode 100644 index 0000000..15b18be --- /dev/null +++ b/BeautyGallery/KoreanViewController.swift @@ -0,0 +1,48 @@ +// +// KoreanViewController.swift +// BeautyGallery +// +// Created by Jake Lin on 8/09/2014. +// Copyright (c) 2014 rushjet. All rights reserved. +// + + +import UIKit +import Social + +class KoreanViewController: UIViewController { + + @IBOutlet weak var beautyImage: UIImageView! + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func facebookTapped(sender: AnyObject) { + var controller:SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook) + controller.setInitialText("一起来玩女神画廊App,Github上的源码在 https://github.com/JakeLin/BeautyGallery") + controller.addImage(beautyImage.image) + self.presentViewController(controller, animated: true, completion: nil) + + } + + @IBAction func twitterTapped(sender: AnyObject) { + var controller:SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeTwitter) + controller.setInitialText("一起来玩女神画廊App,Github上的源码在 https://github.com/JakeLin/BeautyGallery") + controller.addImage(beautyImage.image) + self.presentViewController(controller, animated: true, completion: nil) + } + + + @IBAction func weiboTapped(sender: AnyObject) { + var controller:SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeSinaWeibo) + controller.setInitialText("一起来玩女神画廊App,Github上的源码在 https://github.com/JakeLin/BeautyGallery") + controller.addImage(beautyImage.image) + self.presentViewController(controller, animated: true, completion: nil) + } +} \ No newline at end of file diff --git a/BeautyGallery/ViewController.swift b/BeautyGallery/ViewController.swift index 9ced81e..4623f85 100644 --- a/BeautyGallery/ViewController.swift +++ b/BeautyGallery/ViewController.swift @@ -28,7 +28,7 @@ class ViewController: UIViewController { } override func prepareForSegue(segue: - UIStoryboardSegue!, sender: AnyObject!) { + UIStoryboardSegue, sender: AnyObject!) { if segue.identifier == "GoToGallery" { let index = beautyPicker.selectedRowInComponent(0) diff --git a/BeautyGallery/ViewControllerExtension.swift b/BeautyGallery/ViewControllerExtension.swift index 0c63fb8..bf67188 100644 --- a/BeautyGallery/ViewControllerExtension.swift +++ b/BeautyGallery/ViewControllerExtension.swift @@ -10,11 +10,11 @@ import UIKit extension ViewController: UIPickerViewDataSource { // two required methods - func numberOfComponentsInPickerView(pickerView: UIPickerView!) -> Int { + func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { return 1 } - func pickerView(pickerView: UIPickerView!, numberOfRowsInComponent component: Int) -> Int { + func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return beauties.count } } @@ -27,7 +27,7 @@ extension ViewController: UIPickerViewDelegate { // func pickerView(pickerView: UIPickerView!, rowHeightForComponent component: Int) -> CGFloat - func pickerView(pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String! { + func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! { return beauties[row] } diff --git a/Screenshots/10-fullsize.png b/Screenshots/10-fullsize.png new file mode 100644 index 0000000..1d042cb Binary files /dev/null and b/Screenshots/10-fullsize.png differ diff --git a/Screenshots/11-fullsize.png b/Screenshots/11-fullsize.png new file mode 100644 index 0000000..7be4414 Binary files /dev/null and b/Screenshots/11-fullsize.png differ