苹果官方例子

转自:  http://www.lwxshow.com/demo-for-iphone/
http://developer.apple.com/iphone/library/samplecode/Reachability/Reachability.zip
http://developer.apple.com/iphone/library/samplecode/avTouch/avTouch.zip
http://developer.apple.com/iphone/library/samplecode/AdvancedURLConnections/AdvancedURLConnections.zip 
http://developer.apple.com/iphone/library/samplecode/LocateMe/LocateMe.zip 
http://developer.apple.com/iphone/library/samplecode/SimpleFTPSample/SimpleFTPSample.zip 
http://developer.apple.com/iphone/library/samplecode/XMLPerformance/XMLPerformance.zip 
http://developer.apple.com/iphone/library/samplecode/iPhoneMultichannelMixerTest/iPhoneMultichannelMixerTest.zip 
http://developer.apple.com/iphone/library/samplecode/GLES2Sample/GLES2Sample.zip 
http://developer.apple.com/iphone/library/samplecode/GLPaint/GLPaint.zip 
http://developer.apple.com/iphone/library/samplecode/GLGravity/GLGravity.zip 
http://developer.apple.com/iphone/library/samplecode/WeatherMap/WeatherMap.zip 
http://developer.apple.com/iphone/library/samplecode/Touches/Touches.zip 
http://developer.apple.com/iphone/library/samplecode/Formulaic/Formulaic.zip 
http://developer.apple.com/iphone/library/samplecode/oalTouch/oalTouch.zip 
http://developer.apple.com/iphone/library/samplecode/UICatalog/UICatalog.zip 
http://developer.apple.com/iphone/library/samplecode/TouchCells/TouchCells.zip 
http://developer.apple.com/iphone/library/samplecode/TaggedLocations/TaggedLocations.zip 
http://developer.apple.com/iphone/library/samplecode/Locations/Locations.zip 
http://developer.apple.com/iphone/library/samplecode/HeaderFooter/HeaderFooter.zip 
http://developer.apple.com/iphone/library/samplecode/GLImageProcessing/GLImageProcessing.zip 
http://developer.apple.com/iphone/library/samplecode/CoreDataBooks/CoreDataBooks.zip 
http://developer.apple.com/iphone/library/samplecode/AppPrefs/AppPrefs.zip 
http://developer.apple.com/iphone/library/samplecode/AdvancedTableViewCells/AdvancedTableViewCells.zip 
http://developer.apple.com/iphone/library/samplecode/ViewTransitions/ViewTransitions.zip 
http://developer.apple.com/iphone/library/samplecode/MoveMe/MoveMe.zip 
http://developer.apple.com/iphone/library/samplecode/LazyTableImages/LazyTableImages.zip 
http://developer.apple.com/iphone/library/samplecode/CopyPasteTile/CopyPasteTile.zip 
http://developer.apple.com/iphone/library/samplecode/AccelerometerGraph/AccelerometerGraph.zip 
http://developer.apple.com/iphone/library/samplecode/AQOfflineRenderTest/AQOfflineRenderTest.zip 
http://developer.apple.com/iphone/library/samplecode/Teslameter/Teslameter.zip 
http://developer.apple.com/iphone/library/samplecode/SimpleEKDemo/SimpleEKDemo.zip 
http://developer.apple.com/iphone/library/samplecode/MessageComposer/MessageComposer.zip 
http://developer.apple.com/iphone/library/samplecode/iPhoneMixerEQGraphTest/iPhoneMixerEQGraphTest.zip 
http://developer.apple.com/iphone/library/samplecode/iPhoneCoreDataRecipes/iPhoneCoreDataRecipes.zip 
http://developer.apple.com/iphone/library/samplecode/WorldCities/WorldCities.zip 
http://developer.apple.com/iphone/library/samplecode/SeismicXML/SeismicXML.zip 
http://developer.apple.com/iphone/library/samplecode/Reflection/Reflection.zip 
http://developer.apple.com/iphone/library/samplecode/QuickContacts/QuickContacts.zip 
http://developer.apple.com/iphone/library/samplecode/QuartzDemo/QuartzDemo.zip 
http://developer.apple.com/iphone/library/samplecode/PVRTextureLoader/PVRTextureLoader.zip 
http://developer.apple.com/iphone/library/samplecode/MapCallouts/MapCallouts.zip 
http://developer.apple.com/iphone/library/samplecode/GLTextureAtlas/GLTextureAtlas.zip
http://developer.apple.com/iphone/library/samplecode/DateSectionTitles/DateSectionTitles.zip 
http://developer.apple.com/iphone/library/samplecode/URLCache/URLCache.zip 
http://developer.apple.com/iphone/library/samplecode/TransWeb/TransWeb.zip 
http://developer.apple.com/iphone/library/samplecode/WhichWayIsUp/WhichWayIsUp.zip 
http://developer.apple.com/iphone/library/samplecode/TableViewSuite/TableViewSuite.zip 
http://developer.apple.com/iphone/library/samplecode/LaunchMe/LaunchMe.zip 
http://developer.apple.com/iphone/library/samplecode/HelloWorld_iPhone/HelloWorld_iPhone.zip 
http://developer.apple.com/iphone/library/samplecode/HeadsUpUI/HeadsUpUI.zip 
http://developer.apple.com/iphone/library/samplecode/DrillDownSave/DrillDownSave.zip 
http://developer.apple.com/iphone/library/samplecode/TheElements/TheElements.zip 
http://developer.apple.com/iphone/library/samplecode/SimpleUndo/SimpleUndo.zip 
http://developer.apple.com/iphone/library/samplecode/SimpleDrillDown/SimpleDrillDown.zip 
http://developer.apple.com/iphone/library/samplecode/Scrolling/Scrolling.zip 
http://developer.apple.com/iphone/library/samplecode/PageControl/PageControl.zip 
http://developer.apple.com/iphone/library/samplecode/NavBar/NavBar.zip 
http://developer.apple.com/iphone/library/samplecode/MusicCube/MusicCube.zip 
http://developer.apple.com/iphone/library/samplecode/Metronome/Metronome.zip 
http://developer.apple.com/iphone/library/samplecode/CurrentAddress/CurrentAddress.zip 
http://developer.apple.com/iphone/library/samplecode/AlternateViews/AlternateViews.zip 
http://developer.apple.com/iphone/library/samplecode/Accessory/Accessory.zip 
http://developer.apple.com/iphone/library/samplecode/MailComposer/MailComposer.zip 
http://developer.apple.com/iphone/library/samplecode/iPhoneUnitTests/iPhoneUnitTests.zip 
http://developer.apple.com/iphone/library/samplecode/TopSongs/TopSongs.zip 
http://developer.apple.com/iphone/library/samplecode/TableSearch/TableSearch.zip 
http://developer.apple.com/iphone/library/samplecode/DateCell/DateCell.zip 
http://developer.apple.com/iphone/library/samplecode/InternationalMountains/InternationalMountains.zip
http://developer.apple.com/iphone/library/samplecode/BubbleLevel/BubbleLevel.zip 
http://developer.apple.com/iphone/library/samplecode/BonjourWeb/BonjourWeb.zip 
http://developer.apple.com/iphone/library/samplecode/ScrollViewSuite/ScrollViewSuite.zip 
http://developer.apple.com/iphone/library/samplecode/Trailers.dcproj/Trailers.dcproj.zip 
http://developer.apple.com/iphone/library/samplecode/SimpleGestureRecognizers/SimpleGestureRecognizers.zip 
http://developer.apple.com/iphone/library/samplecode/MultipleDetailViews/MultipleDetailViews.zip 
http://developer.apple.com/iphone/library/samplecode/ToolbarSearch/ToolbarSearch.zip 
http://developer.apple.com/iphone/library/samplecode/KeyboardAccessory/KeyboardAccessory.zip 
http://developer.apple.com/iphone/library/samplecode/TopPaid/TopPaid.zip 
http://developer.apple.com/iphone/library/samplecode/GKRocket/GKRocket.zip 
http://developer.apple.com/iphone/library/samplecode/FastEnumerationSample/FastEnumerationSample.zip 
http://developer.apple.com/iphone/library/samplecode/GLSprite/GLSprite.zip 
http://developer.apple.com/iphone/library/samplecode/AddMusic/AddMusic.zip 
http://developer.apple.com/iphone/library/samplecode/SimpleURLConnections/SimpleURLConnections.zip 
http://developer.apple.com/iphone/library/samplecode/SimpleNetworkStreams/SimpleNetworkStreams.zip 
http://developer.apple.com/iphone/library/samplecode/iPhoneExtAudioFileConvertTest/iPhoneExtAudioFileConvertTest.zip 
http://developer.apple.com/iphone/library/samplecode/aurioTouch/aurioTouch.zip 
http://developer.apple.com/iphone/library/samplecode/SpeakHere/SpeakHere.zip 
http://developer.apple.com/iphone/library/samplecode/GKTank/GKTank.zip 
http://developer.apple.com/iphone/library/samplecode/WiTap/WiTap.zip 
http://developer.apple.com/iphone/library/samplecode/PhotoLocations/PhotoLocations.zip 
http://developer.apple.com/iphone/library/samplecode/BatteryStatus/BatteryStatus.zip 
http://developer.apple.com/iphone/library/samplecode/GenericKeychain/GenericKeychain.zip 
http://developer.apple.com/iphone/library/samplecode/CryptoExercise/CryptoExercise.zip 
http://developer.apple.com/iphone/library/samplecode/MoviePlayer_iPhone/MoviePlayer_iPhone.zip

http://developer.apple.com/iphone/library/samplecode/SysSound/SysSound.zip

http://developer.apple.com/library/ios/samplecode/Birthdays/Birthdays.zip 
http://developer.apple.com/library/ios/samplecode/ClockControlPalette/ClockControlPalette.zip 
http://developer.apple.com/library/ios/samplecode/MVCNetworking/MVCNetworking.zip 
http://developer.apple.com/library/ios/samplecode/MoveMe/MoveMe.zip 
http://developer.apple.com/library/ios/samplecode/Conceptual/Conceptual.zip 
http://developer.apple.com/library/ios/samplecode/HistogramOperation/HistogramOperation.zip 
http://developer.apple.com/library/ios/samplecode/IMStatus/IMStatus.zip 
http://developer.apple.com/library/ios/samplecode/SQLiteQuery/SQLiteQuery.zip 
http://developer.apple.com/library/ios/samplecode/iPatch/iPatch.zip 
http://developer.apple.com/library/ios/samplecode/SimpleNetworkStreams/SimpleNetworkStreams.zip 
http://developer.apple.com/library/ios/samplecode/SimpleUndo/SimpleUndo.zip 
http://developer.apple.com/library/ios/samplecode/Trailers.dcproj/Trailers.dcproj.zip 
http://developer.apple.com/library/ios/samplecode/URLCache/URLCache.zip 
http://developer.apple.com/library/ios/samplecode/iPhoneUnitTests/iPhoneUnitTests.zip 
http://developer.apple.com/library/ios/samplecode/QuickContacts/QuickContacts.zip 
http://developer.apple.com/library/ios/samplecode/iAdInterstitialSuite/iAdInterstitialSuite.zip 
http://developer.apple.com/library/ios/samplecode/iAdSuite/iAdSuite.zip 
http://developer.apple.com/library/ios/samplecode/AQOfflineRenderTest/AQOfflineRenderTest.zip 
http://developer.apple.com/library/ios/samplecode/SysSound/SysSound.zip 
http://developer.apple.com/library/ios/samplecode/SpeakHere/SpeakHere.zip 
http://developer.apple.com/library/ios/samplecode/iPhoneACFileConvertTest/iPhoneACFileConvertTest.zip 
http://developer.apple.com/library/ios/samplecode/iPhoneExtAudioFileConvertTest/iPhoneExtAudioFileConvertTest.zip
http://developer.apple.com/library/ios/samplecode/MixerHost/MixerHost.zip 
http://developer.apple.com/library/ios/samplecode/LoadPresetDemo/LoadPresetDemo.zip 
http://developer.apple.com/library/ios/samplecode/aurioTouch/aurioTouch.zip 
http://developer.apple.com/library/ios/samplecode/iPhoneMultichannelMixerTest/iPhoneMultichannelMixerTest.zip 
http://developer.apple.com/library/ios/samplecode/AVCam/AVCam.zip 
http://developer.apple.com/library/ios/samplecode/AVPlayerDemo/AVPlayerDemo.zip 
http://developer.apple.com/library/ios/samplecode/GLCameraRipple/GLCameraRipple.zip 
http://developer.apple.com/library/ios/samplecode/RosyWriter/RosyWriter.zip 
http://developer.apple.com/library/ios/samplecode/SquareCam/SquareCam.zip 
http://developer.apple.com/library/ios/samplecode/StitchedStreamPlayer/StitchedStreamPlayer.zip 
http://developer.apple.com/library/ios/samplecode/StopNGo/StopNGo.zip 
http://developer.apple.com/library/ios/samplecode/avTouch/avTouch.zip 
http://developer.apple.com/library/ios/samplecode/iPhoneMixerEQGraphTest/iPhoneMixerEQGraphTest.zip 
http://developer.apple.com/library/ios/samplecode/CoreDataBooks/CoreDataBooks.zip 
http://developer.apple.com/library/ios/samplecode/DateSectionTitles/DateSectionTitles.zip 
http://developer.apple.com/library/ios/samplecode/Locations/Locations.zip 
http://developer.apple.com/library/ios/samplecode/PhotoLocations/PhotoLocations.zip 
http://developer.apple.com/library/ios/samplecode/TaggedLocations/TaggedLocations.zip 
http://developer.apple.com/library/ios/samplecode/ThreadedCoreData/ThreadedCoreData.zip 
http://developer.apple.com/library/ios/samplecode/TopSongs/TopSongs.zip 
http://developer.apple.com/library/ios/samplecode/iPhoneCoreDataRecipes/iPhoneCoreDataRecipes.zip 
http://developer.apple.com/library/ios/samplecode/LargeImageDownsizing/LargeImageDownsizing.zip 
http://developer.apple.com/library/ios/samplecode/QuartzDemo/QuartzDemo.zip 
http://developer.apple.com/library/ios/samplecode/SimpleStocks/SimpleStocks.zip 
http://developer.apple.com/library/ios/samplecode/ZoomingPDFViewer/ZoomingPDFViewer.zip 
http://developer.apple.com/library/ios/samplecode/PocketCoreImage/PocketCoreImage.zip 
http://developer.apple.com/library/ios/samplecode/CoreTextPageViewer/CoreTextPageViewer.zip 
http://developer.apple.com/library/ios/samplecode/GeocoderDemo/GeocoderDemo.zip 
http://developer.apple.com/library/ios/samplecode/LocateMe/LocateMe.zip 
http://developer.apple.com/library/ios/samplecode/Teslameter/Teslameter.zip 
http://developer.apple.com/library/ios/samplecode/pARk/pARk.zip 
http://developer.apple.com/library/ios/samplecode/CoreTelephonyDemo/CoreTelephonyDemo.zip 
http://developer.apple.com/library/ios/samplecode/SimpleEKDemo/SimpleEKDemo.zip 
http://developer.apple.com/library/ios/samplecode/EADemo/EADemo.zip 
http://developer.apple.com/library/ios/samplecode/AdvancedURLConnections/AdvancedURLConnections.zip 
http://developer.apple.com/library/ios/samplecode/BonjourWeb/BonjourWeb.zip 
http://developer.apple.com/library/ios/samplecode/FastEnumerationSample/FastEnumerationSample.zip 
http://developer.apple.com/library/ios/samplecode/ListAdder/ListAdder.zip 
http://developer.apple.com/library/ios/samplecode/SimpleFTPSample/SimpleFTPSample.zip 
http://developer.apple.com/library/ios/samplecode/SimpleURLConnections/SimpleURLConnections.zip 
http://developer.apple.com/library/ios/samplecode/WiTap/WiTap.zip 
http://developer.apple.com/library/ios/samplecode/XMLPerformance/XMLPerformance.zip 
http://developer.apple.com/library/ios/samplecode/GKAuthentication/GKAuthentication.zip 
http://developer.apple.com/library/ios/samplecode/GKRocket/GKRocket.zip 
http://developer.apple.com/library/ios/samplecode/GKTank/GKTank.zip 
http://developer.apple.com/library/ios/samplecode/GKTapper/GKTapper.zip 
http://developer.apple.com/library/ios/samplecode/Breadcrumb/Breadcrumb.zip 
http://developer.apple.com/library/ios/samplecode/CurrentAddress/CurrentAddress.zip 
http://developer.apple.com/library/ios/samplecode/HazardMap/HazardMap.zip 
http://developer.apple.com/library/ios/samplecode/KMLViewer/KMLViewer.zip 
http://developer.apple.com/library/ios/samplecode/MapCallouts/MapCallouts.zip 
http://developer.apple.com/library/ios/samplecode/Regions/Regions.zip 
http://developer.apple.com/library/ios/samplecode/WeatherMap/WeatherMap.zip 
http://developer.apple.com/library/ios/samplecode/WorldCities/WorldCities.zip 
http://developer.apple.com/library/ios/samplecode/AddMusic/AddMusic.zip 
http://developer.apple.com/library/ios/samplecode/MoviePlayer_iPhone/MoviePlayer_iPhone.zip 
http://developer.apple.com/library/ios/samplecode/MailComposer/MailComposer.zip 
http://developer.apple.com/library/ios/samplecode/MessageComposer/MessageComposer.zip 
http://developer.apple.com/library/ios/samplecode/oalTouch/oalTouch.zip 
http://developer.apple.com/library/ios/samplecode/GLES2Sample/GLES2Sample.zip 
http://developer.apple.com/library/ios/samplecode/GLEssentials/GLEssentials.zip 
http://developer.apple.com/library/ios/samplecode/GLGravity/GLGravity.zip 
http://developer.apple.com/library/ios/samplecode/GLImageProcessing/GLImageProcessing.zip 
http://developer.apple.com/library/ios/samplecode/GLPaint/GLPaint.zip 
http://developer.apple.com/library/ios/samplecode/GLSprite/GLSprite.zip 
http://developer.apple.com/library/ios/samplecode/GLTextureAtlas/GLTextureAtlas.zip 
http://developer.apple.com/library/ios/samplecode/MusicCube/MusicCube.zip 
http://developer.apple.com/library/ios/samplecode/PVRTextureLoader/PVRTextureLoader.zip 
http://developer.apple.com/library/ios/samplecode/ViewTransitions/ViewTransitions.zip 
http://developer.apple.com/library/ios/samplecode/CryptoExercise/CryptoExercise.zip 
http://developer.apple.com/library/ios/samplecode/GenericKeychain/GenericKeychain.zip 
http://developer.apple.com/library/ios/samplecode/Reachability/Reachability.zip 
http://developer.apple.com/library/ios/samplecode/Tweeting/Tweeting.zip 
http://developer.apple.com/library/ios/samplecode/AccelerometerGraph/AccelerometerGraph.zip 
http://developer.apple.com/library/ios/samplecode/Accessory/Accessory.zip 
http://developer.apple.com/library/ios/samplecode/AdvancedTableViewCells/AdvancedTableViewCells.zip 
http://developer.apple.com/library/ios/samplecode/AlternateViews/AlternateViews.zip 
http://developer.apple.com/library/ios/samplecode/AppPrefs/AppPrefs.zip 
http://developer.apple.com/library/ios/samplecode/BatteryStatus/BatteryStatus.zip 
http://developer.apple.com/library/ios/samplecode/BubbleLevel/BubbleLevel.zip 
http://developer.apple.com/library/ios/samplecode/CopyPasteTile/CopyPasteTile.zip 
http://developer.apple.com/library/ios/samplecode/DateCell/DateCell.zip 
http://developer.apple.com/library/ios/samplecode/DocInteraction/DocInteraction.zip 
http://developer.apple.com/library/ios/samplecode/DrillDownSave/DrillDownSave.zip 
http://developer.apple.com/library/ios/samplecode/ExternalDisplay/ExternalDisplay.zip 
http://developer.apple.com/library/ios/samplecode/Formulaic/Formulaic.zip 
http://developer.apple.com/library/ios/samplecode/HeaderFooter/HeaderFooter.zip 
http://developer.apple.com/library/ios/samplecode/HeadsUpUI/HeadsUpUI.zip 
http://developer.apple.com/library/ios/samplecode/HelloWorld_iPhone/HelloWorld_iPhone.zip 
http://developer.apple.com/library/ios/samplecode/Icons/Icons.zip 
http://developer.apple.com/library/ios/samplecode/InternationalMountains/InternationalMountains.zip 
http://developer.apple.com/library/ios/samplecode/KeyboardAccessory/KeyboardAccessory.zip 
http://developer.apple.com/library/ios/samplecode/LaunchMe/LaunchMe.zip 
http://developer.apple.com/library/ios/samplecode/LazyTableImages/LazyTableImages.zip 
http://developer.apple.com/library/ios/samplecode/MultipleDetailViews/MultipleDetailViews.zip 
http://developer.apple.com/library/ios/samplecode/NavBar/NavBar.zip 
http://developer.apple.com/library/ios/samplecode/PageControl/PageControl.zip 
http://developer.apple.com/library/ios/samplecode/PhotoPicker/PhotoPicker.zip 
http://developer.apple.com/library/ios/samplecode/PhotoScroller/PhotoScroller.zip 
http://developer.apple.com/library/ios/samplecode/Popovers/Popovers.zip 
http://developer.apple.com/library/ios/samplecode/PrintPhoto/PrintPhoto.zip 
http://developer.apple.com/library/ios/samplecode/PrintWebView/PrintWebView.zip 
http://developer.apple.com/library/ios/samplecode/Recipes_+_Printing/Recipes_+_Printing.zip 
http://developer.apple.com/library/ios/samplecode/Reflection/Reflection.zip 
http://developer.apple.com/library/ios/samplecode/ScrollViewSuite/ScrollViewSuite.zip 
http://developer.apple.com/library/ios/samplecode/Scrolling/Scrolling.zip 
http://developer.apple.com/library/ios/samplecode/SeismicXML/SeismicXML.zip 
http://developer.apple.com/library/ios/samplecode/SimpleDrillDown/SimpleDrillDown.zip 
http://developer.apple.com/library/ios/samplecode/SimpleGestureRecognizers/SimpleGestureRecognizers.zip 
http://developer.apple.com/library/ios/samplecode/SimpleTextInput/SimpleTextInput.zip 
http://developer.apple.com/library/ios/samplecode/StreetScroller/StreetScroller.zip 
http://developer.apple.com/library/ios/samplecode/TableViewUpdates/TableViewUpdates.zip 
http://developer.apple.com/library/ios/samplecode/TableMultiSelect/TableMultiSelect.zip 
http://developer.apple.com/library/ios/samplecode/TableSearch/TableSearch.zip 
http://developer.apple.com/library/ios/samplecode/TableViewSuite/TableViewSuite.zip 
http://developer.apple.com/library/ios/samplecode/Tabster/Tabster.zip 
http://developer.apple.com/library/ios/samplecode/TheElements/TheElements.zip 
http://developer.apple.com/library/ios/samplecode/ToolbarSearch/ToolbarSearch.zip 
http://developer.apple.com/library/ios/samplecode/TopPaid/TopPaid.zip 
http://developer.apple.com/library/ios/samplecode/TouchCells/TouchCells.zip 
http://developer.apple.com/library/ios/samplecode/Touches/Touches.zip 
http://developer.apple.com/library/ios/samplecode/TransWeb/TransWeb.zip 
http://developer.apple.com/library/ios/samplecode/UICatalog/UICatalog.zip 
http://developer.apple.com/library/ios/samplecode/WhichWayIsUp/WhichWayIsUp.zip

时间: 2025-01-05 15:14:31

苹果官方例子的相关文章

Welcome to Swift (苹果官方Swift文档初译与注解三十五)---248~253页(第五章-- 函数 完)

Function Types as Return Types (函数类型作为返回值类型) 一个函数的类型可以作为另一个函数的返回值类型.可以在一个函数的返回值箭头后面写上一个完整的函数类型. 例如: 下面的例子定义了两个简单的函数,分别为stepForward 和 stepBackward.其中stepForward函数返回值比它的输入值多1,stepBackward函数返回值比它输入值少1.这两个函数的 类型都是(Int) -> Int: func stepForward(input: Int

Welcome to Swift (苹果官方Swift文档初译与注解二十七)---189~198页(第四章-- 流程控制)

Switch 一个switch语句里包含一个值,并且用这个值与其他几个可能的匹配模式进行比较,然后根据成功匹配上的模式,执行相应的代码块.switch语句提供了比if语句更多的选项来相应多种潜 在的情况. 最简单的一个例子: switch some value to consider { case value 1:   respond to value 1 case value 2, value 3:   respond to value 2 or 3 default:   otherwise,

Welcome to Swift (苹果官方Swift文档初译与注解二十一)---140~147页(第三章--集合类型)

第三章 Collection Types (集合类型) 在Swift中,提供了两种集合类型用来存储一组值:数组和字典.数组有序的存储相同类型的值;字典存储无序的相同类型的值.字典可以通过唯一的标识(就是所说的键)来查询和访问. 在Swift中,数组和字典总是要清晰的标明他们存储数据的类型.这就意味着不可以将错误的类型插入到数组或字典中.同时也意味着你是明确了解你要遍历的数组或字典里面数据的类 型.在Swift中,集合要显式的声明类型来保证在开发中都会明确的知道它能处理的数据类型. 注意点: 在S

Welcome to Swift (苹果官方Swift文档初译与注解十一)---70~76页(第二章)

Type Aliases (类型别名) 类型别名是个已经存在的类型定义另一个名字.定义类型别名的时候,使用关键字typealias. 当你想要使用名字来引用一个已经存在的类型时,类型别名将非常有效,并且更适合代码的上下文理解.例如,当要处理指定大小的一个数据时: typealias AudioSample = UInt16 一旦定义了一个类型别名,就可以在任何地方来代替原来的类型名: var maxAmplitudeFound = AudioSample.min // maxAmplitudeF

Welcome to Swift (苹果官方Swift文档初译与注解十)---63~69页(第二章)

如果你将整型与浮点型一起使用,结果将被认为是Double类型: et anotherPi = 3 + 0.14159 // anotherPi 的类型是Double 上述代码中,3的值是没有明确说明类型,因此,根据剩余部分的浮点类型可以确定返回值为Double. Numeric Literals (数值的进制表示) 整数类型可以进行如下表示: A decimal number, with no prefix         // 十进制数值,不需要前缀符号; A binary number, w

Welcome to Swift (苹果官方Swift文档初译与注解三十七)---261~265页(第六章-- 闭包)

Inferring Type From Context 上下文类型判断 因为排序的闭包是作为一个参数传递给函数,因此Swift可以判定这个参数的类型和根据sort函数第二个参数判断返回值的类型.这个参数的类型是(String, String) -> Bool,这意味着 String,String以及Bool类型都不需要在闭包定义的时候声明.因为所有的类型都可以由系统判定.因此,返回箭头以及参数名字的括号都可以省略: reversed = sort(names, { s1, s2 in retur

Welcome to Swift (苹果官方Swift文档初译与注解二十八)---199~208页(第四章-- 流程控制)

Value Bindings (绑定值) 在switch的case中可以绑定一个或者多个值给case体中的临时常量或者变量,这个成为绑定值. 代码样例: let anotherPoint = (2, 0) switch anotherPoint { case (let x, 0):   println("on the x-axis with an x value of \(x)") case (0, let y):   println("on the y-axis with

Welcome to Swift (苹果官方Swift文档初译与注解二十九)---209~218页(第四章-- 流程控制)

Break break语句会立刻结束整个流程控制的执行.break语句可以在switch语句或者循环语句中帮助你提前结束循环或者switch的执行. Break in a Loop Statement  (循环语句中的break) 当在循环语句中使用break,会立刻结束循环的执行,并且跳转到循环体之后的第一行代码.循环不会再遍历执行了. Break in a Switch Statement (switch语句的break) 当在switch语句中使用break,break会立刻结速switc

Welcome to Swift (苹果官方Swift文档初译与注解十二)---77~83页(第二章)

Optionals (可选类型) 当一个值可能有值,也可能没有值,这种情况你可以使用可选类型.可选类型的意思是: 有个一个值,它等于x,或者,根本没有任何值. 注意点: 可选类型的概念在C和OC中都是没有的.在OC中最相似的情况是,一个方法返回nil或者返回一个对象.OC中返回nil意思是没有合法的对象.然而,这只能针对对象,不能用在结构体,基本 数据类型,或者枚举值.对于这些类型,OC的方法只能返回固定的某个值(比如NSNotFound)来提示没有某个值.这要去方法的调用者清楚的记得返回的固定