### TheElements ###
================================================================================
DESCRIPTION:
TheElements is a sample application that provides access to the data contained in the
Periodic Table of the Elements. The Periodic Table of the Elements catalogs all the known
atomic elements in the universe.
TheElements provides this data in multiple formats, allowing you to sort the data by name,
atomic number, symbol name, and an elements physical state at room temperature.
TheElements is structured as a Model-View-Controller application. There is distinct
separation of the model data, the views used to present that data, and the controllers which
act as a liaison between the model and controller.
The application illustrates the following techniques:
Configuring and responding to selections in a tab bar
Displaying information in a tableview using both plain and grouped style table views
Using navigation controllers to navigate deeper into a data structure
Subclassing UIView
Providing a custom UITableViewCell consisting of multiple subviews
Implementing the UITableViewDelegate protocol
Implementing the UITableViewDataSource protocol
Reacting to taps in views
Open a URL to an external web site using Safari
Flipping view content from front to back
Creating a reflection of a view in the interface
TheElements is a fairly large application with many classes. This document attempts to explain
those classes and their roles in the application.
To understand the flow of screens from one to the next when using the application see the
ApplicationFlow.pdf included with the project.
================================================================================
BUILD REQUIREMENTS:
iOS 6.0 SDK
================================================================================
RUNTIME REQUIREMENTS:
iOS 5.0 or later
================================================================================
PACKAGING LIST:
AtomicElement.h
AtomicElement.m
The AtomicElement class encapsulates the data for a single atomic element. It contains the
name, atomic number, symbol, and state information, along with layout information
(horizontal and vertical positions). It returns the image that represents the state of the
object, which displayed in each visual representation of an element.
PeriodicTable.h
PeriodicTable.m
The PeriodicTable class encapsulates the collection of AtomicElement instances. It provides
access to elements in a variety of formats: sorted numerically, sorted by name, sorted by
symbol, elements for an atomic state, and elements that begin with a specific character.
This data is pre-sorted and indexed when the raw element information is read from the
Elements.plist. The PeriodicTable class is a singleton, there is one instance that is shared
by the entire application.
ElementsTableViewController.h
ElementsTableViewController.m
ElementsTableViewController is the controller class that is used for each of the four
representations of the elements data that is displayed in UITableView objects. It is
responsible for creating and configuring instances of UITableView when requested.
The ElementsTableViewController class adopts the UITableViewDelegate protocol, agreeing
to provide the cells for the tableview.
It provides instances of the custom table cell class ElementTableViewCell pre-populated
with the appropriate AtomicElement object when asked by the UITableViewDelegate for the
cell to be displayed for a row and section.
As the UITableView delegate an instance of the ElementsTableViewController class will also
receive messages when a user taps on a row in the table view. Upon receiving this event it
asks its data source object for the AtomicElement object that it represents and then instructs
the navigation controller for the view controller to push an instance of the
AtomicElementViewController class onto the navigation stack.
AtomicElementTableViewCell.h
AtomicElementTableViewCell.m
Each row in a UITableView displays a custom table cell of the class AtomicElementTableViewCell.
This custom class displays a graphic indicating the symbol, atomic number, and state of the
element, as well as a text label with the generally accepted name of the element.
ElementsDataSourceProtocol.h
ElementsSortedByNameDataSource.h
ElementsSortedByNameDataSource.m
ElementsSortedByNumberDataSource.h
ElementsSortedByNumberDataSource.m
ElementsSortedBySymbolDataSource.h
ElementsSortedBySymbolDataSource.m
ElementsSortedByStateDataSource.h
ElementsSortedByStateDataSource.m
The data source classes provide the data for the ElementsTableViewController, the UITabBarItem,
the UINavigationController and the UITableView that is displayed within those views. There
are four classes: ElementsSortedByNameDataSource, ElementsSortedByAtomicNumberDataSource,
ElementsSortedBySymbolDataSource, and ElementsSortedByStateDataSource.
These classes all adopt and implement the UITableViewDataSource protocol and are set as the
dataSource for the UITableView displayed for the data sorted in each manner. As the table
view requires data it sends messages to its dataSource (one of these class instances) and
that data is displayed.
These classes also adopt the ElementsDataSource protocol. This protocol is defined by the
application and provides a uniform means for the ElementsTableViewController to determine
the title displayed in the tab bar and navigation controller, the images displayed in the
UITabBarItem for this data representation, and the style the UITableView uses to display
the data (indexed or grouped depending on the sorted representation of the Periodic
Table data.
AtomicElementViewController.h
AtomicElementViewController.m
When a user taps on a row in a UITableView listing a collection of elements the table's
delegate (ElementsTableViewController) receives a message. Upon receiving this event the
ElementsTableViewController asks its data source object for the AtomicElement object that
it represents and then instructs the navigation controller for the view controller to push
an instance of the AtomicElementViewController class onto the navigation stack.
The AtomicElementViewController is responsible for displaying the single element view as a
large tile. The initial view displayed is the AtomicElementView. It is also responsible for
ensuring that the flipper button in the navigation bar shows that there is another view
available for the content by tapping on the tile.
AtomicElementView.h
AtomicElementView.m
The AtomicElementView is displayed in the content of the AtomicElementViewController.
It displays the atomic name, number, symbol, and state of the element. By tapping on the
element the display will 'flip' to show the AtomicElementFlippedView.
AtomicElementFlippedView.h
AtomicElementFlippedView.m
This view displays the Atomic name, number, and state of the current element, as well as a
link to the appropriate page on Wikipedia.
================================================================================
CHANGES FROM PREVIOUS VERSIONS:
Version 1.12
- Upgraded for iOS 6.0 SDK, updated to adopt current best practices for Objective-C,
now using UITapGestureRecognizer for AtomicElementView, Storyboards, Automatic Reference Counting (ARC).
Version 1.11
- Upgraded project to build with the iOS 4.0 SDK.
Version 1.9
- Changed the target setting's "Code Signing Identity" to the proper value.
Version 1.8
- Upgraded for 3.0 SDK due to deprecated APIs; in "cellForRowAtIndexPath" it now uses UITableViewCell's initWithStyle.
Version 1.7
- Updated for and tested with iPhone OS 2.0. First public release.
- Added additional date to the Element View
- Fixed memory leaks in reflection implementation
Version 1.6
- Updated with API changes for beta 6 relesae of iPhone OS SDK.
- The UITableViewDelegate method tableView: cellForRowAtIndexPath: was
moved to the UITableViewDataSource protocol. This resulted in a change to
the El
没有合适的资源?快使用搜索试试~ 我知道了~
IOS通讯录一样的TableView实现
共60个文件
png:26个
h:14个
m:14个
5星 · 超过95%的资源 需积分: 9 162 下载量 140 浏览量
2013-08-23
10:24:53
上传
评论 5
收藏 530KB ZIP 举报
温馨提示
iphone上通讯录一样的UITableView实现,字母分组,滚动条显示字母列表,点击跳转到对应的分组,官方例子
资源推荐
资源详情
资源评论
收起资源包目录
TheElements.zip (60个子文件)
TheElements
main.m 3KB
Elements.plist 62KB
TheElements.xcodeproj
project.pbxproj 35KB
Images
Gas_30.png 2KB
Liquid_24.png 969B
Artificial_37.png 5KB
Default
Default.png 6KB
Default-568h@2x.png 14KB
Default@2x.png 13KB
ApplicationFlow.png 244KB
Solid_24.png 968B
flipper_list_blue.png 2KB
Liquid_37.png 5KB
table_gray.png 1KB
number_gray.png 2KB
Gas_37.png 5KB
name_gray.png 1KB
Gas_24.png 969B
Artificial_30.png 2KB
Liquid_256.png 42KB
Gas_256.png 43KB
Liquid_30.png 2KB
state_gray.png 1KB
Solid_37.png 4KB
Artificial_256.png 40KB
Solid_30.png 1KB
symbol_gray.png 1KB
Solid_256.png 27KB
Artificial_24.png 973B
Readme.txt 11KB
TheElements_Prefix.pch 191B
Info.plist 991B
en.lproj
MainStoryboard.storyboard 8KB
Classes
AtomicElement.h 3KB
ElementsSortedBySymbolDataSource.h 3KB
ElementsSortedByAtomicNumberDataSource.h 3KB
ElementsSortedBySymbolDataSource.m 4KB
PeriodicElements.h 3KB
AtomicElementFlippedView.h 3KB
AtomicElementView.m 9KB
AtomicElementView.h 3KB
AtomicElementViewController.h 3KB
ElementsDataSourceProtocol.h 3KB
ElementsSortedByAtomicNumberDataSource.m 4KB
TheElementsAppDelegate.m 6KB
AtomicElement.m 5KB
ElementsSortedByNameDataSource.m 6KB
AtomicElementViewController.m 9KB
AtomicElementTableViewCell.m 3KB
ElementsTableViewController.m 5KB
ElementsSortedByStateDataSource.m 6KB
AtomicElementTableViewCell.h 3KB
AtomicElementTileView.h 3KB
TheElementsAppDelegate.h 3KB
ElementsTableViewController.h 3KB
ElementsSortedByStateDataSource.h 3KB
AtomicElementFlippedView.m 7KB
PeriodicElements.m 9KB
ElementsSortedByNameDataSource.h 3KB
AtomicElementTileView.m 4KB
共 60 条
- 1
pantie05
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 51单片机学习(1)-软件keil下载
- 历届(第1-21届)希望杯数学竞赛初一试题及答案(最新整理).doc全国数学邀请赛(264页资料)
- 水滴.psd
- TokenPocket_V2.1.2_release.apk
- Apache-druid-kafka-rce.yaml
- 基于C#的ASP.NET数据库原理及应用技术课程指导平台的开发
- 基于ROS的智能车轨迹跟踪算法的仿真与设计源码运用PID跟踪算法.zip.zip
- Bug Bounty Tip - i春秋Self-XSS变废为宝的奇思妙想
- 1991-2015年全国初中化学竞赛复赛试题汇编(212页)(24年竞赛复赛真题).docx天原杯
- Apache Flink 未授权访问+远程代码执行.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页