•  


GitHub - ulukaya/material-components-ios: Modular and customizable Material Design UI components for iOS
Skip to content

ulukaya/material-components-ios

 
 

Repository files navigation

Material Components for iOS

Build Status Code coverage Chat

Material Components for iOS (MDC-iOS) helps developers execute Material Design . Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional iOS apps. Learn more about how Material Components for iOS supports design and usability best practices across platforms in the Material Design Platform Adaptation guidelines .

Material Components for iOS are written in Objective-C and support Swift and Interface Builder.

Useful Links

Trying out Material Components

Our catalog showcases Material Components. You can use the pod try command from anywhere on your machine to try the components, even if you haven't checked out the repo yet:

pod try MaterialComponents

In case you have already checked out the repo, run the following command:

pod install --project-directory=catalog/

If you want to take a look at the implementation of the components, you can find the code inside the Development Pods folder. Use cmd-1 to open the project navigator within Xcode. Peal open the Pods project and inside the Development Pods folder you will find the component source code.

Installation

Getting Started with a New Project

Check out our tutorial for a step-by-step guide to setting up a new project using Material Components.

Adding Material Components to an Existing Project

CocoaPods is the easiest way to get started (if you're new to CocoaPods, check out their getting started documentation .)

To install CocoaPods, run the following commands:

sudo gem install cocoapods

To integrate Material Components in your existing application, first create a new Podfile:

cd
 your-project-directory
pod init

Next, add the Material Components for iOS pod to your target in your Podfile:

target
 "MyApp"
 do

  ...
  
pod
 'MaterialComponents'

end

If you are using Swift, don’t forget to uncomment the use_frameworks! line at the top of your Podfile.

Then run the command:

pod install

Now you're ready to get started in Xcode. Don't forget to open the workspace Cocoapods created for you instead of the original project:

open your-project.xcworkspace

Usage

The components are built upon familiar UIKit classes and can be added to a view with just a couple of lines. Simply import the Material Components header for the component you're interested in, and add it to your view.

Swift

import MaterialComponents
.
MaterialButtons

class
 ViewController
:
 UIViewController
 {


    override
 func
 viewDidLoad
(
)
 {

        super
.
viewDidLoad
(
)

        let
 raiseButton
 =
 MDCRaisedButton
(
)

        raiseButton
.
setTitle
(
"
Raised Button
"
,
 for
:
 .
normal
)

        raiseButton
.
sizeToFit
(
)

        raiseButton
.
addTarget
(
self
,
 action
:
 #selector
(
tapped
)
,
 for
:
 .
touchUpInside
)

        view
.
addSubview
(
raiseButton
)

    }


    @
objc
 func
 tapped
(
sender
:
 UIButton
)
{

        print
(
"
Button was tapped!
"
)

    }


}

Objective-C

#
import
 "
MaterialButtons.h
"


@implementation
 ViewController


- (
void
)
viewDidLoad
 {
  [
super
 viewDidLoad
];

  MDCRaisedButton *raisedButton = [[MDCRaisedButton 
alloc
] 
init
];
  [raisedButton 
setTitle:
@"
Raised Button
"
 forState:
UIControlStateNormal];
  [raisedButton 
sizeToFit
];
  [raisedButton 
addTarget:
self

                   action:
@selector
(
tapped:
)
         
forControlEvents:
UIControlEventTouchUpInside];

  [
self
.view 
addSubview:
raisedButton];
}

- (
void
)
tapped
:
(
id
)
sender
 {
  
NSLog
(
@"
Button was tapped!
"
);
}

@end

Attributions

Material Components for iOS uses Material Design icons , copyright Google Inc. and licensed under CC BY 4.0 .

Several components use MDFTextAccessibility , copyright Google Inc. and licensed under Apache 2.0 without a NOTICE file.

MDCCatalog uses the Roboto font , copyright 2011 Google Inc. and licensed under Apache 2.0 without a NOTICE file.

About

Modular and customizable Material Design UI components for iOS

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 81.8%
  • Swift 12.5%
  • Python 2.7%
  • Shell 1.8%
  • Other 1.2%
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본